Commit f1099ea0 authored by Maxime Gasselin's avatar Maxime Gasselin Committed by Romain Bignon

[creditmutuel] Handle new page to differenciate immediate and differate cards

Creditmutuel provides a new page for "fonctions" page. The precedent
page still exists. We handle both now.

Closes: 35599@sibi 39934@sibi 39670@sibi 10860@zendesk 11001@zendesk
11018@zendesk 11019@zendesk 11047@zendesk 11055@zendesk 11092@zendesk
11096@zendesk
parent a40a0d02
......@@ -127,7 +127,8 @@ class CreditMutuelBrowser(LoginBrowser, StatesMixin):
cards_ope = URL(r'/(?P<subbank>.*)fr/banque/pro/ENC_liste_oper', CardsOpePage)
cards_ope2 = URL('/(?P<subbank>.*)fr/banque/CRP8_SCIM_DEPCAR.aspx', CardPage2)
cards_hist_available = URL('/(?P<subbank>.*)fr/banque/SCIM_default.aspx\?_tabi=C&_stack=SCIM_ListeActivityStep%3a%3a&_pid=ListeCartes&_fid=ChangeList&Data_ServiceListDatas_CurrentType=MyCards', NewCardsListPage)
cards_hist_available = URL('/(?P<subbank>.*)fr/banque/SCIM_default.aspx\?_tabi=C&_stack=SCIM_ListeActivityStep%3a%3a&_pid=ListeCartes&_fid=ChangeList&Data_ServiceListDatas_CurrentType=MyCards',
'/(?P<subbank>.*)fr/banque/PCS1_CARDFUNCTIONS.aspx', NewCardsListPage)
cards_hist_available2 = URL('/(?P<subbank>.*)fr/banque/SCIM_default.aspx', NewCardsListPage)
internal_transfer = URL(r'/(?P<subbank>.*)fr/banque/virements/vplw_vi.html', InternalTransferPage)
......
......@@ -1952,9 +1952,9 @@ class NewCardsListPage(LoggedPage, HTMLPage):
card_type_page = Link('//div/ul/li/a[contains(text(), "Fonctions")]', default=NotAvailable)(history_page.doc)
if card_type_page:
doc = self.page.browser.open(card_type_page).page.doc
card_type_line = doc.xpath('//tbody/tr[th[contains(text(), "Débit des paiements")]]')
card_type_line = doc.xpath('//tbody/tr[th[contains(text(), "Débit des paiements")]]') or doc.xpath(u'//div[div/div/p[contains(text(), "Débit des paiements")]]')
if card_type_line:
if CleanText('./td')(card_type_line[0]) != 'Différé':
if 'Différé' not in CleanText('.//td')(card_type_line[0]):
raise SkipItem()
elif doc.xpath('//div/p[contains(text(), "Vous n\'avez pas l\'autorisation")]'):
self.logger.warning("The user can't reach this page")
......
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