Chromium Code Reviews| 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. |
| ############################################################################## |