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 GmailExpandCollapseConversationPage(
11 """ Why: Expand and Collapse a long conversation. """
12 # TODO(edmundyan): Find a long conversation rather than hardcode url
14 def __init__(self
, page_set
):
15 super(GmailExpandCollapseConversationPage
, self
).__init
__(
16 url
='https://mail.google.com/mail/u/0/#inbox/13c6a141fa95ffe0',
18 name
='gmail_expand_collapse_conversation')
19 self
.credentials_path
= 'data/credentials.json'
20 self
.credentials
= 'google'
21 self
.user_agent_type
= 'desktop'
22 self
.archive_data_file
= 'data/gmail_expand_collapse_conversation.json'
24 def RunNavigateSteps(self
, action_runner
):
25 action_runner
.NavigateToPage(self
)
26 action_runner
.WaitForElement('img[alt="Expand all"]')
27 action_runner
.ClickElement('img[alt="Expand all"]')
29 action_runner
.WaitForElement('img[alt="Collapse all"]')
30 action_runner
.ClickElement('img[alt="Collapse all"]')
33 def RunEndure(self
, action_runner
):
34 action_runner
.WaitForElement('img[alt="Expand all"]')
35 action_runner
.ClickElement('img[alt="Expand all"]')
37 action_runner
.WaitForElement('img[alt="Collapse all"]')
38 action_runner
.ClickElement('img[alt="Collapse all"]')
42 class GmailExpandCollapseConversationPageSet(page_set_module
.PageSet
):
45 Description: Chrome Endure test for GMail.
49 super(GmailExpandCollapseConversationPageSet
, self
).__init
__(
50 credentials_path
='data/credentials.json',
51 user_agent_type
='desktop',
52 archive_data_file
='data/gmail_expand_collapse_conversation.json',
53 bucket
=page_set_module
.PUBLIC_BUCKET
)
55 self
.AddPage(GmailExpandCollapseConversationPage(self
))