| OLD | NEW |
| 1 # encoding: utf-8 | 1 # encoding: utf-8 |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 from page_sets.system_health import platforms | 6 from page_sets.system_health import platforms |
| 7 from page_sets.system_health import story_tags | 7 from page_sets.system_health import story_tags |
| 8 from page_sets.system_health import system_health_story | 8 from page_sets.system_health import system_health_story |
| 9 | 9 |
| 10 from page_sets.login_helpers import pinterest_login | 10 from page_sets.login_helpers import pinterest_login |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 inner_save_function = 'document.querySelector(".nameAndIcons")' | 480 inner_save_function = 'document.querySelector(".nameAndIcons")' |
| 481 action_runner.WaitForElement(element_function=inner_save_function) | 481 action_runner.WaitForElement(element_function=inner_save_function) |
| 482 action_runner.ClickElement(element_function=inner_save_function) | 482 action_runner.ClickElement(element_function=inner_save_function) |
| 483 action_runner.Wait(1) # Wait to make navigation realistic. | 483 action_runner.Wait(1) # Wait to make navigation realistic. |
| 484 | 484 |
| 485 # Close selection. | 485 # Close selection. |
| 486 x_element_function = ('document.querySelector(' | 486 x_element_function = ('document.querySelector(' |
| 487 '".Button.borderless.close.visible")') | 487 '".Button.borderless.close.visible")') |
| 488 action_runner.ClickElement(element_function=x_element_function) | 488 action_runner.ClickElement(element_function=x_element_function) |
| 489 action_runner.Wait(1) # Wait to make navigation realistic. | 489 action_runner.Wait(1) # Wait to make navigation realistic. |
| 490 |
| 491 |
| 492 class GoogleEarthStory(_NewsBrowsingStory): |
| 493 """ |
| 494 Google Earth story: |
| 495 _ Start at https://www.maps.google.com/maps |
| 496 _ Click on the Earth link |
| 497 _ Click ZoomIn three times, waiting for 3 sec in between. |
| 498 |
| 499 """ |
| 500 NAME = 'browse:tools:earth' |
| 501 URL = 'https://www.google.co.uk/maps/@51.4655936,-0.0985949,3329a,35y,40.58t/d
ata=!3m1!1e3' |
| 502 _EARTH_BUTTON_SELECTOR = '[aria-labelledby="widget-minimap-caption"]' |
| 503 _EARTH_ZOOM_IN_SELECTOR = '[aria-label="Zoom in"]' |
| 504 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 505 TAGS = [story_tags.JAVASCRIPT_HEAVY] |
| 506 |
| 507 def _DidLoadDocument(self, action_runner): |
| 508 # Zommin three times. |
| 509 action_runner.WaitForElement(selector=self._EARTH_ZOOM_IN_SELECTOR) |
| 510 action_runner.ClickElement(selector=self._EARTH_ZOOM_IN_SELECTOR) |
| 511 action_runner.Wait(1) |
| 512 action_runner.ClickElement(selector=self._EARTH_ZOOM_IN_SELECTOR) |
| 513 action_runner.Wait(1) |
| 514 action_runner.ClickElement(selector=self._EARTH_ZOOM_IN_SELECTOR) |
| 515 action_runner.Wait(1) |
| 516 action_runner.ClickElement(selector=self._EARTH_ZOOM_IN_SELECTOR) |
| 517 action_runner.Wait(5) |
| 518 |
| 519 for _ in range(2): |
| 520 with action_runner.CreateGestureInteraction( |
| 521 'DragAction', repeatable=True): |
| 522 action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0, |
| 523 left_end_ratio=0.5, top_end_ratio=0.5) |
| 524 action_runner.Wait(5) |
| 525 |
| 526 for _ in range(2): |
| 527 with action_runner.CreateGestureInteraction( |
| 528 'DragAction', repeatable=True): |
| 529 action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0, |
| 530 left_end_ratio=0, top_end_ratio=0) |
| 531 action_runner.Wait(5) |
| OLD | NEW |