Commit 4d3ee01b authored by Florian Duguet's avatar Florian Duguet Committed by Romain Bignon

[carrefourbanque] handle error at login when login is an old format

raise BrowserIncorrectPassword, even if password is not wrong

Closes: 36047@sibi 36149@sibi 36150@sibi
parent f03aa842
......@@ -93,6 +93,11 @@ class CarrefourBanqueBrowser(LoginBrowser, StatesMixin):
raise BrowserUnavailable(self.page.get_message())
self.page.enter_login(self.username)
msg = self.page.get_message_if_old_login()
if msg:
# carrefourbanque has changed login of their user, they have to use their new internet id
raise BrowserIncorrectPassword(msg)
self.page.enter_password(self.password)
if not self.home.is_here():
......
......@@ -125,6 +125,9 @@ class LoginPage(HTMLPage):
form['name'] = username
form.submit()
def get_message_if_old_login(self):
return CleanText('//div[@class="messages error"]', children=False)(self.doc)
def enter_password(self, password):
data_code = {}
for img in self.doc.xpath('//img[@class="digit"]'):
......
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