OLD | NEW |
(Empty) | |
| 1 # -*- coding: utf-8 -*- |
| 2 from environment import Environment |
| 3 |
| 4 |
| 5 """ Tests setup. """ |
| 6 |
| 7 |
| 8 environment = Environment("websites.xml") |
| 9 |
| 10 |
| 11 """ Working tests. """ |
| 12 |
| 13 |
| 14 amazon = environment.AddWebsite("amazon") |
| 15 |
| 16 amazon.AddLoginAction( |
| 17 "goto", |
| 18 "https://www.amazon.com/ap/signin?_" |
| 19 "encoding=UTF8&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fsp" |
| 20 "ecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F" |
| 21 "%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_s" |
| 22 "etup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=h" |
| 23 "ttp%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_aut" |
| 24 "h_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Fgp%2Fyourstore%2Fh" |
| 25 "ome%3Fie%3DUTF8%26ref_%3Dgno_signin") |
| 26 amazon.AddLoginAction("fillusername", "[name='email']") |
| 27 amazon.AddLoginAction("fillpassword", "[name='password']") |
| 28 amazon.AddLoginAction("submit", "[name='password']") |
| 29 amazon.AddLoginAction("wait", 2) |
| 30 |
| 31 amazon.AddLogoutAction("hover", "#nav-signin-title") |
| 32 amazon.AddLogoutAction("wait", 1) |
| 33 amazon.AddLogoutAction("click", "#nav-item-signout") |
| 34 |
| 35 |
| 36 ask = environment.AddWebsite("ask") |
| 37 |
| 38 ask.AddLoginAction( |
| 39 "goto", "http://www.ask.com/answers/browse?qsrc=321&q=&o=0&l=dir#") |
| 40 ask.AddLoginAction("click", "#a16CnbSignInText") |
| 41 ask.AddLoginAction("fillusername", "[name='username']") |
| 42 ask.AddLoginAction("fillpassword", "[name='password']") |
| 43 ask.AddLoginAction("click", ".signin_show.signin_submit") |
| 44 ask.AddLoginAction("wait", 2) |
| 45 |
| 46 ask.AddLogoutAction("click", "#a16CnbSignInText") |
| 47 |
| 48 |
| 49 espn = environment.AddWebsite("espn") |
| 50 |
| 51 espn.AddLoginAction( |
| 52 "goto", |
| 53 "https://r.espn.go.com/members/v3_1/login?affiliateName=espn&appRedirect=" |
| 54 "http%3A%2F%2Fespn.go.com%2F&parentLocation=http%3A%2F%2Fespn.go.com%2F&" |
| 55 "password=dN_xw0GVUbgx935g3OU51&username=jkszbfkizhsefb789y4fui%40s" |
| 56 "pamgoes.in®istrationFormId=espn&language=en&resize=true") |
| 57 espn.AddLoginAction("fillusername", "#username") |
| 58 espn.AddLoginAction("fillpassword", "#password") |
| 59 espn.AddLoginAction("submit", "#password") |
| 60 |
| 61 |
| 62 espn.AddLogoutAction("wait", 2) |
| 63 espn.AddLogoutAction("click", "#signin .small") |
| 64 |
| 65 |
| 66 facebook = environment.AddWebsite("facebook") |
| 67 |
| 68 facebook.AddLoginAction("goto", "https://www.facebook.com") |
| 69 facebook.AddLoginAction("fillusername", "[name='email']") |
| 70 facebook.AddLoginAction("fillpassword", "[name='pass']") |
| 71 facebook.AddLoginAction("submit", "[name='pass']") |
| 72 |
| 73 facebook.AddLogoutAction("wait", 1) |
| 74 facebook.AddLogoutAction("click", "#userNavigationLabel") |
| 75 facebook.AddLogoutAction("wait", 1) |
| 76 facebook.AddLogoutAction("click", "#logout_form [type='submit']") |
| 77 |
| 78 |
| 79 google = environment.AddWebsite("google") |
| 80 |
| 81 google.AddLoginAction( |
| 82 "goto", |
| 83 "https://accounts.google.com/ServiceLogin?sacu=1&continue=" |
| 84 "https%3A%2F%2Faccounts.google.com%2FManageAccount&hl=en") |
| 85 google.AddLoginAction("fillusername", "#Email") |
| 86 google.AddLoginAction("fillpassword", "#Passwd") |
| 87 google.AddLoginAction("submit", "#Passwd") |
| 88 |
| 89 google.AddLogoutAction("wait", 1) |
| 90 google.AddLogoutAction("click", ".gb_V.gbii") |
| 91 google.AddLogoutAction("wait", 1) |
| 92 google.AddLogoutAction("click", "#gb_71") |
| 93 google.AddLogoutAction( |
| 94 "goto", |
| 95 "https://accounts.google.com/ServiceLogin?sacu=1&continue=" |
| 96 "https%3A%2F%2Faccounts.google.com%2FManageAccount&hl=en") |
| 97 |
| 98 |
| 99 mailru = environment.AddWebsite("mailru") |
| 100 |
| 101 mailru.AddLoginAction("goto", "https://ww.mail.ru") |
| 102 mailru.AddLoginAction("fillusername", "#mailbox__login") |
| 103 mailru.AddLoginAction("fillpassword", "#mailbox__password") |
| 104 mailru.AddLoginAction("submit", "#mailbox__password") |
| 105 |
| 106 mailru.AddLogoutAction("click", "#PH_logoutLink") |
| 107 |
| 108 |
| 109 nytimes = environment.AddWebsite("nytimes") |
| 110 |
| 111 nytimes.AddLoginAction("goto", "https://myaccount.nytimes.com/auth/login") |
| 112 nytimes.AddLoginAction("fillusername", "#userid") |
| 113 nytimes.AddLoginAction("fillpassword", "#password") |
| 114 nytimes.AddLoginAction("submit", "#password") |
| 115 |
| 116 nytimes.AddLogoutAction("goto", "https://myaccount.nytimes.com/gst/signout") |
| 117 |
| 118 |
| 119 pinterest = environment.AddWebsite("pinterest") |
| 120 |
| 121 pinterest.AddLoginAction("goto", "https://www.pinterest.com/login/") |
| 122 pinterest.AddLoginAction("fillusername", "[name='username_or_email']") |
| 123 pinterest.AddLoginAction("fillpassword", "[name='password']") |
| 124 pinterest.AddLoginAction("submit", "[name='password']") |
| 125 |
| 126 pinterest.AddLogoutAction("goto", "https://www.pinterest.com/logout/") |
| 127 |
| 128 |
| 129 reddit = environment.AddWebsite("reddit", username_not_auto=True) |
| 130 |
| 131 reddit.AddLoginAction("goto", "http://www.reddit.com") |
| 132 reddit.AddLoginAction("click", ".user .login-required") |
| 133 reddit.AddLoginAction("fillusername", "#user_login") |
| 134 reddit.AddLoginAction("fillpassword", "#passwd_login") |
| 135 reddit.AddLoginAction("wait", 2) |
| 136 reddit.AddLoginAction("submit", "#passwd_login") |
| 137 |
| 138 reddit.AddLogoutAction("click", "form[action='http://www.reddit.com/logout'] a") |
| 139 |
| 140 |
| 141 tumblr = environment.AddWebsite("tumbler", username_not_auto=True) |
| 142 |
| 143 tumblr.AddLoginAction("goto", "https://www.tumblr.com/login") |
| 144 tumblr.AddLoginAction("fillusername", "#signup_email") |
| 145 tumblr.AddLoginAction("fillpassword", "#signup_password") |
| 146 tumblr.AddLoginAction("submit", "#signup_password") |
| 147 |
| 148 tumblr.AddLogoutAction("goto", "http://www.tumblr.com/logout") |
| 149 |
| 150 |
| 151 wikipedia = environment.AddWebsite("wikipedia", username_not_auto=True) |
| 152 |
| 153 wikipedia.AddLoginAction( |
| 154 "goto", "https://en.wikipedia.org/w/index.php?title=Special:UserLogin") |
| 155 wikipedia.AddLoginAction("fillusername", "#wpName1") |
| 156 wikipedia.AddLoginAction("fillpassword", "#wpPassword1") |
| 157 wikipedia.AddLoginAction("submit", "#wpPassword1") |
| 158 |
| 159 wikipedia.AddLogoutAction( |
| 160 "goto", "https://en.wikipedia.org/w/index.php?title=Special:UserLogout") |
| 161 |
| 162 |
| 163 yandex = environment.AddWebsite("yandex") |
| 164 |
| 165 yandex.AddLoginAction("goto", "https://mail.yandex.com") |
| 166 yandex.AddLoginAction("fillusername", "#b-mail-domik-username11") |
| 167 yandex.AddLoginAction("fillpassword", "#b-mail-domik-password11") |
| 168 yandex.AddLoginAction("click", ".b-mail-button__button") |
| 169 |
| 170 yandex.AddLogoutAction("click", ".header-user-pic.b-mail-dropdown__handle") |
| 171 yandex.AddLogoutAction("click", |
| 172 u".b-mail-dropdown__item__contentn.Выход.daria-action") |
| 173 |
| 174 |
| 175 """ Tests that can cause a crash (the cause of the crash is not related to the |
| 176 password manager). """ |
| 177 |
| 178 """ |
| 179 baidu = environment.AddWebsite("baidu") |
| 180 |
| 181 baidu.AddLoginAction("goto", "http://www.baidu.com/") |
| 182 baidu.AddLoginAction("click", "[name='tj_login']") |
| 183 baidu.AddLoginAction("wait", 5) |
| 184 baidu.AddLoginAction("fillusername", "[name='userName']") |
| 185 baidu.AddLoginAction("fillpassword", "[name='password']") |
| 186 baidu.AddLoginAction("submit", "[name='password']") |
| 187 |
| 188 baidu.AddLogoutAction("wait", 1) |
| 189 baidu.AddLogoutAction( |
| 190 "goto", "https://passport.baidu.com/?logout&u=http://www.baidu.com") |
| 191 |
| 192 |
| 193 ebay = environment.AddWebsite("ebay") |
| 194 |
| 195 ebay.AddLoginAction("goto", "https://signin.ebay.com/ws/eBayISAPI.dll?SellItem") |
| 196 ebay.AddLoginAction("fillusername", "[name='userid']") |
| 197 ebay.AddLoginAction("fillpassword", "[name='pass']") |
| 198 ebay.AddLoginAction("submit", "[name='pass']") |
| 199 |
| 200 ebay.AddLogoutAction("wait", 1) |
| 201 ebay.AddLogoutAction("click", "#gh-ug") |
| 202 ebay.AddLogoutAction("wait", 1) |
| 203 ebay.AddLogoutAction("click", "#gh-uo") |
| 204 |
| 205 |
| 206 linkedin = environment.AddWebsite("linkedin") |
| 207 |
| 208 linkedin.AddLoginAction("goto", "https://www.linkedin.com") |
| 209 linkedin.AddLoginAction("fillusername", "#session_key-login") |
| 210 linkedin.AddLoginAction("fillpassword", "#session_password-login") |
| 211 linkedin.AddLoginAction("submit", "#session_password-login") |
| 212 |
| 213 linkedin.AddLogoutAction("wait", 1) |
| 214 linkedin.AddLogoutAction("hover", ".account-toggle") |
| 215 linkedin.AddLogoutAction("wait", 1) |
| 216 linkedin.AddLogoutAction("click", ".account-settings .act-set-action") |
| 217 |
| 218 |
| 219 yahoo = environment.AddWebsite("yahoo", username_not_auto=True) |
| 220 |
| 221 yahoo.AddLoginAction("goto", "https://login.yahoo.com") |
| 222 yahoo.AddLoginAction("optinalfillusername", "#username") |
| 223 yahoo.AddLoginAction("fillpassword", "#passwd") |
| 224 yahoo.AddLoginAction("submit", "#passwd") |
| 225 |
| 226 yahoo.AddLogoutAction("wait", 5) |
| 227 yahoo.AddLogoutAction("hover", ".tab.tab-user>.mod.view_default") |
| 228 yahoo.AddLogoutAction("wait", 1) |
| 229 yahoo.AddLogoutAction("click", "[data-pos='4'] .lbl.y-link-1") |
| 230 """ |
| 231 |
| 232 """ Failing tests. """ |
| 233 """ |
| 234 #crbug.com/368690 |
| 235 cnn = environment.AddWebsite("cnn") |
| 236 |
| 237 cnn.AddLoginAction("goto", "http://www.cnn.com") |
| 238 cnn.AddLoginAction("wait", 5) |
| 239 |
| 240 cnn.AddLoginAction("click", "#hdr-auth .no-border.no-pad-right a") |
| 241 |
| 242 cnn.AddLoginAction("click", ".cnnOvrlyBtn.cnnBtnLogIn") |
| 243 cnn.AddLoginAction("fillusername", "#cnnOverlayEmail1l") |
| 244 cnn.AddLoginAction("fillpassword", "#cnnOverlayPwd") |
| 245 cnn.AddLoginAction("click", ".cnnOvrlyBtn.cnnBtnLogIn") |
| 246 cnn.AddLoginAction("wait", 5) |
| 247 |
| 248 cnn.AddLogoutAction("wait", 4) |
| 249 cnn.AddLogoutAction("click", "#hdr-auth .no-border.no-pad-right") |
| 250 |
| 251 |
| 252 #crbug.com/367768 |
| 253 live = environment.AddWebsite("live", username_not_auto=True) |
| 254 |
| 255 live.AddLoginAction("goto", "https://www.live.com") |
| 256 live.AddLoginAction("fillusername", "[name='login']") |
| 257 live.AddLoginAction("fillpassword", "[name='passwd']") |
| 258 live.AddLoginAction("submit", "[name='passwd']") |
| 259 |
| 260 live.AddLogoutAction("wait", 1) |
| 261 live.AddLogoutAction("click", "#c_meun") |
| 262 live.AddLogoutAction("wait", 1) |
| 263 live.AddLogoutAction("click", "#c_signout") |
| 264 |
| 265 |
| 266 #crbug.com/368690 |
| 267 one63 = environment.AddWebsite("163") |
| 268 |
| 269 one63.AddLoginAction("goto", "http://www.163.com") |
| 270 one63.AddLoginAction("hover", "#js_N_navHighlight") |
| 271 one63.AddLoginAction("wait", 1) |
| 272 one63.AddLoginAction("fillusername", "#js_loginframe_username") |
| 273 one63.AddLoginAction("fillpassword", |
| 274 ".ntes-loginframe-label-ipt[type='password']") |
| 275 one63.AddLoginAction("click", ".ntes-loginframe-btn") |
| 276 |
| 277 |
| 278 one63.AddLogoutAction("wait", 4) |
| 279 one63.AddLogoutAction("click", "#js_N_navLogout") |
| 280 |
| 281 |
| 282 #crbug.com/368690 |
| 283 vube = environment.AddWebsite("vube") |
| 284 |
| 285 vube.AddLoginAction("goto", "https://vube.com") |
| 286 vube.AddLoginAction("click", "[vube-login='']") |
| 287 vube.AddLoginAction("wait", 2) |
| 288 vube.AddLoginAction("fillusername", "[ng-model='login.user']") |
| 289 vube.AddLoginAction("fillpassword", "[ng-model='login.pass']") |
| 290 |
| 291 vube.AddLoginAction("click", "[ng-click='login()']") |
| 292 vube.AddLoginAction("wait", 3) |
| 293 |
| 294 vube.AddLogoutAction("wait", 1) |
| 295 vube.AddLogoutAction("click", "[ng-click='user.logout()']") |
| 296 """ |
| 297 |
| 298 """ Tests shutdown. """ |
| 299 |
| 300 |
| 301 environment.AllTests() |
| 302 environment.Quit() |
OLD | NEW |