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..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. |
| ############################################################################## |