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 PlusAltPostsPhotosPage(page_module
.Page
):
10 """ Why: Alternate between clicking posts and albums """
12 def __init__(self
, page_set
):
13 super(PlusAltPostsPhotosPage
, self
).__init
__(
14 url
='https://plus.google.com/+BarackObama/posts',
16 name
='plus_alt_posts_photos')
17 self
.credentials_path
= 'data/credentials.json'
18 self
.credentials
= 'google'
19 self
.user_agent_type
= 'desktop'
20 self
.archive_data_file
= 'data/plus_alt_posts_photos.json'
22 def RunNavigateSteps(self
, action_runner
):
23 action_runner
.NavigateToPage(self
)
24 action_runner
.WaitForElement(text
='Barack Obama')
25 action_runner
.WaitForElement(
26 'span[guidedhelpid="posts_tab_profile"][class*="s6U8x"]')
28 def RunEndure(self
, action_runner
):
29 action_runner
.ClickElement('span[guidedhelpid="posts_tab_profile"]')
30 action_runner
.WaitForElement(
31 'span[guidedhelpid="posts_tab_profile"][class*="s6U8x"]')
33 action_runner
.ClickElement('span[guidedhelpid="photos_tab_profile"]')
34 action_runner
.WaitForElement(
35 'span[guidedhelpid="photos_tab_profile"][class*="s6U8x"]')
39 class PlusAltPostsPhotosPageSet(page_set_module
.PageSet
):
41 """ Chrome Endure test for Google Plus. """
44 super(PlusAltPostsPhotosPageSet
, self
).__init
__(
45 credentials_path
='data/credentials.json',
46 user_agent_type
='desktop',
47 archive_data_file
='data/plus_alt_posts_photos.json',
48 bucket
=page_set_module
.PUBLIC_BUCKET
)
50 self
.AddPage(PlusAltPostsPhotosPage(self
))