Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: tools/perf/page_sets/system_health/browsing_stories.py

Issue 2902513002: [System Health] Tidy up stories for Chrome's special pages (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/perf/page_sets/system_health/browsing_stories.py
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py
index 2a5639d3296557181b0b7c9c23d443426cda59e0..9c458374bd1dd4389714fca2765ac529492f230a 100644
--- a/tools/perf/page_sets/system_health/browsing_stories.py
+++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -247,56 +247,44 @@ class WashingtonPostMobileStory(_ArticleBrowsingStory):
##############################################################################
-@decorators.Disabled('win') # crbug.com/673775
-class GoogleDesktopStory(_ArticleBrowsingStory):
perezju 2017/05/22 15:50:25 This story now removed. Replaced with the old "sea
nednguyen 2017/05/22 19:52:40 Why removing this instead of removing the old "sea
- """
- A typical google search story:
- _ Start at https://www.google.com/search?q=flower
- _ Click on the wikipedia link & navigate to
- https://en.wikipedia.org/wiki/Flower
- _ Scroll down the wikipedia page about flower.
- _ Back to the search main page.
- _ Refine the search query to 'flower delivery'.
- _ Scroll down the page.
- _ Click the next page result of 'flower delivery'.
- _ Scroll the search page.
+class SearchGoogleStory(system_health_story.SystemHealthStory):
+ """ A typical Google search user story.
+
+ Issue the search query "what is science" in the search box and press Enter.
+ Wait for the search result page to be loaded, then scroll to the Wikipedia
+ result.
+ Navigate to wikipedia page by clicking on the result and wait for it to be
+ fully loaded.
"""
NAME = 'browse:search:google'
- URL = 'https://www.google.com/search?q=flower'
+ URL = 'https://www.google.co.uk/'
+ TAGS = [story_tags.EMERGING_MARKET]
+
_SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]'
- _SEARCH_PAGE_2_SELECTOR = 'a[aria-label=\'Page 2\']'
- SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
+ _RESULT_SELECTOR = '.r > a[href*="wikipedia"]'
def _DidLoadDocument(self, action_runner):
- # Click on flower Wikipedia link.
- action_runner.Wait(2)
- action_runner.ClickElement(text='Flower - Wikipedia')
- action_runner.WaitForNavigate()
-
- # Scroll the flower Wikipedia page, then navigate back.
- action_runner.Wait(2)
- action_runner.ScrollPage()
- action_runner.Wait(2)
- action_runner.NavigateBack()
-
# Click on the search box.
+ action_runner.Wait(1)
action_runner.WaitForElement(selector=self._SEARCH_BOX_SELECTOR)
- action_runner.ClickElement(selector=self._SEARCH_BOX_SELECTOR)
- action_runner.Wait(2)
+ action_runner.TapElement(selector=self._SEARCH_BOX_SELECTOR)
# Submit search query.
- action_runner.EnterText(' delivery')
+ action_runner.Wait(1)
+ action_runner.EnterText('what is science')
action_runner.Wait(0.5)
action_runner.PressKey('Return')
- # Scroll down & click next search result page.
- action_runner.Wait(2)
- action_runner.ScrollPageToElement(selector=self._SEARCH_PAGE_2_SELECTOR)
- action_runner.Wait(2)
- action_runner.ClickElement(selector=self._SEARCH_PAGE_2_SELECTOR)
- action_runner.Wait(2)
- action_runner.ScrollPage()
+ # Scroll to the Wikipedia result.
+ action_runner.WaitForElement(selector=self._RESULT_SELECTOR)
+ action_runner.Wait(1)
+ action_runner.ScrollPageToElement(selector=self._RESULT_SELECTOR)
+
+ # Click on the Wikipedia result.
+ action_runner.Wait(1)
+ action_runner.TapElement(selector=self._RESULT_SELECTOR)
+ action_runner.tab.WaitForDocumentReadyStateToBeComplete()
class GoogleIndiaDesktopStory(_ArticleBrowsingStory):

Powered by Google App Engine
This is Rietveld 408576698