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

Unified Diff: functional/test_utils.py

Issue 5379007: Adding pyauto tests to passwords.py... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « functional/passwords.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: functional/test_utils.py
===================================================================
--- functional/test_utils.py (revision 67497)
+++ functional/test_utils.py (working copy)
@@ -44,7 +44,7 @@
pyauto_utils.RemovePath(downloaded_pkg + '.crdownload')
-def GoogleAccountsLogin(test, url, username, password):
+def GoogleAccountsLogin(test, username, password, tab_index=0, windex=0):
"""Log into Google Accounts.
Attempts to login to Google by entering the username/password into the google
@@ -54,28 +54,36 @@
test: derived from pyauto.PyUITest - base class for UI test cases.
username: users login input.
password: users login password input.
+ tab_index: The tab index, default is 0.
+ windex: The window index, default is 0.
"""
- test.NavigateToURL('https://www.google.com/accounts/')
- email_id = 'document.getElementById("Email").value = \"%s\"; ' \
+ test.NavigateToURL('https://www.google.com/accounts/', windex, tab_index)
+ email_id = 'document.getElementById("Email").value = "%s"; ' \
'window.domAutomationController.send("done")' % username
- password = 'document.getElementById("Passwd").value = \"%s\"; ' \
+ password = 'document.getElementById("Passwd").value = "%s"; ' \
'window.domAutomationController.send("done")' % password
- test.ExecuteJavascript(email_id);
- test.ExecuteJavascript(password);
+ test.ExecuteJavascript(email_id, windex, tab_index);
+ test.ExecuteJavascript(password, windex, tab_index);
test.ExecuteJavascript('document.getElementById("gaia_loginform").submit();'
- 'window.domAutomationController.send("done")')
+ 'window.domAutomationController.send("done")',
+ windex, tab_index)
-def VerifyGoogleAccountCredsFilled(test, username, password):
+def VerifyGoogleAccountCredsFilled(test, username, password, tab_index=0,
+ windex=0):
"""Verify stored/saved user and password values to the values in the field.
Args:
test: derived from pyauto.PyUITest - base class for UI test cases.
username: user log in input.
password: user log in password input.
+ tab_index: The tab index, default is 0.
+ windex: The window index, default is 0.
"""
- email_value = test.GetDOMValue('document.getElementById("Email").value')
- passwd_value = test.GetDOMValue('document.getElementById("Passwd").value')
+ email_value = test.GetDOMValue('document.getElementById("Email").value',
+ windex, tab_index)
+ passwd_value = test.GetDOMValue('document.getElementById("Passwd").value',
+ windex, tab_index)
test.assertEqual(email_value, username)
test.assertEqual(passwd_value, password)
@@ -137,4 +145,3 @@
smtp_obj = smtplib.SMTP(smtp)
smtp_obj.sendmail(send_from, send_to, msg.as_string())
smtp_obj.close()
-
« no previous file with comments | « functional/passwords.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698