Commit 7af2637c authored by Amy Qiu's avatar Amy Qiu Committed by Commit Bot

Refresh pages for key_desktop_move_cases

Create new recordings for pages in key_desktop_move_cases to ensure
current websites are used.

Bug: 852530
Change-Id: Ia216e388edf269a0462f014f90bbe22be0a68916
Reviewed-on: https://chromium-review.googlesource.com/1150691Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#578497}
parent 3b13d6d9
177923146e4280ca98b6a3f852dcdfbfd9dfabc0
\ No newline at end of file
...@@ -75,13 +75,19 @@ ...@@ -75,13 +75,19 @@
"youtube_2018": { "youtube_2018": {
"DEFAULT": "top_25_012.wprgo" "DEFAULT": "top_25_012.wprgo"
}, },
"maps_move": {
"DEFAULT": "key_desktop_move_cases_000.wprgo"
},
"gmail_move": { "gmail_move": {
"DEFAULT": "key_desktop_move_cases_002.wprgo" "DEFAULT": "key_desktop_move_cases_002.wprgo"
}, },
"filter_terrain_svg": { "gmail_move_2018": {
"DEFAULT": "key_desktop_move_cases_003.wprgo"
},
"maps_move": {
"DEFAULT": "key_desktop_move_cases_000.wprgo"
},
"maps_move_2018": {
"DEFAULT": "key_desktop_move_cases_003.wprgo"
},
"filter_terrain_svg": {
"DEFAULT": "tough_filters_cases_002.wprgo" "DEFAULT": "tough_filters_cases_002.wprgo"
}, },
"motion_mark_focus": { "motion_mark_focus": {
...@@ -92,7 +98,7 @@ ...@@ -92,7 +98,7 @@
}, },
"ie_pirate_mark": { "ie_pirate_mark": {
"DEFAULT": "tough_filters_cases_002.wprgo" "DEFAULT": "tough_filters_cases_002.wprgo"
}, },
"guimark_vector_chart": { "guimark_vector_chart": {
"DEFAULT": "tough_path_rendering_cases_002.wprgo" "DEFAULT": "tough_path_rendering_cases_002.wprgo"
}, },
......
...@@ -101,6 +101,81 @@ class GmailMouseScrollPage(KeyDesktopMoveCasesPage): ...@@ -101,6 +101,81 @@ class GmailMouseScrollPage(KeyDesktopMoveCasesPage):
return scrollbar_mid_x, scrollbar_start_mid_y, scrollbar_end_mid_y return scrollbar_mid_x, scrollbar_start_mid_y, scrollbar_end_mid_y
class GmailMouseScroll2018Page(KeyDesktopMoveCasesPage):
""" Why: productivity, top google properties """
BASE_NAME = 'gmail_move'
YEAR = '2018'
URL = 'https://mail.google.com/mail/'
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedDesktopPageState,
name_suffix='',
extra_browser_args=None):
super(GmailMouseScroll2018Page, self).__init__(
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args
)
self.scrollable_element_function = '''
function(callback) {
gmonkey.load('2.0', function(api) {
callback(api.getScrollableElement());
});
}'''
def RunNavigateSteps(self, action_runner):
google_login.NewLoginGoogleAccount(action_runner, 'googletest')
super(GmailMouseScroll2018Page, self).RunNavigateSteps(action_runner)
action_runner.WaitForJavaScriptCondition(
'window.gmonkey !== undefined &&'
'document.getElementById("gb") !== null')
# This check is needed for gmonkey to load completely.
action_runner.WaitForJavaScriptCondition(
'document.readyState == "complete"')
def RunPageInteractions(self, action_runner):
action_runner.ExecuteJavaScript('''
gmonkey.load('2.0', function(api) {
window.__scrollableElementForTelemetry = api.getScrollableElement();
});''')
action_runner.WaitForJavaScriptCondition(
'window.__scrollableElementForTelemetry != null')
scrollbar_x, start_y, end_y = self._CalculateScrollBarRatios(action_runner)
with action_runner.CreateGestureInteraction('DragAction'):
action_runner.DragPage(left_start_ratio=scrollbar_x,
top_start_ratio=start_y, left_end_ratio=scrollbar_x,
top_end_ratio=end_y, speed_in_pixels_per_second=100,
element_function='window.__scrollableElementForTelemetry')
def _CalculateScrollBarRatios(self, action_runner):
viewport_height = float(action_runner.EvaluateJavaScript(
'window.__scrollableElementForTelemetry.clientHeight'))
content_height = float(action_runner.EvaluateJavaScript(
'window.__scrollableElementForTelemetry.scrollHeight'))
viewport_width = float(action_runner.EvaluateJavaScript(
'window.__scrollableElementForTelemetry.offsetWidth'))
scrollbar_width = float(action_runner.EvaluateJavaScript('''
window.__scrollableElementForTelemetry.offsetWidth -
window.__scrollableElementForTelemetry.scrollWidth'''))
# This calculation is correct only when the element doesn't have border or
# padding or scroll buttons (eg: gmail mail element).
# Calculating the mid point of start of scrollbar.
scrollbar_height_ratio = viewport_height / content_height
scrollbar_start_mid_y = scrollbar_height_ratio / 2
scrollbar_width_ratio = scrollbar_width / viewport_width
scrollbar_mid_x_right_offset = scrollbar_width_ratio / 2
scrollbar_mid_x = 1 - scrollbar_mid_x_right_offset
# The End point of scrollbar (x remains same).
scrollbar_end_mid_y = 1 - scrollbar_start_mid_y
return scrollbar_mid_x, scrollbar_start_mid_y, scrollbar_end_mid_y
class GoogleMapsPage(KeyDesktopMoveCasesPage): class GoogleMapsPage(KeyDesktopMoveCasesPage):
""" Why: productivity, top google properties; Supports drag gestures """ """ Why: productivity, top google properties; Supports drag gestures """
BASE_NAME = 'maps_move' BASE_NAME = 'maps_move'
...@@ -131,3 +206,36 @@ class GoogleMapsPage(KeyDesktopMoveCasesPage): ...@@ -131,3 +206,36 @@ class GoogleMapsPage(KeyDesktopMoveCasesPage):
action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75, action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75,
left_end_ratio=0.75, top_end_ratio=0.5) left_end_ratio=0.75, top_end_ratio=0.5)
# TODO(ssid): Add zoom gestures after fixing bug crbug.com/462214. # TODO(ssid): Add zoom gestures after fixing bug crbug.com/462214.
class GoogleMaps2018Page(KeyDesktopMoveCasesPage):
""" Why: productivity, top google properties; Supports drag gestures """
BASE_NAME = 'maps_move'
YEAR = '2018'
URL = 'https://www.google.co.uk/maps/@51.5043968,-0.1526806'
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedDesktopPageState,
name_suffix='',
extra_browser_args=None):
super(GoogleMaps2018Page, self).__init__(
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(GoogleMaps2018Page, self).RunNavigateSteps(action_runner)
action_runner.WaitForElement(selector='.widget-scene-canvas')
action_runner.WaitForElement(selector='.widget-zoom-in')
action_runner.WaitForElement(selector='.widget-zoom-out')
def RunPageInteractions(self, action_runner):
for _ in range(3):
action_runner.Wait(2)
with action_runner.CreateGestureInteraction(
'DragAction', repeatable=True):
action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75,
left_end_ratio=0.75, top_end_ratio=0.5)
# TODO(ssid): Add zoom gestures after fixing bug crbug.com/462214.
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