OLD | NEW |
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 story_tags | 6 from page_sets.system_health import story_tags |
7 from page_sets.system_health import system_health_story | 7 from page_sets.system_health import system_health_story |
8 | 8 |
| 9 from telemetry import decorators |
| 10 |
9 from devil.android.sdk import keyevent # pylint: disable=import-error | 11 from devil.android.sdk import keyevent # pylint: disable=import-error |
10 | 12 |
11 | 13 |
12 # TODO(ssid): Rename the search stories to browse stories crbug.com/708300. | 14 # TODO(ssid): Rename the search stories to browse stories crbug.com/708300. |
13 class SearchGoogleStory(system_health_story.SystemHealthStory): | 15 class SearchGoogleStory(system_health_story.SystemHealthStory): |
14 NAME = 'search:portal:google' | 16 NAME = 'search:portal:google' |
15 URL = 'https://www.google.co.uk/' | 17 URL = 'https://www.google.co.uk/' |
16 TAGS = [story_tags.EMERGING_MARKET] | 18 TAGS = [story_tags.EMERGING_MARKET] |
17 | 19 |
18 _SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]' | 20 _SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]' |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 url_bar.Tap() | 62 url_bar.Tap() |
61 action_runner.Wait(1) # user wait before typing | 63 action_runner.Wait(1) # user wait before typing |
62 platform.android_action_runner.InputText('drake') | 64 platform.android_action_runner.InputText('drake') |
63 action_runner.Wait(0.5) # user wait after typing | 65 action_runner.Wait(0.5) # user wait after typing |
64 platform.android_action_runner.InputKeyEvent(keyevent.KEYCODE_ENTER) | 66 platform.android_action_runner.InputKeyEvent(keyevent.KEYCODE_ENTER) |
65 | 67 |
66 action_runner.WaitForNavigate() | 68 action_runner.WaitForNavigate() |
67 action_runner.ScrollPage(use_touch=True, distance=500) | 69 action_runner.ScrollPage(use_touch=True, distance=500) |
68 | 70 |
69 | 71 |
| 72 @decorators.Disabled('android') # crbug.com/712590 |
70 class MobileNewTabPageStory(system_health_story.SystemHealthStory): | 73 class MobileNewTabPageStory(system_health_story.SystemHealthStory): |
71 """Story that loads new tab page and performs searches. | 74 """Story that loads new tab page and performs searches. |
72 | 75 |
73 For each of the search queries in |_SEARCH_TEXTS| below, this story does: | 76 For each of the search queries in |_SEARCH_TEXTS| below, this story does: |
74 - enter the search query on the new tab page search box | 77 - enter the search query on the new tab page search box |
75 - read results | 78 - read results |
76 - navigates back to new tab page | 79 - navigates back to new tab page |
77 """ | 80 """ |
78 | 81 |
79 NAME = 'browse:chrome:newtab' | 82 NAME = 'browse:chrome:newtab' |
(...skipping 15 matching lines...) Expand all Loading... |
95 platform.android_action_runner.InputText(keyword) | 98 platform.android_action_runner.InputText(keyword) |
96 platform.android_action_runner.InputKeyEvent(keyevent.KEYCODE_ENTER) | 99 platform.android_action_runner.InputKeyEvent(keyevent.KEYCODE_ENTER) |
97 action_runner.WaitForNavigate() | 100 action_runner.WaitForNavigate() |
98 action_runner.Wait(1.5) # Read results | 101 action_runner.Wait(1.5) # Read results |
99 action_runner.ScrollPage(use_touch=True) | 102 action_runner.ScrollPage(use_touch=True) |
100 action_runner.NavigateBack() | 103 action_runner.NavigateBack() |
101 action_runner.WaitForNavigate() | 104 action_runner.WaitForNavigate() |
102 | 105 |
103 app_ui.WaitForUiNode(resource_id='menu_button').Tap() | 106 app_ui.WaitForUiNode(resource_id='menu_button').Tap() |
104 app_ui.WaitForUiNode(resource_id='menu_item_text') | 107 app_ui.WaitForUiNode(resource_id='menu_item_text') |
OLD | NEW |