Commit 1a29f2a9 authored by Maxime Pommier's avatar Maxime Pommier Committed by Romain Bignon

[axabanque] Handle error 500 page

Closes: 20146@sibi 8018@zendesk
parent 190adbfb
...@@ -60,7 +60,9 @@ class AXABrowser(LoginBrowser): ...@@ -60,7 +60,9 @@ class AXABrowser(LoginBrowser):
denied = URL('https://connect.axa.fr/Account/AccessDenied', DeniedPage) denied = URL('https://connect.axa.fr/Account/AccessDenied', DeniedPage)
account_space_login = URL('https://connect.axa.fr/api/accountspace', AccountSpaceLogin) account_space_login = URL('https://connect.axa.fr/api/accountspace', AccountSpaceLogin)
errors = URL('https://espaceclient.axa.fr/content/ecc-public/accueil-axa-connect/_jcr_content/par/text.html', ErrorPage) errors = URL('https://espaceclient.axa.fr/content/ecc-public/accueil-axa-connect/_jcr_content/par/text.html',
'https://espaceclient.axa.fr/content/ecc-public/errors/500.html',
ErrorPage)
def do_login(self): def do_login(self):
# due to the website change, login changed too, this is for don't try to login with the wrong login # due to the website change, login changed too, this is for don't try to login with the wrong login
......
...@@ -121,8 +121,10 @@ class ErrorPage(PartialHTMLPage): ...@@ -121,8 +121,10 @@ class ErrorPage(PartialHTMLPage):
error_msg = ( error_msg = (
CleanText('//p[contains(text(), "temporairement indisponible")]')(self.doc), CleanText('//p[contains(text(), "temporairement indisponible")]')(self.doc),
CleanText('//p[contains(text(), "maintenance est en cours")]')(self.doc), CleanText('//p[contains(text(), "maintenance est en cours")]')(self.doc),
# parsing for false 500 error page
CleanText('//div[contains(@class, "error-page")]//span[contains(@class, "subtitle") and contains(text(), "Chargement de page impossible")]')(self.doc)
) )
for error in error_msg: for error in error_msg:
if error: if error:
raise BrowserUnavailable(error_msg) raise BrowserUnavailable(error)
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