Commit faa3376c authored by Damien Mat's avatar Damien Mat Committed by ntome

[creditmutuel/cic] Manage mobile confirmation page at login

A growing number of connections need strong authorization at the login
stage. In that case, the user is asked to give confirmation through
the mobile app. By following a link on that page we can bypass the
confirmation and continue navigation.

Closes: 12741@zendesk, 12774@zendesk, 12793@zendesk, 12881@zendesk,
12894@zendesk, 12951@zendesk, 12993@zendesk, 13002@zendesk, 13014@zendesk, 13019@zendesk, 35977@sibi,
33162@sibi, 36178@sibi, 36177@sibi
parent 706380ef
......@@ -48,7 +48,7 @@ from .pages import (
CardsOpePage, NewAccountsPage, InternalTransferPage,
ExternalTransferPage, RevolvingLoanDetails, RevolvingLoansList,
ErrorPage, SubscriptionPage, NewCardsListPage, CardPage2, FiscalityConfirmationPage,
ConditionsPage,
ConditionsPage, MobileConfirmationPage,
)
......@@ -71,6 +71,7 @@ class CreditMutuelBrowser(LoginBrowser, StatesMixin):
accounts = URL(r'/(?P<subbank>.*)fr/banque/situation_financiere.cgi',
r'/(?P<subbank>.*)fr/banque/situation_financiere.html',
AccountsPage)
mobile_confirmation = URL(r'/(?P<subbank>.*)fr/banque/validation.aspx', MobileConfirmationPage)
revolving_loan_list = URL(r'/(?P<subbank>.*)fr/banque/CR/arrivee.asp\?fam=CR.*', RevolvingLoansList)
revolving_loan_details = URL(r'/(?P<subbank>.*)fr/banque/CR/cam9_vis_lstcpt.asp.*', RevolvingLoanDetails)
user_space = URL(r'/(?P<subbank>.*)fr/banque/espace_personnel.aspx',
......
......@@ -105,6 +105,18 @@ class FiscalityConfirmationPage(LoggedPage, HTMLPage):
pass
class MobileConfirmationPage(LoggedPage, HTMLPage):
# We land on this page for some connections, but can still bypass this verification for now
def on_load(self):
link = Attr('//a[contains(text(), "Accéder à mon Espace Client sans Confirmation Mobile")]', 'href', default=None)(self.doc)
if link:
self.logger.warning('This connexion is bypassing mobile confirmation')
self.browser.location(link)
else:
self.logger.warning('This connexion cannot bypass mobile confirmation')
assert False, 'This connexion cannot bypass mobile confirmation'
class EmptyPage(LoggedPage, HTMLPage):
REFRESH_MAX = 10.0
......
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