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

Side by Side Diff: tools/perf/page_sets/system_health/browsing_stories.py

Issue 2497023002: [SystemHealth] Wait for element to exist before trying to scroll to it in browsing stories. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from page_sets.system_health import platforms 5 from page_sets.system_health import platforms
6 from page_sets.system_health import system_health_story 6 from page_sets.system_health import system_health_story
7 7
8 from page_sets.login_helpers import pinterest_login 8 from page_sets.login_helpers import pinterest_login
9 9
10 from telemetry import decorators 10 from telemetry import decorators
(...skipping 12 matching lines...) Expand all
23 ABSTRACT_STORY = True 23 ABSTRACT_STORY = True
24 24
25 def _WaitForNavigation(self, action_runner): 25 def _WaitForNavigation(self, action_runner):
26 if not self.IS_SINGLE_PAGE_APP: 26 if not self.IS_SINGLE_PAGE_APP:
27 action_runner.WaitForNavigate() 27 action_runner.WaitForNavigate()
28 28
29 def _NavigateToItem(self, action_runner, index): 29 def _NavigateToItem(self, action_runner, index):
30 item_selector = 'document.querySelectorAll("%s")[%d]' % ( 30 item_selector = 'document.querySelectorAll("%s")[%d]' % (
31 self.ITEM_SELECTOR, index) 31 self.ITEM_SELECTOR, index)
32 # Only scrolls if element is not currently in viewport. 32 # Only scrolls if element is not currently in viewport.
33 action_runner.WaitForElement(element_function=item_selector)
33 action_runner.ScrollPageToElement(element_function=item_selector) 34 action_runner.ScrollPageToElement(element_function=item_selector)
34 self._ClickLink(action_runner, item_selector) 35 self._ClickLink(action_runner, item_selector)
35 36
36 def _ClickLink(self, action_runner, element_function): 37 def _ClickLink(self, action_runner, element_function):
37 action_runner.WaitForElement(element_function=element_function) 38 action_runner.WaitForElement(element_function=element_function)
38 action_runner.ClickElement(element_function=element_function) 39 action_runner.ClickElement(element_function=element_function)
39 self._WaitForNavigation(action_runner) 40 self._WaitForNavigation(action_runner)
40 41
41 def _NavigateBack(self, action_runner): 42 def _NavigateBack(self, action_runner):
42 action_runner.ExecuteJavaScript('window.history.back()') 43 action_runner.ExecuteJavaScript('window.history.back()')
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 inner_save_function = 'document.querySelector(".nameAndIcons")' 360 inner_save_function = 'document.querySelector(".nameAndIcons")'
360 action_runner.WaitForElement(element_function=inner_save_function) 361 action_runner.WaitForElement(element_function=inner_save_function)
361 action_runner.ClickElement(element_function=inner_save_function) 362 action_runner.ClickElement(element_function=inner_save_function)
362 action_runner.Wait(1) # Wait to make navigation realistic. 363 action_runner.Wait(1) # Wait to make navigation realistic.
363 364
364 # Close selection. 365 # Close selection.
365 x_element_function = ('document.querySelector(' 366 x_element_function = ('document.querySelector('
366 '".Button.borderless.close.visible")') 367 '".Button.borderless.close.visible")')
367 action_runner.ClickElement(element_function=x_element_function) 368 action_runner.ClickElement(element_function=x_element_function)
368 action_runner.Wait(1) # Wait to make navigation realistic. 369 action_runner.Wait(1) # Wait to make navigation realistic.
OLDNEW
« 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