From faa3376ca750a0bfdfef5aa5aced442711af2bd1 Mon Sep 17 00:00:00 2001 From: Damien Mat Date: Tue, 27 Aug 2019 18:48:39 +0200 Subject: [PATCH] [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 --- modules/creditmutuel/browser.py | 3 ++- modules/creditmutuel/pages.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/creditmutuel/browser.py b/modules/creditmutuel/browser.py index 55fa7aecee..9f55afd85c 100644 --- a/modules/creditmutuel/browser.py +++ b/modules/creditmutuel/browser.py @@ -48,7 +48,7 @@ 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.*)fr/banque/situation_financiere.cgi', r'/(?P.*)fr/banque/situation_financiere.html', AccountsPage) + mobile_confirmation = URL(r'/(?P.*)fr/banque/validation.aspx', MobileConfirmationPage) revolving_loan_list = URL(r'/(?P.*)fr/banque/CR/arrivee.asp\?fam=CR.*', RevolvingLoansList) revolving_loan_details = URL(r'/(?P.*)fr/banque/CR/cam9_vis_lstcpt.asp.*', RevolvingLoanDetails) user_space = URL(r'/(?P.*)fr/banque/espace_personnel.aspx', diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index 3eb2fdef8c..d24cab2e4c 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -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 -- GitLab