Commit 62853b21 authored by Mickaël Thomas's avatar Mickaël Thomas

[banquepopulaire] fix login page

parent cf45e256
Pipeline #674 canceled with stages
......@@ -290,14 +290,16 @@ class Login2Page(LoginPage):
r = self.browser.open(self.request_url)
doc = json.loads(r.content)
self.form_id = doc['step']['validationUnits'][0]['PASSWORD_LOOKUP'][0]['id']
validation_unit = doc['step']['validationUnits'][0]
self.form_key = next(iter(validation_unit))
self.form_id = validation_unit[self.form_key][0]['id']
def login(self, login, password):
payload = {'validate': {'PASSWORD_LOOKUP': [{'id': self.form_id,
'login': login.encode(self.ENCODING).upper(),
'password': password.encode(self.ENCODING),
'type': 'PASSWORD_LOOKUP'
}]
payload = {'validate': {self.form_key: [{'id': self.form_id,
'login': login.encode(self.ENCODING).upper(),
'password': password.encode(self.ENCODING),
'type': 'PASSWORD_LOOKUP'
}]
}
}
......
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