Commit 290c7cdd authored by Mythri A's avatar Mythri A Committed by Commit Bot

Add load:news:washingtonpost:2019 system health story

This CL was created automatically with tools/perf/update_wpr script

R=perezju@chromium.org

Bug: 878390
Change-Id: If2bc253e04cbba91c3b6221de14d28316d368e6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816570
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699336}
parent d56dafe0
......@@ -48,6 +48,7 @@ _DISABLED_TESTS = frozenset({
'system_health.memory_mobile/browse:news:cnn',
'system_health.memory_mobile/load:media:facebook_photos',
'system_health.memory_mobile/load:news:cnn',
'system_health.memory_mobile/load:news:washingtonpost',
'system_health.memory_mobile/load:tools:stackoverflow',
'system_health.memory_desktop/load_accessibility:shopping:amazon',
'system_health.memory_desktop/browse_accessibility:tech:codesearch',
......
......@@ -216,6 +216,9 @@
"load:news:washingtonpost": {
"DEFAULT": "system_health_mobile_013.wprgo"
},
"load:news:washingtonpost:2019": {
"DEFAULT": "system_health_mobile_f2584469fe.wprgo"
},
"load:news:wikipedia": {
"DEFAULT": "system_health_mobile_002.wprgo"
},
......
f2584469fe9e114e903bfe67317920fe692a204a
\ No newline at end of file
......@@ -9,6 +9,8 @@ from page_sets.system_health import system_health_story
from page_sets.login_helpers import dropbox_login
from page_sets.login_helpers import google_login
from telemetry.util import js_template
class _LoadingStory(system_health_story.SystemHealthStory):
"""Abstract base class for single-page System Health user stories."""
......@@ -241,6 +243,33 @@ class LoadWashingtonPostMobileStory(_LoadingStory):
if has_button:
action_runner.ClickElement(selector=self._CLOSE_BUTTON_SELECTOR)
class LoadWashingtonPostMobileStory2019(_LoadingStory):
NAME = 'load:news:washingtonpost:2019'
URL = 'https://www.washingtonpost.com/pwa'
SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
TAGS = [story_tags.HEALTH_CHECK, story_tags.YEAR_2019]
_CONTINUE_FREE_BUTTON_SELECTOR = '.continue-btn.button.free'
_ACCEPT_GDPR_SELECTOR = '.agree-ckb'
_CONTINUE_TO_SITE_SELECTOR = '.continue-btn.button.accept-consent'
def _DidLoadDocument(self, action_runner):
# Close the popup window. On Nexus 9 (and probably other tables) the popup
# window does not have a "Close" button, instead it has only a "Send link
# to phone" button. So on tablets we run with the popup window open. The
# popup is transparent, so this is mostly an aesthetical issue.
has_button = action_runner.EvaluateJavaScript(
'!!document.querySelector({{ selector }})',
selector=self._CONTINUE_FREE_BUTTON_SELECTOR)
if has_button:
action_runner.ClickElement(selector=self._CONTINUE_FREE_BUTTON_SELECTOR)
action_runner.ScrollPageToElement(selector=self._ACCEPT_GDPR_SELECTOR)
action_runner.ClickElement(selector=self._ACCEPT_GDPR_SELECTOR)
element_function = js_template.Render(
'document.querySelectorAll({{ selector }})[{{ index }}]',
selector=self._CONTINUE_TO_SITE_SELECTOR, index=0)
action_runner.ClickElement(element_function=element_function)
class LoadWikipediaStory2018(_LoadingStory):
NAME = 'load:news:wikipedia:2018'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment