Commit 44f27a4b authored by Maxime Gasselin's avatar Maxime Gasselin Committed by Romain Bignon

[creditmutuel] Repair pro card return

Some cards were missing into the "activité cartes professionnelles" space. Moreover some invalid cards were return if we
don't put it in the unavailable cards list.

Closes: 8246@zendesk
parent fc98da7f
......@@ -613,8 +613,11 @@ class CardsListPage(LoggedPage, HTMLPage):
page ='//form//a[text()="Contrat"]', default=None)(page.doc)).page
xpath = '//table[has-class("liste")]/tbody/tr'
active_card = CleanText('%s[td[text()="Active"]][1]/td[2]' % xpath, replace=[(' ', '')], default=None)(page.doc)
for cards in page.doc.xpath(xpath):
if CleanText(cards.xpath('./td[1]'))(self) != 'Active':'./td[2]'), replace=[(' ', '')])(self))
if not active_card or len(page.doc.xpath(xpath)) != 1:
if not active_card and len(page.doc.xpath(xpath)) != 1:
raise SkipItem()
self.env['id'] = active_card or CleanText('%s[1]/td[2]' % xpath, replace=[(' ', '')])(page.doc)
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