Commit c4a8442c authored by Florian Duguet's avatar Florian Duguet Committed by Romain Bignon

[barclays] add message to BrowserIncorrectPassword exception

parent 57812cdc
......@@ -109,8 +109,10 @@ class Barclays(LoginBrowser):
self.login.go()
self.page.login(self.username, self.password)
if self.page.has_error():
raise BrowserIncorrectPassword()
error_message = self.page.get_error_message()
if error_message:
assert 'Saisie incorrecte' in error_message, error_message
raise BrowserIncorrectPassword(error_message)
# can't login if there is ' ' in the 2 characters asked
if not self.page.login_secret(self.secret):
......
......@@ -105,8 +105,8 @@ class LoginPage(HTMLPage):
form.submit()
return True
def has_error(self):
return bool(CleanText('//div[@class="bloc-message error" and not(@style)]')(self.doc))
def get_error_message(self):
return CleanText('//div[@class="bloc-message error" and not(@style)]')(self.doc)
class AccountsPage(StatefulPage):
......
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