Commit 43e3c907 authored by Damien Mat's avatar Damien Mat Committed by ntome

[ganassurances] Updated BrowserIncorrectPassword

Got to raise it with a get_error in the login function, with checking of the error message

Closes: 11797@zendesk, 29323@sibi
parent f1ca8105
......@@ -55,7 +55,11 @@ class GroupamaBrowser(LoginBrowser):
self.page.login(self.username, self.password)
if self.login.is_here():
raise BrowserIncorrectPassword()
error_msg = self.page.get_error()
if error_msg and "LOGIN_ERREUR_MOT_PASSE_INVALIDE" in error_msg:
raise BrowserIncorrectPassword()
assert False, 'Unhandled error at login: %s' % error_msg
# For life asssurance accounts, to get balance we use the link from the account.
# And to get history (or other) we need to use the link again but the link works only once.
......
......@@ -51,6 +51,9 @@ class LoginPage(HTMLPage):
form['password'] = pass_string
form.submit()
def get_error(self):
return CleanText('//div[@id="msg"]')(self.doc)
class AccountsPage(LoggedPage, HTMLPage):
ACCOUNT_TYPES = {u'Solde des comptes bancaires - Groupama Banque': Account.TYPE_CHECKING,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment