handle expired password
This commit is contained in:
parent
15b9e1d10c
commit
a833a3e328
2 changed files with 10 additions and 0 deletions
|
|
@ -76,6 +76,10 @@ class AXABanque(Browser):
|
||||||
def get_accounts_list(self):
|
def get_accounts_list(self):
|
||||||
if not self.is_on_page(AccountsPage):
|
if not self.is_on_page(AccountsPage):
|
||||||
self.location('/transactionnel/client/liste-comptes.html')
|
self.location('/transactionnel/client/liste-comptes.html')
|
||||||
|
|
||||||
|
if self.page.is_password_expired():
|
||||||
|
raise BrowserIncorrectPassword()
|
||||||
|
|
||||||
return self.page.get_list()
|
return self.page.get_list()
|
||||||
|
|
||||||
def get_account(self, id):
|
def get_account(self, id):
|
||||||
|
|
@ -92,6 +96,9 @@ class AXABanque(Browser):
|
||||||
if not self.is_on_page(AccountsPage):
|
if not self.is_on_page(AccountsPage):
|
||||||
account = self.get_account(account.id)
|
account = self.get_account(account.id)
|
||||||
|
|
||||||
|
if self.page.is_password_expired():
|
||||||
|
raise BrowserIncorrectPassword()
|
||||||
|
|
||||||
args = account._args
|
args = account._args
|
||||||
args['javax.faces.ViewState'] = self.page.get_view_state()
|
args['javax.faces.ViewState'] = self.page.get_view_state()
|
||||||
self.location('/webapp/axabanque/jsp/panorama.faces', urllib.urlencode(args))
|
self.location('/webapp/axabanque/jsp/panorama.faces', urllib.urlencode(args))
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ class BasePage(_BasePage):
|
||||||
def get_view_state(self):
|
def get_view_state(self):
|
||||||
return self.document.xpath('//input[@name="javax.faces.ViewState"]')[0].attrib['value']
|
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):
|
class UnavailablePage(BasePage):
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue