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

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

Issue 2612053002: Stop browse:social:twitter scrolling wrong element (Closed)
Patch Set: Remove random other commit. Created 3 years, 11 months 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 2f4efe8734cb4a31414f11f48d9141ed60a2239c..0f3976b6deb1066bcfc1d9528d32f8601536409e 100644
--- a/tools/perf/page_sets/system_health/browsing_stories.py
+++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -20,6 +20,8 @@ class _BrowsingStory(system_health_story.SystemHealthStory):
IS_SINGLE_PAGE_APP = False
ITEM_SELECTOR = NotImplemented
+ # Defaults to using the body element if not set.
+ CONTAINER_SELECTOR = None
ABSTRACT_STORY = True
def _WaitForNavigation(self, action_runner):
@@ -31,7 +33,9 @@ class _BrowsingStory(system_health_story.SystemHealthStory):
self.ITEM_SELECTOR, index)
# Only scrolls if element is not currently in viewport.
action_runner.WaitForElement(element_function=item_selector)
- action_runner.ScrollPageToElement(element_function=item_selector)
+ action_runner.ScrollPageToElement(
+ element_function=item_selector,
+ container_selector=self.CONTAINER_SELECTOR)
self._ClickLink(action_runner, item_selector)
def _ClickLink(self, action_runner, element_function):
@@ -194,6 +198,7 @@ class TwitterMobileStory(_NewsBrowsingStory):
NAME = 'browse:social:twitter'
URL = 'https://www.twitter.com/nasa'
ITEM_SELECTOR = '.Tweet-text'
+ CONTAINER_SELECTOR = '.NavigationSheet'
SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
« 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