Commit 318d2b7e authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Reland^2 "[perf] Add browse:media:tumblr:2018 system health story"

Original change's description:
> [perf] Add browse:media:tumblr:2018 system health story
>
> This also add a login helper for tumblr and updates credentials.json
>
> Bug: 878390
> Change-Id: Iba56faf550cb638692899326b217347e04be9932
> Reviewed-on: https://chromium-review.googlesource.com/c/1256883
> Reviewed-by: Juan Antonio Navarro Pérez <perezju@chromium.org>
> Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#596763}

Change-Id: I45d738bf10b7fcc72a1d032785d4eba2727b5363
Reviewed-on: https://chromium-review.googlesource.com/c/1277789Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599252}
parent ab4edf57
62bb07f739452c44b3618b9b3f3de6251bf73322 6840cad1ab0a693cc418aadd60718c195eb48445
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
"browse:media:tumblr": { "browse:media:tumblr": {
"DEFAULT": "system_health_desktop_036.wprgo" "DEFAULT": "system_health_desktop_036.wprgo"
}, },
"browse:media:tumblr:2018": {
"DEFAULT": "system_health_desktop_55cb9dd713.wprgo"
},
"browse:media:youtube": { "browse:media:youtube": {
"DEFAULT": "system_health_desktop_026.wprgo", "DEFAULT": "system_health_desktop_026.wprgo",
"linux": "system_health_desktop_026.wprgo", "linux": "system_health_desktop_026.wprgo",
......
55cb9dd71364f014e51f4ed50207ac91820a555d
\ No newline at end of file
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from page_sets.login_helpers import login_utils
def LoginDesktopAccount(action_runner, credential,
credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
"""Logs in into a Tumblr account."""
account_name, password = login_utils.GetAccountNameAndPassword(
credential, credentials_path=credentials_path)
action_runner.Navigate('https://www.tumblr.com/login')
login_utils.InputWithSelector(
action_runner, account_name, 'input[type=email]')
next_button = '.signup_determine_btn'
enter_password_button = '.forgot_password_link'
action_runner.WaitForElement(selector=next_button)
action_runner.ClickElement(selector=next_button)
action_runner.Wait(1)
action_runner.WaitForElement(selector=enter_password_button)
action_runner.ClickElement(selector=enter_password_button)
action_runner.Wait(1)
login_utils.InputWithSelector(
action_runner, password, 'input[type=password]')
action_runner.Wait(1)
action_runner.WaitForElement(selector=next_button)
action_runner.ClickElement(selector=next_button)
...@@ -15,6 +15,7 @@ from page_sets.system_health import system_health_story ...@@ -15,6 +15,7 @@ from page_sets.system_health import system_health_story
from page_sets.login_helpers import facebook_login from page_sets.login_helpers import facebook_login
from page_sets.login_helpers import pinterest_login from page_sets.login_helpers import pinterest_login
from page_sets.login_helpers import tumblr_login
from telemetry.util import js_template from telemetry.util import js_template
...@@ -592,6 +593,28 @@ class TumblrDesktopStory(_MediaBrowsingStory): ...@@ -592,6 +593,28 @@ class TumblrDesktopStory(_MediaBrowsingStory):
action_runner.MouseClick(selector='#tumblr_lightbox_center_image') action_runner.MouseClick(selector='#tumblr_lightbox_center_image')
action_runner.Wait(1) # To make browsing more realistic. action_runner.Wait(1) # To make browsing more realistic.
class TumblrDesktopStory2018(_MediaBrowsingStory):
NAME = 'browse:media:tumblr:2018'
URL = 'https://tumblr.com/search/gifs'
ITEM_SELECTOR = '.post_media'
IS_SINGLE_PAGE_APP = True
ITEMS_TO_VISIT = 8
INCREMENT_INDEX_AFTER_EACH_ITEM = True
SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
TAGS = [story_tags.YEAR_2018]
def _Login(self, action_runner):
tumblr_login.LoginDesktopAccount(action_runner, 'tumblr')
action_runner.Wait(3)
def _ViewMediaItem(self, action_runner, index):
super(TumblrDesktopStory2018, self)._ViewMediaItem(action_runner, index)
action_runner.WaitForElement(selector='#tumblr_lightbox')
action_runner.MouseClick(selector='#tumblr_lightbox')
action_runner.Wait(1) # To make browsing more realistic.
class PinterestDesktopStory(_MediaBrowsingStory): class PinterestDesktopStory(_MediaBrowsingStory):
NAME = 'browse:media:pinterest' NAME = 'browse:media:pinterest'
URL = 'https://pinterest.com' URL = 'https://pinterest.com'
......
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