Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: tools/perf/page_sets/login_helpers/google_login.py

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 from page_sets.login_helpers import login_utils 4 from page_sets.login_helpers import login_utils
5 5
6 6
7 # JavaScript conditions which are true when the email and password inputs on 7 # JavaScript conditions which are true when the email and password inputs on
8 # the Google Login page are visible respectively. 8 # the Google Login page are visible respectively.
9 _EMAIL_INPUT_VISIBLE_CONDITION = ( 9 _EMAIL_INPUT_VISIBLE_CONDITION = (
10 'document.querySelector("#Email:not(.hidden)") !== null') 10 'document.querySelector("#Email:not(.hidden)") !== null')
(...skipping 25 matching lines...) Expand all
36 for a detailed list of possible exceptions. 36 for a detailed list of possible exceptions.
37 """ 37 """
38 account_name, password = login_utils.GetAccountNameAndPassword( 38 account_name, password = login_utils.GetAccountNameAndPassword(
39 credential, credentials_path=credentials_path) 39 credential, credentials_path=credentials_path)
40 40
41 action_runner.Navigate( 41 action_runner.Navigate(
42 'https://accounts.google.com/ServiceLogin?continue=' 42 'https://accounts.google.com/ServiceLogin?continue='
43 'https%3A%2F%2Faccounts.google.com%2FManageAccount') 43 'https%3A%2F%2Faccounts.google.com%2FManageAccount')
44 44
45 # Wait until either the email or password input is visible. 45 # Wait until either the email or password input is visible.
46 action_runner.WaitForJavaScriptCondition2('{{ @a }} || {{ @b }}', 46 action_runner.WaitForJavaScriptCondition('{{ @a }} || {{ @b }}',
47 a=_EMAIL_INPUT_VISIBLE_CONDITION, b=_PASSWORD_INPUT_VISIBLE_CONDITION) 47 a=_EMAIL_INPUT_VISIBLE_CONDITION, b=_PASSWORD_INPUT_VISIBLE_CONDITION)
48 48
49 # If the email input is visible, this is the first Google login within the 49 # If the email input is visible, this is the first Google login within the
50 # browser session, so we must enter both email and password. Otherwise, only 50 # browser session, so we must enter both email and password. Otherwise, only
51 # password is required. 51 # password is required.
52 if action_runner.EvaluateJavaScript2(_EMAIL_INPUT_VISIBLE_CONDITION): 52 if action_runner.EvaluateJavaScript(_EMAIL_INPUT_VISIBLE_CONDITION):
53 login_utils.InputForm(action_runner, account_name, input_id='Email', 53 login_utils.InputForm(action_runner, account_name, input_id='Email',
54 form_id='gaia_firstform') 54 form_id='gaia_firstform')
55 action_runner.ClickElement(selector='#gaia_firstform #next') 55 action_runner.ClickElement(selector='#gaia_firstform #next')
56 56
57 login_utils.InputForm(action_runner, password, input_id='Passwd') 57 login_utils.InputForm(action_runner, password, input_id='Passwd')
58 action_runner.ClickElement(selector='#signIn') 58 action_runner.ClickElement(selector='#signIn')
59 action_runner.WaitForElement(text='My Account') 59 action_runner.WaitForElement(text='My Account')
OLDNEW
« no previous file with comments | « tools/perf/page_sets/login_helpers/dropbox_login.py ('k') | tools/perf/page_sets/login_helpers/login_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698