| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 170 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 171 | 171 |
| 172 | 172 |
| 173 # Desktop qq.com opens a news item in a separate tab, for which the back button | 173 # Desktop qq.com opens a news item in a separate tab, for which the back button |
| 174 # does not work. | 174 # does not work. |
| 175 class QqMobileStory(_NewsBrowsingStory): | 175 class QqMobileStory(_NewsBrowsingStory): |
| 176 NAME = 'browse:news:qq' | 176 NAME = 'browse:news:qq' |
| 177 URL = 'http://news.qq.com' | 177 URL = 'http://news.qq.com' |
| 178 ITEM_SELECTOR = '.list .full a' | 178 ITEM_SELECTOR = '.list .full a' |
| 179 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY | 179 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY |
| 180 TAGS = [story_tags.INTERNATIONAL] |
| 180 | 181 |
| 181 | 182 |
| 182 class RedditDesktopStory(_NewsBrowsingStory): | 183 class RedditDesktopStory(_NewsBrowsingStory): |
| 183 """The top website in http://www.alexa.com/topsites/category/News""" | 184 """The top website in http://www.alexa.com/topsites/category/News""" |
| 184 NAME = 'browse:news:reddit' | 185 NAME = 'browse:news:reddit' |
| 185 URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' | 186 URL = 'https://www.reddit.com/r/news/top/?sort=top&t=week' |
| 186 ITEM_SELECTOR = '.thing .title > a' | 187 ITEM_SELECTOR = '.thing .title > a' |
| 187 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 188 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 188 | 189 |
| 189 | 190 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 5. Click the next page result | 305 5. Click the next page result |
| 305 6. Scroll the search result page. | 306 6. Scroll the search result page. |
| 306 | 307 |
| 307 """ | 308 """ |
| 308 NAME = 'browse:search:google_india' | 309 NAME = 'browse:search:google_india' |
| 309 URL = 'https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2' | 310 URL = 'https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2' |
| 310 _SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]' | 311 _SEARCH_BOX_SELECTOR = 'input[aria-label="Search"]' |
| 311 _SEARCH_BUTTON_SELECTOR = 'button[aria-label="Google Search"]' | 312 _SEARCH_BUTTON_SELECTOR = 'button[aria-label="Google Search"]' |
| 312 _SEARCH_PAGE_2_SELECTOR = 'a[aria-label=\'Page 2\']' | 313 _SEARCH_PAGE_2_SELECTOR = 'a[aria-label=\'Page 2\']' |
| 313 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY | 314 SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY |
| 315 TAGS = [story_tags.INTERNATIONAL] |
| 314 | 316 |
| 315 def _DidLoadDocument(self, action_runner): | 317 def _DidLoadDocument(self, action_runner): |
| 316 action_runner.Wait(2) | 318 action_runner.Wait(2) |
| 317 action_runner.ScrollPage() | 319 action_runner.ScrollPage() |
| 318 action_runner.Wait(2) | 320 action_runner.Wait(2) |
| 319 | 321 |
| 320 action_runner.ScrollPage(direction='up') | 322 action_runner.ScrollPage(direction='up') |
| 321 | 323 |
| 322 # Refine search query in the search box. | 324 # Refine search query in the search box. |
| 323 # TODO(nednguyen): replace this with input text gesture to make it more | 325 # TODO(nednguyen): replace this with input text gesture to make it more |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 inner_save_function = 'document.querySelector(".nameAndIcons")' | 479 inner_save_function = 'document.querySelector(".nameAndIcons")' |
| 478 action_runner.WaitForElement(element_function=inner_save_function) | 480 action_runner.WaitForElement(element_function=inner_save_function) |
| 479 action_runner.ClickElement(element_function=inner_save_function) | 481 action_runner.ClickElement(element_function=inner_save_function) |
| 480 action_runner.Wait(1) # Wait to make navigation realistic. | 482 action_runner.Wait(1) # Wait to make navigation realistic. |
| 481 | 483 |
| 482 # Close selection. | 484 # Close selection. |
| 483 x_element_function = ('document.querySelector(' | 485 x_element_function = ('document.querySelector(' |
| 484 '".Button.borderless.close.visible")') | 486 '".Button.borderless.close.visible")') |
| 485 action_runner.ClickElement(element_function=x_element_function) | 487 action_runner.ClickElement(element_function=x_element_function) |
| 486 action_runner.Wait(1) # Wait to make navigation realistic. | 488 action_runner.Wait(1) # Wait to make navigation realistic. |
| OLD | NEW |