Home | History | Annotate | Download | only in page_sets
      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 # pylint: disable=W0401,W0614
      5 from telemetry.page.actions.all_page_actions import *
      6 from telemetry.page import page as page_module
      7 from telemetry.page import page_set as page_set_module
      8 
      9 
     10 class GmailExpandCollapseConversationPage(
     11   page_module.Page):
     12 
     13   """ Why: Expand and Collapse a long conversation. """
     14   # TODO(edmundyan): Find a long conversation rather than hardcode url
     15 
     16   def __init__(self, page_set):
     17     super(GmailExpandCollapseConversationPage, self).__init__(
     18       url='https://mail.google.com/mail/u/0/#inbox/13c6a141fa95ffe0',
     19       page_set=page_set,
     20       name='gmail_expand_collapse_conversation')
     21     self.credentials_path = 'data/credentials.json'
     22     self.credentials = 'google'
     23     self.user_agent_type = 'desktop'
     24     self.archive_data_file = 'data/gmail_expand_collapse_conversation.json'
     25 
     26   def RunNavigateSteps(self, action_runner):
     27     action_runner.NavigateToPage(self)
     28     action_runner.WaitForElement('img[alt="Expand all"]')
     29     action_runner.ClickElement('img[alt="Expand all"]')
     30     action_runner.Wait(5)
     31     action_runner.WaitForElement('img[alt="Collapse all"]')
     32     action_runner.ClickElement('img[alt="Collapse all"]')
     33     action_runner.Wait(1)
     34 
     35   def RunEndure(self, action_runner):
     36     action_runner.WaitForElement('img[alt="Expand all"]')
     37     action_runner.ClickElement('img[alt="Expand all"]')
     38     action_runner.Wait(1)
     39     action_runner.WaitForElement('img[alt="Collapse all"]')
     40     action_runner.ClickElement('img[alt="Collapse all"]')
     41     action_runner.Wait(1)
     42 
     43 
     44 class GmailExpandCollapseConversationPageSet(page_set_module.PageSet):
     45 
     46   """
     47   Description: Chrome Endure test for GMail.
     48   """
     49 
     50   def __init__(self):
     51     super(GmailExpandCollapseConversationPageSet, self).__init__(
     52       credentials_path='data/credentials.json',
     53       user_agent_type='desktop',
     54       archive_data_file='data/gmail_expand_collapse_conversation.json',
     55       bucket=page_set_module.PUBLIC_BUCKET)
     56 
     57     self.AddPage(GmailExpandCollapseConversationPage(self))
     58