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

Side by Side Diff: tools/perf/page_sets/login_helpers/dropbox_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 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.login_helpers import login_utils 5 from page_sets.login_helpers import login_utils
6 6
7 7
8 def LoginAccount(action_runner, credential, 8 def LoginAccount(action_runner, credential,
9 credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): 9 credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
10 """Logs in into a Dropbox account. 10 """Logs in into a Dropbox account.
(...skipping 14 matching lines...) Expand all
25 credential, credentials_path=credentials_path) 25 credential, credentials_path=credentials_path)
26 26
27 action_runner.Navigate('https://www.dropbox.com/login') 27 action_runner.Navigate('https://www.dropbox.com/login')
28 login_utils.InputWithSelector( 28 login_utils.InputWithSelector(
29 action_runner, account_name, 'input[name=login_email]') 29 action_runner, account_name, 'input[name=login_email]')
30 login_utils.InputWithSelector( 30 login_utils.InputWithSelector(
31 action_runner, password, 'input[name=login_password]') 31 action_runner, password, 'input[name=login_password]')
32 32
33 # Wait until the "Sign in" button is enabled and then click it. 33 # Wait until the "Sign in" button is enabled and then click it.
34 login_button_selector = '.login-form .login-button' 34 login_button_selector = '.login-form .login-button'
35 action_runner.WaitForJavaScriptCondition2(''' 35 action_runner.WaitForJavaScriptCondition('''
36 (function() { 36 (function() {
37 var loginButton = document.querySelector({{ selector }}); 37 var loginButton = document.querySelector({{ selector }});
38 if (!loginButton) 38 if (!loginButton)
39 return false; 39 return false;
40 return !loginButton.disabled; 40 return !loginButton.disabled;
41 })();''', 41 })();''',
42 selector=login_button_selector) 42 selector=login_button_selector)
43 action_runner.ClickElement(selector=login_button_selector) 43 action_runner.ClickElement(selector=login_button_selector)
44 action_runner.WaitForNavigate() 44 action_runner.WaitForNavigate()
OLDNEW
« no previous file with comments | « tools/perf/page_sets/login_helpers/chrome_login.py ('k') | tools/perf/page_sets/login_helpers/google_login.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698