Index: components/test/data/password_manager/tests.py |
diff --git a/components/test/data/password_manager/tests.py b/components/test/data/password_manager/tests.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..526ad4bfdcd536e5cf566b724fbee70296447fa5 |
--- /dev/null |
+++ b/components/test/data/password_manager/tests.py |
@@ -0,0 +1,316 @@ |
+# -*- coding: utf-8 -*- |
+ |
+import sys |
+ |
+from environment import Environment |
+ |
+ |
+""" Tests setup. """ |
+ |
+ |
+environment = Environment("websites.xml") |
vabr (Chromium)
2014/05/08 13:53:45
This should be part of the
if __name__ == "__main_
rchtara
2014/05/14 11:58:04
Done.
|
+ |
+ |
+""" Working tests. """ |
+ |
+ |
+amazon = environment.AddWebsite("amazon") |
vabr (Chromium)
2014/05/08 13:53:45
Could the whole addition of tests be a function?
I
rchtara
2014/05/14 11:58:04
Done.
|
+ |
+amazon.AddLoginAction( |
+ "goto", |
+ "https://www.amazon.com/ap/signin?_" |
+ "encoding=UTF8&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fsp" |
+ "ecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F" |
+ "%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_s" |
+ "etup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=h" |
+ "ttp%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_aut" |
+ "h_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fgp%2Fyourstore%2Fh" |
+ "ome%3Fie%3DUTF8%26ref_%3Dgno_signin") |
+amazon.AddLoginAction("fillusername", "[name='email']") |
+amazon.AddLoginAction("fillpassword", "[name='password']") |
+amazon.AddLoginAction("submit", "[name='password']") |
+amazon.AddLoginAction("wait", 2) |
+ |
+amazon.AddLogoutAction("hover", "#nav-signin-title") |
+amazon.AddLogoutAction("wait", 1) |
+amazon.AddLogoutAction("click", "#nav-item-signout") |
+ |
+ |
+ask = environment.AddWebsite("ask") |
+ |
+ask.AddLoginAction( |
+ "goto", "http://www.ask.com/answers/browse?qsrc=321&q=&o=0&l=dir#") |
+ask.AddLoginAction("click", "#a16CnbSignInText") |
+ask.AddLoginAction("fillusername", "[name='username']") |
+ask.AddLoginAction("fillpassword", "[name='password']") |
+ask.AddLoginAction("click", ".signin_show.signin_submit") |
+ask.AddLoginAction("wait", 2) |
+ |
+ask.AddLogoutAction("click", "#a16CnbSignInText") |
+ |
+ |
+espn = environment.AddWebsite("espn") |
+ |
+espn.AddLoginAction( |
+ "goto", |
+ "https://r.espn.go.com/members/v3_1/login?affiliateName=espn&appRedirect=" |
+ "http%3A%2F%2Fespn.go.com%2F&parentLocation=http%3A%2F%2Fespn.go.com%2F&" |
+ "password=dN_xw0GVUbgx935g3OU51&username=jkszbfkizhsefb789y4fui%40s" |
vabr (Chromium)
2014/05/08 13:53:45
This URL still contains the username.
Please scrub
rchtara
2014/05/14 11:58:04
Done.
|
+ "pamgoes.in®istrationFormId=espn&language=en&resize=true") |
+espn.AddLoginAction("fillusername", "#username") |
+espn.AddLoginAction("fillpassword", "#password") |
+espn.AddLoginAction("submit", "#password") |
+ |
+ |
+espn.AddLogoutAction("wait", 2) |
+espn.AddLogoutAction("click", "#signin .small") |
+ |
+ |
+facebook = environment.AddWebsite("facebook") |
+ |
+facebook.AddLoginAction("goto", "https://www.facebook.com") |
+facebook.AddLoginAction("fillusername", "[name='email']") |
+facebook.AddLoginAction("fillpassword", "[name='pass']") |
+facebook.AddLoginAction("submit", "[name='pass']") |
+ |
+facebook.AddLogoutAction("wait", 1) |
+facebook.AddLogoutAction("click", "#userNavigationLabel") |
+facebook.AddLogoutAction("wait", 1) |
+facebook.AddLogoutAction("click", "#logout_form [type='submit']") |
+ |
+ |
+google = environment.AddWebsite("google") |
+ |
+google.AddLoginAction( |
+ "goto", |
+ "https://accounts.google.com/ServiceLogin?sacu=1&continue=" |
+ "https%3A%2F%2Faccounts.google.com%2FManageAccount&hl=en") |
+google.AddLoginAction("fillusername", "#Email") |
+google.AddLoginAction("fillpassword", "#Passwd") |
+google.AddLoginAction("submit", "#Passwd") |
+ |
+google.AddLogoutAction("wait", 1) |
+google.AddLogoutAction("click", ".gb_V.gbii") |
+google.AddLogoutAction("wait", 1) |
+google.AddLogoutAction("click", "#gb_71") |
+google.AddLogoutAction( |
+ "goto", |
+ "https://accounts.google.com/ServiceLogin?sacu=1&continue=" |
+ "https%3A%2F%2Faccounts.google.com%2FManageAccount&hl=en") |
+ |
+ |
+mailru = environment.AddWebsite("mailru") |
+ |
+mailru.AddLoginAction("goto", "https://ww.mail.ru") |
vabr (Chromium)
2014/05/08 13:53:45
ww.mail.ru ?
Why not just mail.ru ?
rchtara
2014/05/14 11:58:04
Done.
|
+mailru.AddLoginAction("fillusername", "#mailbox__login") |
+mailru.AddLoginAction("fillpassword", "#mailbox__password") |
+mailru.AddLoginAction("submit", "#mailbox__password") |
+ |
+mailru.AddLogoutAction("click", "#PH_logoutLink") |
+ |
+ |
+nytimes = environment.AddWebsite("nytimes") |
+ |
+nytimes.AddLoginAction("goto", "https://myaccount.nytimes.com/auth/login") |
+nytimes.AddLoginAction("fillusername", "#userid") |
+nytimes.AddLoginAction("fillpassword", "#password") |
+nytimes.AddLoginAction("submit", "#password") |
+ |
+nytimes.AddLogoutAction("goto", "https://myaccount.nytimes.com/gst/signout") |
+ |
+ |
+pinterest = environment.AddWebsite("pinterest") |
+ |
+pinterest.AddLoginAction("goto", "https://www.pinterest.com/login/") |
+pinterest.AddLoginAction("fillusername", "[name='username_or_email']") |
+pinterest.AddLoginAction("fillpassword", "[name='password']") |
+pinterest.AddLoginAction("submit", "[name='password']") |
+ |
+pinterest.AddLogoutAction("goto", "https://www.pinterest.com/logout/") |
+ |
+ |
+reddit = environment.AddWebsite("reddit", username_not_auto=True) |
+ |
+reddit.AddLoginAction("goto", "http://www.reddit.com") |
+reddit.AddLoginAction("click", ".user .login-required") |
+reddit.AddLoginAction("fillusername", "#user_login") |
+reddit.AddLoginAction("fillpassword", "#passwd_login") |
+reddit.AddLoginAction("wait", 2) |
+reddit.AddLoginAction("submit", "#passwd_login") |
+ |
+reddit.AddLogoutAction("click", "form[action='http://www.reddit.com/logout'] a") |
+ |
+ |
+tumblr = environment.AddWebsite("tumbler", username_not_auto=True) |
+ |
+tumblr.AddLoginAction("goto", "https://www.tumblr.com/login") |
+tumblr.AddLoginAction("fillusername", "#signup_email") |
+tumblr.AddLoginAction("fillpassword", "#signup_password") |
+tumblr.AddLoginAction("submit", "#signup_password") |
+ |
+tumblr.AddLogoutAction("goto", "http://www.tumblr.com/logout") |
+ |
+ |
+wikipedia = environment.AddWebsite("wikipedia", username_not_auto=True) |
+ |
+wikipedia.AddLoginAction( |
+ "goto", "https://en.wikipedia.org/w/index.php?title=Special:UserLogin") |
+wikipedia.AddLoginAction("fillusername", "#wpName1") |
+wikipedia.AddLoginAction("fillpassword", "#wpPassword1") |
+wikipedia.AddLoginAction("submit", "#wpPassword1") |
+ |
+wikipedia.AddLogoutAction( |
+ "goto", "https://en.wikipedia.org/w/index.php?title=Special:UserLogout") |
+ |
+ |
+yandex = environment.AddWebsite("yandex") |
+ |
+yandex.AddLoginAction("goto", "https://mail.yandex.com") |
+yandex.AddLoginAction("fillusername", "#b-mail-domik-username11") |
+yandex.AddLoginAction("fillpassword", "#b-mail-domik-password11") |
+yandex.AddLoginAction("click", ".b-mail-button__button") |
+ |
+yandex.AddLogoutAction("click", ".header-user-pic.b-mail-dropdown__handle") |
+yandex.AddLogoutAction("click", |
+ u".b-mail-dropdown__item__contentn.Выход.daria-action") |
+ |
+ |
+""" Tests that can cause a crash (the cause of the crash is not related to the |
vabr (Chromium)
2014/05/08 13:53:45
For all crashing tests, please add a bugreport for
rchtara
2014/05/14 11:58:04
I think that the chrome version we use to run the
|
+password manager). """ |
+ |
+ |
+baidu = environment.AddWebsite("baidu") |
+ |
+baidu.AddLoginAction("goto", "http://www.baidu.com/") |
+baidu.AddLoginAction("click", "[name='tj_login']") |
+baidu.AddLoginAction("wait", 5) |
+baidu.AddLoginAction("fillusername", "[name='userName']") |
+baidu.AddLoginAction("fillpassword", "[name='password']") |
+baidu.AddLoginAction("submit", "[name='password']") |
+ |
+baidu.AddLogoutAction("wait", 1) |
+baidu.AddLogoutAction( |
+ "goto", "https://passport.baidu.com/?logout&u=http://www.baidu.com") |
+ |
+ |
+ebay = environment.AddWebsite("ebay") |
+ |
+ebay.AddLoginAction("goto", "https://signin.ebay.com/ws/eBayISAPI.dll?SellItem") |
+ebay.AddLoginAction("fillusername", "[name='userid']") |
+ebay.AddLoginAction("fillpassword", "[name='pass']") |
+ebay.AddLoginAction("submit", "[name='pass']") |
+ |
+ebay.AddLogoutAction("wait", 1) |
+ebay.AddLogoutAction("click", "#gh-ug") |
+ebay.AddLogoutAction("wait", 1) |
+ebay.AddLogoutAction("click", "#gh-uo") |
+ |
+ |
+linkedin = environment.AddWebsite("linkedin") |
+ |
+linkedin.AddLoginAction("goto", "https://www.linkedin.com") |
+linkedin.AddLoginAction("fillusername", "#session_key-login") |
+linkedin.AddLoginAction("fillpassword", "#session_password-login") |
+linkedin.AddLoginAction("submit", "#session_password-login") |
+ |
+linkedin.AddLogoutAction("wait", 1) |
+linkedin.AddLogoutAction("hover", ".account-toggle") |
+linkedin.AddLogoutAction("wait", 1) |
+linkedin.AddLogoutAction("click", ".account-settings .act-set-action") |
+ |
+ |
+yahoo = environment.AddWebsite("yahoo", username_not_auto=True) |
+ |
+yahoo.AddLoginAction("goto", "https://login.yahoo.com") |
+yahoo.AddLoginAction("optinalfillusername", "#username") |
+yahoo.AddLoginAction("fillpassword", "#passwd") |
+yahoo.AddLoginAction("submit", "#passwd") |
+ |
+yahoo.AddLogoutAction("wait", 5) |
+yahoo.AddLogoutAction("hover", ".tab.tab-user>.mod.view_default") |
+yahoo.AddLogoutAction("wait", 1) |
+yahoo.AddLogoutAction("click", "[data-pos='4'] .lbl.y-link-1") |
+ |
+ |
+""" Failing tests. """ |
+ |
+# crbug.com/368690 |
+cnn = environment.AddWebsite("cnn") |
+ |
+cnn.AddLoginAction("goto", "http://www.cnn.com") |
+cnn.AddLoginAction("wait", 5) |
+ |
+cnn.AddLoginAction("click", "#hdr-auth .no-border.no-pad-right a") |
+ |
+cnn.AddLoginAction("click", ".cnnOvrlyBtn.cnnBtnLogIn") |
+cnn.AddLoginAction("fillusername", "#cnnOverlayEmail1l") |
+cnn.AddLoginAction("fillpassword", "#cnnOverlayPwd") |
+cnn.AddLoginAction("click", ".cnnOvrlyBtn.cnnBtnLogIn") |
+cnn.AddLoginAction("wait", 5) |
+ |
+cnn.AddLogoutAction("wait", 4) |
+cnn.AddLogoutAction("click", "#hdr-auth .no-border.no-pad-right") |
+ |
+ |
+# crbug.com/367768 |
+live = environment.AddWebsite("live", username_not_auto=True) |
+ |
+live.AddLoginAction("goto", "https://www.live.com") |
+live.AddLoginAction("fillusername", "[name='login']") |
+live.AddLoginAction("fillpassword", "[name='passwd']") |
+live.AddLoginAction("submit", "[name='passwd']") |
+ |
+live.AddLogoutAction("wait", 1) |
+live.AddLogoutAction("click", "#c_meun") |
+live.AddLogoutAction("wait", 1) |
+live.AddLogoutAction("click", "#c_signout") |
+ |
+ |
+# crbug.com/368690 |
+one63 = environment.AddWebsite("163") |
+ |
+one63.AddLoginAction("goto", "http://www.163.com") |
+one63.AddLoginAction("hover", "#js_N_navHighlight") |
+one63.AddLoginAction("wait", 1) |
+one63.AddLoginAction("fillusername", "#js_loginframe_username") |
+one63.AddLoginAction("fillpassword", |
+ ".ntes-loginframe-label-ipt[type='password']") |
+one63.AddLoginAction("click", ".ntes-loginframe-btn") |
+ |
+ |
+one63.AddLogoutAction("wait", 4) |
+one63.AddLogoutAction("click", "#js_N_navLogout") |
+ |
+ |
+# crbug.com/368690 |
+vube = environment.AddWebsite("vube") |
+ |
+vube.AddLoginAction("goto", "https://vube.com") |
+vube.AddLoginAction("click", "[vube-login='']") |
+vube.AddLoginAction("wait", 2) |
+vube.AddLoginAction("fillusername", "[ng-model='login.user']") |
+vube.AddLoginAction("fillpassword", "[ng-model='login.pass']") |
+ |
+vube.AddLoginAction("click", "[ng-click='login()']") |
+vube.AddLoginAction("wait", 3) |
+ |
+vube.AddLogoutAction("wait", 1) |
+vube.AddLogoutAction("click", "[ng-click='user.logout()']") |
+ |
+ |
+""" Tests shutdown. """ |
vabr (Chromium)
2014/05/08 13:53:45
I don't understand what is meant here.
rchtara
2014/05/14 11:58:04
Done.
|
+ |
+working = ["amazon", "ask", "espn", "facebook", "google", "mailru", "nytimes", |
+ "pinterest", "reddit", "tumbler", "wikipedia", "yandex"] |
+ |
+args = sys.argv[1:] |
vabr (Chromium)
2014/05/08 13:53:45
Please enclose the code here in a
if __name__ == "
rchtara
2014/05/14 11:58:04
Done.
|
+ |
+if len(args) == 0: |
vabr (Chromium)
2014/05/08 13:53:45
Please also consider printing a brief help on argu
rchtara
2014/05/14 11:58:04
Done.
|
+ environment.Test(working) |
+elif "--all" in args: |
+ environment.AllTests() |
+else: |
+ environment.Test(args) |
+ |
+ |
+environment.Quit() |