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

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

Issue 2552303002: [tools/perf] Add google search browsing story (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 62b843dae098dcbe2ab03b87557f3831ccf2196a..af58d9c963927f7796d81e33e0cf09b5366e6134 100644
--- a/tools/perf/page_sets/system_health/browsing_stories.py
+++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -233,6 +233,63 @@ class WashingtonPostMobileStory(_NewsBrowsingStory):
##############################################################################
+# Search browsing stories.
+##############################################################################
+
+
+class GoogleDesktopStory(_NewsBrowsingStory):
+ """
+ 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.
+
+ """
+ NAME = 'browse:search:google'
+ URL = 'https://www.google.com/search?q=flower'
+ _SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]'
+ SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
+
+ def _DidLoadDocument(self, action_runner):
+ # Click on flower Wikipedia link.
+ action_runner.Wait(2)
+ action_runner.ClickElement(
+ text='Flower - Wikipedia')
perezju 2016/12/07 11:12:06 nit: should fit in one line?
nednguyen 2016/12/07 17:42:21 Done.
+ 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.WaitForElement(selector=self._SEARCH_BOX_SELECTOR)
+ action_runner.ClickElement(selector=self._SEARCH_BOX_SELECTOR)
+ action_runner.Wait(1)
+
+ # Submit search query.
+ action_runner.Wait(1)
perezju 2016/12/07 11:12:06 remove this and make the previous a Wait(2) ?
nednguyen 2016/12/07 17:42:21 Done.
+ action_runner.EnterText(' delivery')
+ action_runner.Wait(0.5)
+ action_runner.PressKey('Return')
+
+ # Scroll down & click next search result page.
+ action_runner.Wait(2)
+ action_runner.ScrollPageToElement(selector='a[aria-label=\'Page 2\']')
perezju 2016/12/07 11:12:06 1) I think you should be able to write this as sel
+ action_runner.Wait(2)
+ action_runner.ClickElement(selector='a[aria-label=\'Page 2\']')
+ action_runner.Wait(2)
+ action_runner.ScrollPage()
+
+
+##############################################################################
# Media browsing stories.
##############################################################################
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698