Index: tools/perf/page_sets/login_helpers/facebook_login.py |
diff --git a/tools/perf/page_sets/login_helpers/facebook_login.py b/tools/perf/page_sets/login_helpers/facebook_login.py |
index 360cf28da6f7f6fdaa77f10ba8b2c04a3ab068cf..0ca796d46a048b0a2753be7fca7b1550e5717f49 100644 |
--- a/tools/perf/page_sets/login_helpers/facebook_login.py |
+++ b/tools/perf/page_sets/login_helpers/facebook_login.py |
@@ -33,3 +33,34 @@ def LoginWithMobileSite( |
action_runner.WaitForElement(text='OK') |
action_runner.ClickElement(text='OK') |
action_runner.WaitForNavigate() |
+ |
+ |
+def LoginWithDesktopSite( |
+ action_runner, credential, |
+ credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): |
+ """Logs in into mobile Facebook account. |
nednguyen
2016/07/26 18:33:43
s/mobile/desktop
Hannes Payer (out of office)
2016/07/27 09:04:33
Done.
|
+ |
+ This function navigates the tab into Facebook's login page and logs in a user |
+ using credentials in |credential| part of the |credentials_path| file. |
+ |
+ Args: |
+ action_runner: Action runner responsible for running actions on the page. |
+ credential: The credential to retrieve from the credentials file |
+ (type string). |
+ credentials_path: The string that specifies the path to credential file. |
+ |
+ Raises: |
+ exceptions.Error: See ExecuteJavaScript() |
+ for a detailed list of possible exceptions. |
+ """ |
+ account_name, password = login_utils.GetAccountNameAndPassword( |
+ credential, credentials_path=credentials_path) |
+ |
+ action_runner.Navigate( |
+ 'https://m.facebook.com/login?continue=https%3A%2F%2Fm.facebook.com') |
nednguyen
2016/07/26 18:33:43
nits: change this url to the desktop one
Hannes Payer (out of office)
2016/07/27 09:04:33
The desktop login page gets stuck most of the time
nednguyen
2016/07/27 13:58:43
ok, but can you add some documentation explaining
Hannes Payer (out of office)
2016/07/28 14:03:44
Done.
|
+ login_utils.InputWithSelector(action_runner, account_name, '[name=email]') |
+ login_utils.InputWithSelector(action_runner, password, '[name=pass]') |
+ action_runner.ClickElement(selector='[name=login]') |
+ action_runner.WaitForElement(text='OK') |
+ action_runner.ClickElement(text='OK') |
+ action_runner.WaitForNavigate() |