handle expired password

This commit is contained in:
Vincent Paredes 2015-03-09 10:52:12 +01:00 committed by Romain Bignon
commit a833a3e328
2 changed files with 10 additions and 0 deletions

View file

@ -76,6 +76,10 @@ class AXABanque(Browser):
def get_accounts_list(self):
if not self.is_on_page(AccountsPage):
self.location('/transactionnel/client/liste-comptes.html')
if self.page.is_password_expired():
raise BrowserIncorrectPassword()
return self.page.get_list()
def get_account(self, id):
@ -92,6 +96,9 @@ class AXABanque(Browser):
if not self.is_on_page(AccountsPage):
account = self.get_account(account.id)
if self.page.is_password_expired():
raise BrowserIncorrectPassword()
args = account._args
args['javax.faces.ViewState'] = self.page.get_view_state()
self.location('/webapp/axabanque/jsp/panorama.faces', urllib.urlencode(args))

View file

@ -33,6 +33,9 @@ class BasePage(_BasePage):
def get_view_state(self):
return self.document.xpath('//input[@name="javax.faces.ViewState"]')[0].attrib['value']
def is_password_expired(self):
return len(self.document.xpath('//div[@id="popup_client_modifier_code_confidentiel"]'))
class UnavailablePage(BasePage):
def on_loaded(self):