OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 # pylint: disable=W0401,W0614 | 4 # pylint: disable=W0401,W0614 |
5 from telemetry.page.actions.all_page_actions import * | 5 from telemetry.page.actions.all_page_actions import * |
6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
8 | 8 |
9 | 9 |
10 class GmailExpandCollapseConversationPage( | 10 class GmailExpandCollapseConversationPage( |
11 page_module.Page): | 11 page_module.Page): |
12 | 12 |
13 """ Why: Expand and Collapse a long conversation. """ | 13 """ Why: Expand and Collapse a long conversation. """ |
14 # TODO(edmundyan): Find a long conversation rather than hardcode url | 14 # TODO(edmundyan): Find a long conversation rather than hardcode url |
15 | 15 |
16 def __init__(self, page_set): | 16 def __init__(self, page_set): |
17 super(GmailExpandCollapseConversationPage, self).__init__( | 17 super(GmailExpandCollapseConversationPage, self).__init__( |
18 url='https://mail.google.com/mail/u/0/#inbox/13c6a141fa95ffe0', | 18 url='https://mail.google.com/mail/u/0/#inbox/13c6a141fa95ffe0', |
19 page_set=page_set, | 19 page_set=page_set, |
20 name='gmail_expand_collapse_conversation') | 20 name='gmail_expand_collapse_conversation') |
21 self.credentials_path = 'data/credentials.json' | 21 self.credentials_path = 'data/credentials.json' |
22 self.credentials = 'google' | 22 self.credentials = 'google' |
23 self.user_agent_type = 'desktop' | 23 self.user_agent_type = 'desktop' |
24 self.archive_data_file = 'data/gmail_expand_collapse_conversation.json' | 24 self.archive_data_file = 'data/gmail_expand_collapse_conversation.json' |
25 | 25 |
26 def RunNavigateSteps(self, action_runner): | 26 def RunNavigateSteps(self, action_runner): |
27 action_runner.RunAction(NavigateAction()) | 27 action_runner.NavigateToPage(self) |
28 action_runner.RunAction(WaitAction( | 28 action_runner.RunAction(WaitAction( |
29 { | 29 { |
30 'condition': 'element', | 30 'condition': 'element', |
31 'selector': 'img[alt="Expand all"]' | 31 'selector': 'img[alt="Expand all"]' |
32 })) | 32 })) |
33 action_runner.RunAction(ClickElementAction( | 33 action_runner.RunAction(ClickElementAction( |
34 { | 34 { |
35 'selector': 'img[alt="Expand all"]' | 35 'selector': 'img[alt="Expand all"]' |
36 })) | 36 })) |
37 action_runner.RunAction(WaitAction({'seconds': 5})) | 37 action_runner.RunAction(WaitAction({'seconds': 5})) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 Description: Chrome Endure test for GMail. | 75 Description: Chrome Endure test for GMail. |
76 """ | 76 """ |
77 | 77 |
78 def __init__(self): | 78 def __init__(self): |
79 super(GmailExpandCollapseConversationPageSet, self).__init__( | 79 super(GmailExpandCollapseConversationPageSet, self).__init__( |
80 credentials_path='data/credentials.json', | 80 credentials_path='data/credentials.json', |
81 user_agent_type='desktop', | 81 user_agent_type='desktop', |
82 archive_data_file='data/gmail_expand_collapse_conversation.json') | 82 archive_data_file='data/gmail_expand_collapse_conversation.json') |
83 | 83 |
84 self.AddPage(GmailExpandCollapseConversationPage(self)) | 84 self.AddPage(GmailExpandCollapseConversationPage(self)) |
OLD | NEW |