| 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 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
| 5 from telemetry.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
| 6 | 6 |
| 7 | 7 |
| 8 class PlusAltPostsPhotosPage(page_module.Page): | 8 class PlusAltPostsPhotosPage(page_module.Page): |
| 9 | 9 |
| 10 """ Why: Alternate between clicking posts and albums """ | 10 """ Why: Alternate between clicking posts and albums """ |
| 11 | 11 |
| 12 def __init__(self, page_set): | 12 def __init__(self, page_set): |
| 13 super(PlusAltPostsPhotosPage, self).__init__( | 13 super(PlusAltPostsPhotosPage, self).__init__( |
| 14 url='https://plus.google.com/+BarackObama/posts', | 14 url='https://plus.google.com/+BarackObama/posts', |
| 15 page_set=page_set, | 15 page_set=page_set, |
| 16 name='plus_alt_posts_photos') | 16 name='plus_alt_posts_photos', |
| 17 self.credentials_path = 'data/credentials.json' | 17 credentials_path = 'data/credentials.json') |
| 18 self.credentials = 'google' | 18 self.credentials = 'google' |
| 19 self.user_agent_type = 'desktop' | 19 self.user_agent_type = 'desktop' |
| 20 self.archive_data_file = 'data/plus_alt_posts_photos.json' | 20 self.archive_data_file = 'data/plus_alt_posts_photos.json' |
| 21 | 21 |
| 22 def RunNavigateSteps(self, action_runner): | 22 def RunNavigateSteps(self, action_runner): |
| 23 action_runner.NavigateToPage(self) | 23 action_runner.NavigateToPage(self) |
| 24 action_runner.WaitForElement(text='Barack Obama') | 24 action_runner.WaitForElement(text='Barack Obama') |
| 25 action_runner.WaitForElement( | 25 action_runner.WaitForElement( |
| 26 'span[guidedhelpid="posts_tab_profile"][class*="s6U8x"]') | 26 'span[guidedhelpid="posts_tab_profile"][class*="s6U8x"]') |
| 27 | 27 |
| 28 def RunEndure(self, action_runner): | 28 def RunEndure(self, action_runner): |
| 29 action_runner.ClickElement('span[guidedhelpid="posts_tab_profile"]') | 29 action_runner.ClickElement('span[guidedhelpid="posts_tab_profile"]') |
| 30 action_runner.WaitForElement( | 30 action_runner.WaitForElement( |
| 31 'span[guidedhelpid="posts_tab_profile"][class*="s6U8x"]') | 31 'span[guidedhelpid="posts_tab_profile"][class*="s6U8x"]') |
| 32 action_runner.Wait(5) | 32 action_runner.Wait(5) |
| 33 action_runner.ClickElement('span[guidedhelpid="photos_tab_profile"]') | 33 action_runner.ClickElement('span[guidedhelpid="photos_tab_profile"]') |
| 34 action_runner.WaitForElement( | 34 action_runner.WaitForElement( |
| 35 'span[guidedhelpid="photos_tab_profile"][class*="s6U8x"]') | 35 'span[guidedhelpid="photos_tab_profile"][class*="s6U8x"]') |
| 36 action_runner.Wait(5) | 36 action_runner.Wait(5) |
| 37 | 37 |
| 38 | 38 |
| 39 class PlusAltPostsPhotosPageSet(page_set_module.PageSet): | 39 class PlusAltPostsPhotosPageSet(page_set_module.PageSet): |
| 40 | 40 |
| 41 """ Chrome Endure test for Google Plus. """ | 41 """ Chrome Endure test for Google Plus. """ |
| 42 | 42 |
| 43 def __init__(self): | 43 def __init__(self): |
| 44 super(PlusAltPostsPhotosPageSet, self).__init__( | 44 super(PlusAltPostsPhotosPageSet, self).__init__( |
| 45 credentials_path='data/credentials.json', | |
| 46 user_agent_type='desktop', | 45 user_agent_type='desktop', |
| 47 archive_data_file='data/plus_alt_posts_photos.json', | 46 archive_data_file='data/plus_alt_posts_photos.json', |
| 48 bucket=page_set_module.PUBLIC_BUCKET) | 47 bucket=page_set_module.PUBLIC_BUCKET) |
| 49 | 48 |
| 50 self.AddPage(PlusAltPostsPhotosPage(self)) | 49 self.AddPage(PlusAltPostsPhotosPage(self)) |
| OLD | NEW |