OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """WebsiteTest testing class.""" | 5 """WebsiteTest testing class.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import sys | 8 import sys |
9 import time | 9 import time |
10 | 10 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 self.mode = self.Mode.AUTOFILLED | 282 self.mode = self.Mode.AUTOFILLED |
283 self.Login() | 283 self.Login() |
284 | 284 |
285 def LoginWhenNotAutofilled(self): | 285 def LoginWhenNotAutofilled(self): |
286 """Logs in and checks that the password is not autofilled.""" | 286 """Logs in and checks that the password is not autofilled.""" |
287 self.mode = self.Mode.NOT_AUTOFILLED | 287 self.mode = self.Mode.NOT_AUTOFILLED |
288 self.Login() | 288 self.Login() |
289 | 289 |
290 def Logout(self): | 290 def Logout(self): |
291 """Logout Method.""" | 291 """Logout Method.""" |
292 self.environment.ClearAllCookies() | |
293 | 292 |
294 # Tests | 293 # Tests |
295 | 294 |
296 def WrongLoginTest(self): | 295 def WrongLoginTest(self): |
297 """Does the wrong login test: Tries to login with a wrong password and | 296 """Does the wrong login test: Tries to login with a wrong password and |
298 checks that the password is not saved. | 297 checks that the password is not saved. |
299 | 298 |
300 Raises: | 299 Raises: |
301 Exception: An exception is raised if the test fails: If there is a | 300 Exception: An exception is raised if the test fails: If there is a |
302 problem when performing the login (ex: the login button is not | 301 problem when performing the login (ex: the login button is not |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 395 |
397 self.LoginWhenNotAutofilled() | 396 self.LoginWhenNotAutofilled() |
398 self.Wait(2) | 397 self.Wait(2) |
399 self.environment.SwitchToInternals() | 398 self.environment.SwitchToInternals() |
400 self.environment.CheckForNewMessage( | 399 self.environment.CheckForNewMessage( |
401 environment.MESSAGE_ASK, | 400 environment.MESSAGE_ASK, |
402 True, | 401 True, |
403 "Error: password manager hasn't detected a successful login for the " | 402 "Error: password manager hasn't detected a successful login for the " |
404 "following website : %s \n" % self.name) | 403 "following website : %s \n" % self.name) |
405 self.environment.SwitchFromInternals() | 404 self.environment.SwitchFromInternals() |
OLD | NEW |