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

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

Issue 2552303002: [tools/perf] Add google search browsing story (Closed)
Patch Set: Address Juan's comment & add WPR recording 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 | « tools/perf/page_sets/data/system_health_desktop_037.wpr.sha1 ('k') | 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..d6257e7bfd4533d20d19ff684023682221adf95a 100644
--- a/tools/perf/page_sets/system_health/browsing_stories.py
+++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -233,6 +233,62 @@ 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"]'
+ _SEARCH_PAGE_2_SELECTOR = 'a[aria-label=\'Page 2\']'
perezju 2016/12/08 10:01:28 nit: for consistency, can this be 'a[aria-label="P
nednguyen 2016/12/08 12:09:37 No, the escaping is not right. If I use '"', it th
+ 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')
+ 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(2)
+
+ # Submit search query.
+ 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=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()
+
+
+##############################################################################
# Media browsing stories.
##############################################################################
« no previous file with comments | « tools/perf/page_sets/data/system_health_desktop_037.wpr.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698