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 | 4 |
5 import re | 5 import re |
6 | 6 |
7 # pylint: disable=W0401,W0614 | 7 # pylint: disable=W0401,W0614 |
8 from telemetry.page.actions.all_page_actions import * | 8 from telemetry.page.actions.all_page_actions import * |
9 from telemetry.page import page as page_module | 9 from telemetry.page import page as page_module |
10 from telemetry.page import page_set as page_set_module | 10 from telemetry.page import page_set as page_set_module |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 button.dispatchEvent(mousedownevent); | 49 button.dispatchEvent(mousedownevent); |
50 button.dispatchEvent(mouseupevent);''') | 50 button.dispatchEvent(mouseupevent);''') |
51 | 51 |
52 def RunEndure(self, action_runner): | 52 def RunEndure(self, action_runner): |
53 action_runner.WaitForElement( | 53 action_runner.WaitForElement( |
54 element_function=_CreateXpathFunction('//div[text()="COMPOSE"]')) | 54 element_function=_CreateXpathFunction('//div[text()="COMPOSE"]')) |
55 self.ComposeClick(action_runner) | 55 self.ComposeClick(action_runner) |
56 action_runner.Wait(1) | 56 action_runner.Wait(1) |
57 action_runner.WaitForElement( | 57 action_runner.WaitForElement( |
58 'div[class~="oh"][data-tooltip="Discard draft"]') | 58 'div[class~="oh"][data-tooltip="Discard draft"]') |
59 action_runner.RunAction(ClickElementAction( | 59 action_runner.ClickElement('div[class~="oh"][data-tooltip="Discard draft"]') |
60 { | |
61 'selector': 'div[class~="oh"][data-tooltip="Discard draft"]' | |
62 })) | |
63 action_runner.Wait(1) | 60 action_runner.Wait(1) |
64 | 61 |
65 | 62 |
66 class GmailComposeDiscardPageSet(page_set_module.PageSet): | 63 class GmailComposeDiscardPageSet(page_set_module.PageSet): |
67 | 64 |
68 """ | 65 """ |
69 Description: Gmail endure test: compose and discard an email. | 66 Description: Gmail endure test: compose and discard an email. |
70 """ | 67 """ |
71 | 68 |
72 def __init__(self): | 69 def __init__(self): |
73 super(GmailComposeDiscardPageSet, self).__init__( | 70 super(GmailComposeDiscardPageSet, self).__init__( |
74 credentials_path='data/credentials.json', | 71 credentials_path='data/credentials.json', |
75 user_agent_type='desktop') | 72 user_agent_type='desktop') |
76 | 73 |
77 self.AddPage(GmailComposeDiscardPage(self)) | 74 self.AddPage(GmailComposeDiscardPage(self)) |
OLD | NEW |