1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 from telemetry
.page
import page
as page_module
5 from telemetry
.page
import page_set
as page_set_module
8 class CalendarForwardBackwardPage(page_module
.Page
):
10 """ Why: Click forward(4x) and backwards(4x) repeatedly """
12 def __init__(self
, page_set
):
13 super(CalendarForwardBackwardPage
, self
).__init
__(
14 url
='https://www.google.com/calendar/',
16 name
='calendar_forward_backward')
17 self
.credentials_path
= 'data/credentials.json'
18 self
.credentials
= 'google'
19 self
.user_agent_type
= 'desktop'
20 self
.archive_data_file
= 'data/calendar_forward_backward.json'
22 def RunNavigateSteps(self
, action_runner
):
23 action_runner
.NavigateToPage(self
)
25 action_runner
.WaitForElement('div[class~="navForward"]')
26 action_runner
.ExecuteJavaScript('''
28 var elem = document.createElement('meta');
30 elem.content='initial-scale=1';
31 document.body.appendChild(elem);
34 def RunEndure(self
, action_runner
):
35 action_runner
.ClickElement('div[class~="navForward"]')
37 action_runner
.WaitForElement('div[class~="navForward"]')
38 action_runner
.ClickElement('div[class~="navForward"]')
40 action_runner
.WaitForElement('div[class~="navForward"]')
41 action_runner
.ClickElement('div[class~="navForward"]')
43 action_runner
.WaitForElement('div[class~="navForward"]')
44 action_runner
.ClickElement('div[class~="navForward"]')
46 action_runner
.WaitForElement('div[class~="navBack"]')
47 action_runner
.ClickElement('div[class~="navBack"]')
49 action_runner
.WaitForElement('div[class~="navBack"]')
50 action_runner
.ClickElement('div[class~="navBack"]')
52 action_runner
.WaitForElement('div[class~="navBack"]')
53 action_runner
.ClickElement('div[class~="navBack"]')
55 action_runner
.WaitForElement('div[class~="navBack"]')
56 action_runner
.ClickElement('div[class~="navBack"]')
58 action_runner
.WaitForElement('div[class~="navForward"]')
61 class CalendarForwardBackwardPageSet(page_set_module
.PageSet
):
63 """ Chrome Endure test for Google Calendar. """
66 super(CalendarForwardBackwardPageSet
, self
).__init
__(
67 credentials_path
='data/credentials.json',
68 user_agent_type
='desktop',
69 archive_data_file
='data/calendar_forward_backward.json',
70 bucket
=page_set_module
.PUBLIC_BUCKET
)
72 self
.AddPage(CalendarForwardBackwardPage(self
))