Commit 025f70b5 authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

telemetry: Allow specifying extra_browser_args for top pages.

We want multiple instances of these pages with different flags e.g.
sw raster and gpu raster in the new rendering.desktop/mobile page sets.

BUG=760553

Change-Id: I48e2ac82a4314cdf36a61f301559160b8d801f52
Reviewed-on: https://chromium-review.googlesource.com/887798
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#533043}
parent 4eb5b28c
......@@ -7,25 +7,30 @@ from telemetry.page import shared_page_state
class KeyMobileSitesPage(page_module.Page):
def __init__(self, url, page_set, name='', tags=None):
def __init__(self, url, page_set, name='', tags=None,
extra_browser_args=None):
if name == '':
name = url
super(KeyMobileSitesPage, self).__init__(
url=url, page_set=page_set, name=name,
url=url,
page_set=page_set,
name=name,
shared_page_state_class=shared_page_state.SharedMobilePageState,
tags=tags)
tags=tags,
extra_browser_args=extra_browser_args)
class CapitolVolkswagenPage(KeyMobileSitesPage):
""" Why: Typical mobile business site """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(CapitolVolkswagenPage, self).__init__(
url=('http://iphone.capitolvolkswagen.com/index.htm'
'#new-inventory_p_2Fsb-new_p_2Ehtm_p_3Freset_p_3DInventoryListing'),
page_set=page_set,
name=name)
url=(
'http://iphone.capitolvolkswagen.com/index.htm'
'#new-inventory_p_2Fsb-new_p_2Ehtm_p_3Freset_p_3DInventoryListing'),
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(CapitolVolkswagenPage, self).RunNavigateSteps(action_runner)
......@@ -34,17 +39,17 @@ class CapitolVolkswagenPage(KeyMobileSitesPage):
'document.body.scrollHeight > 2560')
class TheVergeArticlePage(KeyMobileSitesPage):
""" Why: Top tech blog """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(TheVergeArticlePage, self).__init__(
# pylint: disable=line-too-long
url='http://www.theverge.com/2012/10/28/3568746/amazon-7-inch-fire-hd-ipad-mini-ad-ballsy',
page_set=page_set,
name=name)
# pylint: disable=line-too-long
url=
'http://www.theverge.com/2012/10/28/3568746/amazon-7-inch-fire-hd-ipad-mini-ad-ballsy',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(TheVergeArticlePage, self).RunNavigateSteps(action_runner)
......@@ -57,31 +62,31 @@ class TheVergeArticlePage(KeyMobileSitesPage):
class CnnArticlePage(KeyMobileSitesPage):
""" Why: Top news site """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(CnnArticlePage, self).__init__(
# pylint: disable=line-too-long
url='http://www.cnn.com/2012/10/03/politics/michelle-obama-debate/index.html',
page_set=page_set,
name=name)
# pylint: disable=line-too-long
url=
'http://www.cnn.com/2012/10/03/politics/michelle-obama-debate/index.html',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(CnnArticlePage, self).RunNavigateSteps(action_runner)
action_runner.Wait(8)
class FacebookPage(KeyMobileSitesPage):
""" Why: #1 (Alexa global) """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(FacebookPage, self).__init__(
url='https://facebook.com/barackobama',
page_set=page_set,
name=name)
url='https://facebook.com/barackobama',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(FacebookPage, self).RunNavigateSteps(action_runner)
......@@ -91,14 +96,14 @@ class FacebookPage(KeyMobileSitesPage):
class YoutubeMobilePage(KeyMobileSitesPage):
""" Why: #3 (Alexa global) """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(YoutubeMobilePage, self).__init__(
url='http://m.youtube.com/watch?v=9hBpF_Zj4OA',
page_set=page_set,
name=name)
url='http://m.youtube.com/watch?v=9hBpF_Zj4OA',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(YoutubeMobilePage, self).RunNavigateSteps(action_runner)
......@@ -107,14 +112,14 @@ class YoutubeMobilePage(KeyMobileSitesPage):
class LinkedInPage(KeyMobileSitesPage):
""" Why: #12 (Alexa global),Public profile """
def __init__(self, page_set, name='LinkedIn'):
def __init__(self, page_set, name='LinkedIn', extra_browser_args=None):
super(LinkedInPage, self).__init__(
url='https://www.linkedin.com/in/linustorvalds',
page_set=page_set,
name=name)
url='https://www.linkedin.com/in/linustorvalds',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(LinkedInPage, self).RunNavigateSteps(action_runner)
......@@ -122,17 +127,16 @@ class LinkedInPage(KeyMobileSitesPage):
'document.getElementById("profile-view-scroller") !== null')
class YahooAnswersPage(KeyMobileSitesPage):
""" Why: #1 Alexa reference """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(YahooAnswersPage, self).__init__(
# pylint: disable=line-too-long
url='http://answers.yahoo.com/question/index?qid=20110117024343AAopj8f',
page_set=page_set,
name=name)
# pylint: disable=line-too-long
url='http://answers.yahoo.com/question/index?qid=20110117024343AAopj8f',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(YahooAnswersPage, self).RunNavigateSteps(action_runner)
......@@ -141,37 +145,36 @@ class YahooAnswersPage(KeyMobileSitesPage):
class GroupClonedPage(KeyMobileSitesPage):
""" Why: crbug.com/172906 """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(GroupClonedPage, self).__init__(
url='http://groupcloned.com',
page_set=page_set,
name=name)
url='http://groupcloned.com',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(GroupClonedPage, self).RunNavigateSteps(action_runner)
action_runner.Wait(5)
action_runner.WaitForJavaScriptCondition('''
action_runner.WaitForJavaScriptCondition("""
document.getElementById("element-19") !== null &&
document.getElementById("element-19").contentDocument
.getElementById("element-22") !== null &&
document.getElementById("element-19").contentDocument
.getElementsByClassName(
"container list-item gc-list-item stretched").length !== 0''')
"container list-item gc-list-item stretched").length !== 0""")
class GroupClonedListImagesPage(KeyMobileSitesPage):
""" Why: crbug.com/172906 """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(GroupClonedListImagesPage, self).__init__(
url='http://groupcloned.com/test/list-images-variable/index.html',
page_set=page_set,
name=name)
url='http://groupcloned.com/test/list-images-variable/index.html',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(GroupClonedListImagesPage, self).RunNavigateSteps(action_runner)
......@@ -180,14 +183,14 @@ class GroupClonedListImagesPage(KeyMobileSitesPage):
class GoogleNewsMobilePage(KeyMobileSitesPage):
""" Why: Google News: accelerated scrolling version """
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(GoogleNewsMobilePage, self).__init__(
url='http://mobile-news.sandbox.google.com/news/pt1',
page_set=page_set,
name=name)
url='http://mobile-news.sandbox.google.com/news/pt1',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(GoogleNewsMobilePage, self).RunNavigateSteps(action_runner)
......@@ -197,16 +200,16 @@ class GoogleNewsMobilePage(KeyMobileSitesPage):
class GoogleNewsMobile2Page(KeyMobileSitesPage):
"""
Why: Google News: this iOS version is slower than accelerated scrolling
"""
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(GoogleNewsMobile2Page, self).__init__(
url='http://mobile-news.sandbox.google.com/news/pt0',
page_set=page_set,
name=name)
url='http://mobile-news.sandbox.google.com/news/pt0',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(GoogleNewsMobile2Page, self).RunNavigateSteps(action_runner)
......@@ -216,13 +219,13 @@ class GoogleNewsMobile2Page(KeyMobileSitesPage):
class AmazonNicolasCagePage(KeyMobileSitesPage):
"""
Why: #1 world commerce website by visits; #3 commerce in the US by time spent
"""
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(AmazonNicolasCagePage, self).__init__(
url='http://www.amazon.com/gp/aw/s/ref=is_box_?k=nicolas+cage',
page_set=page_set,
name=name)
url='http://www.amazon.com/gp/aw/s/ref=is_box_?k=nicolas+cage',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
......@@ -14,35 +14,47 @@ def _IssueMarkerAndScroll(action_runner):
def _CreatePageClassWithSmoothInteractions(page_cls):
class DerivedSmoothPage(page_cls): # pylint: disable=no-init
def RunPageInteractions(self, action_runner):
_IssueMarkerAndScroll(action_runner)
return DerivedSmoothPage
class KeyMobileSitesSmoothPage(page_module.Page):
def __init__(self, url, page_set, name='', tags=None,
action_on_load_complete=False):
def __init__(self,
url,
page_set,
name='',
tags=None,
action_on_load_complete=False,
extra_browser_args=None):
if name == '':
name = url
super(KeyMobileSitesSmoothPage, self).__init__(
url=url, page_set=page_set, name=name, tags=tags,
shared_page_state_class=shared_page_state.SharedMobilePageState)
url=url,
page_set=page_set,
name=name,
tags=tags,
shared_page_state_class=shared_page_state.SharedMobilePageState,
extra_browser_args=extra_browser_args)
self.action_on_load_complete = action_on_load_complete
def RunPageInteractions(self, action_runner):
if self.action_on_load_complete:
action_runner.WaitForJavaScriptCondition(
'document.readyState == "complete"', timeout=30)
action_runner.WaitForJavaScriptCondition(
'document.readyState == "complete"', timeout=30)
_IssueMarkerAndScroll(action_runner)
class LinkedInSmoothPage(key_mobile_sites_pages.LinkedInPage):
def __init__(self, page_set, name=''):
super(LinkedInSmoothPage, self).__init__(page_set=page_set, name=name)
def __init__(self, page_set, name='', extra_browser_args=None):
super(LinkedInSmoothPage, self).__init__(
page_set=page_set, name=name, extra_browser_args=extra_browser_args)
# Linkedin has expensive shader compilation so it can benefit from shader
# cache from reload.
......@@ -54,11 +66,13 @@ class LinkedInSmoothPage(key_mobile_sites_pages.LinkedInPage):
class WowwikiSmoothPage(KeyMobileSitesSmoothPage):
"""Why: Mobile wiki."""
def __init__(self, page_set, name=''):
def __init__(self, page_set, name='', extra_browser_args=None):
super(WowwikiSmoothPage, self).__init__(
url='http://www.wowwiki.com/World_of_Warcraft:_Mists_of_Pandaria',
page_set=page_set,
name=name)
url='http://www.wowwiki.com/World_of_Warcraft:_Mists_of_Pandaria',
page_set=page_set,
name=name,
extra_browser_args=extra_browser_args)
# Wowwiki has expensive shader compilation so it can benefit from shader
# cache from reload.
......@@ -73,41 +87,40 @@ class GroupClonedSmoothPage(key_mobile_sites_pages.GroupClonedPage):
def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollPage(
distance_expr='''
distance_expr="""
Math.max(0, 1250 + document.getElementById("element-19")
.contentDocument
.getElementById("element-22")
.getBoundingClientRect().top);''',
.getBoundingClientRect().top);""",
use_touch=True)
class GroupClonedListImagesPage(
key_mobile_sites_pages.GroupClonedListImagesPage):
key_mobile_sites_pages.GroupClonedListImagesPage):
def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollPage(
distance_expr='''
distance_expr="""
Math.max(0, 1250 +
document.getElementById("element-5")
.getBoundingClientRect().top);''',
.getBoundingClientRect().top);""",
use_touch=True)
class GoogleNewsMobile2SmoothPage(
key_mobile_sites_pages.GoogleNewsMobile2Page):
class GoogleNewsMobile2SmoothPage(key_mobile_sites_pages.GoogleNewsMobile2Page):
def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollElement(
element_function='document.getElementById(":5")',
distance_expr='''
distance_expr="""
Math.max(0, 2500 +
document.getElementById(':h').getBoundingClientRect().top)''',
document.getElementById(':h').getBoundingClientRect().top)""",
use_touch=True)
class AmazonNicolasCageSmoothPage(
key_mobile_sites_pages.AmazonNicolasCagePage):
class AmazonNicolasCageSmoothPage(key_mobile_sites_pages.AmazonNicolasCagePage):
def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'):
......@@ -115,8 +128,8 @@ class AmazonNicolasCageSmoothPage(
selector='#search',
distance_expr='document.body.scrollHeight - window.innerHeight')
class CNNArticleSmoothPage(
key_mobile_sites_pages.CnnArticlePage):
class CNNArticleSmoothPage(key_mobile_sites_pages.CnnArticlePage):
def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'):
......@@ -124,31 +137,29 @@ class CNNArticleSmoothPage(
# will not be in the root scroller.
action_runner.ScrollPage(top_start_ratio=0.01)
class KeyMobileSitesSmoothPageSet(story.StorySet):
class KeyMobileSitesSmoothPageSet(story.StorySet):
""" Key mobile sites with smooth interactions. """
def __init__(self):
super(KeyMobileSitesSmoothPageSet, self).__init__(
archive_data_file='data/key_mobile_sites_smooth.json',
cloud_storage_bucket=story.PARTNER_BUCKET)
archive_data_file='data/key_mobile_sites_smooth.json',
cloud_storage_bucket=story.PARTNER_BUCKET)
# Add pages with predefined classes that contain custom navigation logic.
predefined_page_classes = [
key_mobile_sites_pages.CapitolVolkswagenPage,
key_mobile_sites_pages.TheVergeArticlePage,
key_mobile_sites_pages.FacebookPage,
key_mobile_sites_pages.YoutubeMobilePage,
key_mobile_sites_pages.YahooAnswersPage,
key_mobile_sites_pages.GoogleNewsMobilePage,
key_mobile_sites_pages.CapitolVolkswagenPage,
key_mobile_sites_pages.TheVergeArticlePage,
key_mobile_sites_pages.FacebookPage,
key_mobile_sites_pages.YoutubeMobilePage,
key_mobile_sites_pages.YahooAnswersPage,
key_mobile_sites_pages.GoogleNewsMobilePage,
]
for page_class in predefined_page_classes:
self.AddStory(
_CreatePageClassWithSmoothInteractions(page_class)(self))
self.AddStory(_CreatePageClassWithSmoothInteractions(page_class)(self))
self.AddStory(
_CreatePageClassWithSmoothInteractions(LinkedInSmoothPage)(self))
_CreatePageClassWithSmoothInteractions(LinkedInSmoothPage)(self))
self.AddStory(WowwikiSmoothPage(self))
# Add pages with custom page interaction logic.
......@@ -169,37 +180,45 @@ class KeyMobileSitesSmoothPageSet(story.StorySet):
# Add pages with custom tags.
# Why: Top news site.
self.AddStory(KeyMobileSitesSmoothPage(
url='http://nytimes.com/', page_set=self, tags=['fastpath']))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://nytimes.com/', page_set=self, tags=['fastpath']))
# Why: Image-heavy site.
self.AddStory(KeyMobileSitesSmoothPage(
url='http://cuteoverload.com', page_set=self, tags=['fastpath']))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://cuteoverload.com', page_set=self, tags=['fastpath']))
# Why: #11 (Alexa global), google property; some blogger layouts
# have infinite scroll but more interesting.
self.AddStory(KeyMobileSitesSmoothPage(
url='http://googlewebmastercentral.blogspot.com/',
page_set=self, name='Blogger'))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://googlewebmastercentral.blogspot.com/',
page_set=self,
name='Blogger'))
# Why: #18 (Alexa global), Picked an interesting post """
self.AddStory(KeyMobileSitesSmoothPage(
url='http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/',
page_set=self,
name='Wordpress'))
self.AddStory(
KeyMobileSitesSmoothPage(
url=
'http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/',
page_set=self,
name='Wordpress'))
# Why: #6 (Alexa) most visited worldwide, picked an interesting page
self.AddStory(KeyMobileSitesSmoothPage(
url='http://en.wikipedia.org/wiki/Wikipedia',
page_set=self,
name='Wikipedia_(1_tab)'))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://en.wikipedia.org/wiki/Wikipedia',
page_set=self,
name='Wikipedia_(1_tab)'))
# Why: Wikipedia page with a delayed scroll start
self.AddStory(KeyMobileSitesSmoothPage(
url='http://en.wikipedia.org/wiki/Wikipedia',
page_set=self,
name='Wikipedia_(1_tab)-delayed_scroll_start',
action_on_load_complete=True))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://en.wikipedia.org/wiki/Wikipedia',
page_set=self,
name='Wikipedia_(1_tab)-delayed_scroll_start',
action_on_load_complete=True))
# Why: #8 (Alexa global), picked an interesting page
# Forbidden (Rate Limit Exceeded)
......@@ -207,10 +226,9 @@ class KeyMobileSitesSmoothPageSet(story.StorySet):
# url='http://twitter.com/katyperry', page_set=self, name='Twitter'))
# Why: #37 (Alexa global) """
self.AddStory(KeyMobileSitesSmoothPage(
url='http://pinterest.com',
page_set=self,
name='Pinterest'))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://pinterest.com', page_set=self, name='Pinterest'))
# Why: #1 sports.
# Fails often; crbug.com/249722'
......@@ -221,62 +239,66 @@ class KeyMobileSitesSmoothPageSet(story.StorySet):
# self.AddStory(KeyMobileSitesSmoothPage(
# url='http://forecast.io', page_set=self))
# Why: crbug.com/169827
self.AddStory(KeyMobileSitesSmoothPage(
url='http://slashdot.org/', page_set=self, tags=['fastpath']))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://slashdot.org/', page_set=self, tags=['fastpath']))
# Why: #5 Alexa news """
self.AddStory(KeyMobileSitesSmoothPage(
url='http://www.reddit.com/r/programming/comments/1g96ve',
page_set=self, tags=['fastpath']))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://www.reddit.com/r/programming/comments/1g96ve',
page_set=self,
tags=['fastpath']))
# Why: Problematic use of fixed position elements """
self.AddStory(KeyMobileSitesSmoothPage(
url='http://www.boingboing.net', page_set=self, tags=['fastpath']))
self.AddStory(
KeyMobileSitesSmoothPage(
url='http://www.boingboing.net', page_set=self, tags=['fastpath']))
# Add simple pages with no custom navigation logic or tags.
urls_list = [
# Why: Social; top Google property; Public profile; infinite scrolls.
'https://plus.google.com/app/basic/110031535020051778989/posts?source=apppromo',
# Why: crbug.com/242544
('http://www.androidpolice.com/2012/10/03/rumor-evidence-mounts-that-an-'
'lg-optimus-g-nexus-is-coming-along-with-a-nexus-phone-certification-'
'program/'),
# Why: crbug.com/149958
'http://gsp.ro',
# Why: Top tech blog
'http://theverge.com',
# Why: Top tech site
'http://digg.com',
# Why: Top Google property; a Google tab is often open
'https://www.google.co.uk/search?hl=en&q=barack+obama&cad=h',
# Why: #1 news worldwide (Alexa global)
'http://news.yahoo.com',
# Why: #2 news worldwide
'http://www.cnn.com',
# Why: #1 commerce website by time spent by users in US
'http://shop.mobileweb.ebay.com/searchresults?kw=viking+helmet',
# Why: #1 Alexa recreation
'http://www.booking.com/searchresults.html?src=searchresults&latitude=65.0500&longitude=25.4667',
# Why: Top tech blog
'http://techcrunch.com',
# Why: #6 Alexa sports
'http://mlb.com/',
# Why: #14 Alexa California
'http://www.sfgate.com/',
# Why: Non-latin character set
'http://worldjournal.com/',
# Why: #15 Alexa news
'http://online.wsj.com/home-page',
# Why: Image-heavy mobile site
'http://www.deviantart.com/',
# Why: Top search engine
('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&'
'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'),
# Why: Top search engine
'http://www.bing.com/search?q=sloths',
# Why: Good example of poor initial scrolling
'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans'
# Why: Social; top Google property; Public profile; infinite scrolls.
'https://plus.google.com/app/basic/110031535020051778989/posts?source=apppromo',
# Why: crbug.com/242544
('http://www.androidpolice.com/2012/10/03/rumor-evidence-mounts-that-an-'
'lg-optimus-g-nexus-is-coming-along-with-a-nexus-phone-certification-'
'program/'),
# Why: crbug.com/149958
'http://gsp.ro',
# Why: Top tech blog
'http://theverge.com',
# Why: Top tech site
'http://digg.com',
# Why: Top Google property; a Google tab is often open
'https://www.google.co.uk/search?hl=en&q=barack+obama&cad=h',
# Why: #1 news worldwide (Alexa global)
'http://news.yahoo.com',
# Why: #2 news worldwide
'http://www.cnn.com',
# Why: #1 commerce website by time spent by users in US
'http://shop.mobileweb.ebay.com/searchresults?kw=viking+helmet',
# Why: #1 Alexa recreation
'http://www.booking.com/searchresults.html?src=searchresults&latitude=65.0500&longitude=25.4667',
# Why: Top tech blog
'http://techcrunch.com',
# Why: #6 Alexa sports
'http://mlb.com/',
# Why: #14 Alexa California
'http://www.sfgate.com/',
# Why: Non-latin character set
'http://worldjournal.com/',
# Why: #15 Alexa news
'http://online.wsj.com/home-page',
# Why: Image-heavy mobile site
'http://www.deviantart.com/',
# Why: Top search engine
('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&'
'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'),
# Why: Top search engine
'http://www.bing.com/search?q=sloths',
# Why: Good example of poor initial scrolling
'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans'
]
for url in urls_list:
......
......@@ -30,14 +30,15 @@ def _CreatePageClassWithSmoothInteractions(page_cls):
class TopSmoothPage(page_module.Page):
def __init__(self, url, page_set, name=''):
def __init__(self, url, page_set, name='', extra_browser_args=None):
if name == '':
name = url
super(TopSmoothPage, self).__init__(
url=url,
page_set=page_set,
name=name,
shared_page_state_class=shared_page_state.SharedDesktopPageState)
shared_page_state_class=shared_page_state.SharedDesktopPageState,
extra_browser_args=extra_browser_args)
def RunPageInteractions(self, action_runner):
action_runner.Wait(1)
......
......@@ -9,14 +9,20 @@ from page_sets.login_helpers import google_login
class TopPages(page_module.Page):
def __init__(self, url, page_set, shared_page_state_class, name=''):
def __init__(self,
url,
page_set,
shared_page_state_class,
name='',
extra_browser_args=None):
if name == '':
name = url
super(TopPages, self).__init__(
url=url,
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name,
shared_page_state_class=shared_page_state_class)
extra_browser_args=extra_browser_args)
class GoogleWebSearchPage(TopPages):
......@@ -25,12 +31,14 @@ class GoogleWebSearchPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name=''):
name='',
extra_browser_args=None):
super(GoogleWebSearchPage, self).__init__(
url='https://www.google.com/#hl=en&q=barack+obama',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(GoogleWebSearchPage, self).RunNavigateSteps(action_runner)
......@@ -43,12 +51,14 @@ class GoogleImageSearchPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name=''):
name='',
extra_browser_args=None):
super(GoogleImageSearchPage, self).__init__(
'https://www.google.com/search?q=cats&tbm=isch',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'googletest')
......@@ -61,12 +71,14 @@ class GmailPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name=''):
name='',
extra_browser_args=None):
super(GmailPage, self).__init__(
url='https://mail.google.com/mail/',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'googletest')
......@@ -82,12 +94,14 @@ class GoogleCalendarPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name=''):
name='',
extra_browser_args=None):
super(GoogleCalendarPage, self).__init__(
url='https://www.google.com/calendar/',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'googletest')
......@@ -110,14 +124,16 @@ class GoogleDocPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Docs_(1_open_document_tab)'):
name='Docs_(1_open_document_tab)',
extra_browser_args=None):
super(GoogleDocPage, self).__init__(
# pylint: disable=line-too-long
url=
'https://docs.google.com/document/d/1X-IKNjtEnx-WW5JIKRLsyhz5sbsat3mfTpAPUSX3_s4/view',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'googletest')
......@@ -133,12 +149,14 @@ class GooglePlusPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name=''):
name='',
extra_browser_args=None):
super(GooglePlusPage, self).__init__(
url='https://plus.google.com/110031535020051778989/posts',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'googletest')
......@@ -152,12 +170,14 @@ class YoutubePage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name=''):
name='',
extra_browser_args=None):
super(YoutubePage, self).__init__(
url='http://www.youtube.com',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'googletest')
......@@ -172,12 +192,14 @@ class BlogspotPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Blogger'):
name='Blogger',
extra_browser_args=None):
super(BlogspotPage, self).__init__(
url='http://googlewebmastercentral.blogspot.com/',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(BlogspotPage, self).RunNavigateSteps(action_runner)
......@@ -190,14 +212,16 @@ class WordpressPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Wordpress'):
name='Wordpress',
extra_browser_args=None):
super(WordpressPage, self).__init__(
# pylint: disable=line-too-long
url=
'http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(WordpressPage, self).RunNavigateSteps(action_runner)
......@@ -213,12 +237,14 @@ class FacebookPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Facebook'):
name='Facebook',
extra_browser_args=None):
super(FacebookPage, self).__init__(
url='https://www.facebook.com/barackobama',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(FacebookPage, self).RunNavigateSteps(action_runner)
......@@ -231,12 +257,14 @@ class LinkedinPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='LinkedIn'):
name='LinkedIn',
extra_browser_args=None):
super(LinkedinPage, self).__init__(
url='http://www.linkedin.com/in/linustorvalds',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
class WikipediaPage(TopPages):
......@@ -245,12 +273,14 @@ class WikipediaPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Wikipedia_(1_tab)'):
name='Wikipedia_(1_tab)',
extra_browser_args=None):
super(WikipediaPage, self).__init__(
url='http://en.wikipedia.org/wiki/Wikipedia',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
class TwitterPage(TopPages):
......@@ -259,12 +289,14 @@ class TwitterPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Twitter'):
name='Twitter',
extra_browser_args=None):
super(TwitterPage, self).__init__(
url='https://twitter.com/katyperry',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(TwitterPage, self).RunNavigateSteps(action_runner)
......@@ -277,12 +309,14 @@ class PinterestPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Pinterest'):
name='Pinterest',
extra_browser_args=None):
super(PinterestPage, self).__init__(
url='http://pinterest.com',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
class ESPNPage(TopPages):
......@@ -291,12 +325,14 @@ class ESPNPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='ESPN'):
name='ESPN',
extra_browser_args=None):
super(ESPNPage, self).__init__(
url='http://espn.go.com',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
class WeatherPage(TopPages):
......@@ -305,12 +341,14 @@ class WeatherPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name='Weather.com'):
name='Weather.com',
extra_browser_args=None):
super(WeatherPage, self).__init__(
url='http://www.weather.com/weather/right-now/Mountain+View+CA+94043',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
class YahooGamesPage(TopPages):
......@@ -319,12 +357,14 @@ class YahooGamesPage(TopPages):
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedPageState,
name=''):
name='',
extra_browser_args=None):
super(YahooGamesPage, self).__init__(
url='http://games.yahoo.com',
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name=name)
name=name,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(YahooGamesPage, self).RunNavigateSteps(action_runner)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment