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 6 7 8 class GmailExpandCollapseConversationPage( 9 page_module.Page): 10 11 """ Why: Expand and Collapse a long conversation. """ 12 # TODO(edmundyan): Find a long conversation rather than hardcode url 13 14 def __init__(self, page_set): 15 super(GmailExpandCollapseConversationPage, self).__init__( 16 url='https://mail.google.com/mail/u/0/#inbox/13c6a141fa95ffe0', 17 page_set=page_set, 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' 23 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"]') 28 action_runner.Wait(5) 29 action_runner.WaitForElement('img[alt="Collapse all"]') 30 action_runner.ClickElement('img[alt="Collapse all"]') 31 action_runner.Wait(1) 32 33 def RunEndure(self, action_runner): 34 action_runner.WaitForElement('img[alt="Expand all"]') 35 action_runner.ClickElement('img[alt="Expand all"]') 36 action_runner.Wait(1) 37 action_runner.WaitForElement('img[alt="Collapse all"]') 38 action_runner.ClickElement('img[alt="Collapse all"]') 39 action_runner.Wait(1) 40 41 42 class GmailExpandCollapseConversationPageSet(page_set_module.PageSet): 43 44 """ 45 Description: Chrome Endure test for GMail. 46 """ 47 48 def __init__(self): 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) 54 55 self.AddPage(GmailExpandCollapseConversationPage(self)) 56