| 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 GmailAltTwoLabelsPage(page_module.Page): | 10 class GmailAltTwoLabelsPage(page_module.Page): |
| 11 | 11 |
| 12 """ Why: Alternate between Inbox and Sent Mail """ | 12 """ Why: Alternate between Inbox and Sent Mail """ |
| 13 | 13 |
| 14 def __init__(self, page_set): | 14 def __init__(self, page_set): |
| 15 super(GmailAltTwoLabelsPage, self).__init__( | 15 super(GmailAltTwoLabelsPage, self).__init__( |
| 16 url='https://mail.google.com/mail/', | 16 url='https://mail.google.com/mail/', |
| 17 page_set=page_set, | 17 page_set=page_set, |
| 18 name='gmail_alt_two_labels') | 18 name='gmail_alt_two_labels') |
| 19 | 19 |
| 20 self.credentials_path = 'data/credentials.json' | 20 self.credentials_path = 'data/credentials.json' |
| 21 self.credentials = 'google' | 21 self.credentials = 'google' |
| 22 self.user_agent_type = 'desktop' | 22 self.user_agent_type = 'desktop' |
| 23 self.archive_data_file = 'data/gmail_alt_two_labels.json' | 23 self.archive_data_file = 'data/gmail_alt_two_labels.json' |
| 24 | 24 |
| 25 def RunNavigateSteps(self, action_runner): | 25 def RunNavigateSteps(self, action_runner): |
| 26 action_runner.RunAction(NavigateAction()) | 26 action_runner.NavigateToPage(self) |
| 27 action_runner.RunAction(WaitAction( | 27 action_runner.RunAction(WaitAction( |
| 28 { | 28 { |
| 29 'javascript': | 29 'javascript': |
| 30 'window.gmonkey !== undefined && document.getElementById("gb") !== null' | 30 'window.gmonkey !== undefined && document.getElementById("gb") !== null' |
| 31 })) | 31 })) |
| 32 | 32 |
| 33 def RunEndure(self, action_runner): | 33 def RunEndure(self, action_runner): |
| 34 action_runner.RunAction(ClickElementAction( | 34 action_runner.RunAction(ClickElementAction( |
| 35 { | 35 { |
| 36 'wait_until': {'condition': 'href_change'}, | 36 'wait_until': {'condition': 'href_change'}, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 """ Chrome Endure test for GMail. """ | 50 """ Chrome Endure test for GMail. """ |
| 51 | 51 |
| 52 def __init__(self): | 52 def __init__(self): |
| 53 super(GmailAltTwoLabelsPageSet, self).__init__( | 53 super(GmailAltTwoLabelsPageSet, self).__init__( |
| 54 credentials_path='data/credentials.json', | 54 credentials_path='data/credentials.json', |
| 55 user_agent_type='desktop', | 55 user_agent_type='desktop', |
| 56 archive_data_file='data/gmail_alt_two_labels.json') | 56 archive_data_file='data/gmail_alt_two_labels.json') |
| 57 | 57 |
| 58 self.AddPage(GmailAltTwoLabelsPage(self)) | 58 self.AddPage(GmailAltTwoLabelsPage(self)) |
| OLD | NEW |