Commit ee9356a1 authored by Etienne Lachere's avatar Etienne Lachere Committed by ntome

[bforbank] handle empty card page

Handle a case where the card page is just empty, with no message
saying there is no card attached to this account.

Closes: 17749@zendesk
Closes: 45503@sibi
parent 23ccf4c6
......@@ -301,11 +301,13 @@ class CardHistoryPage(LoggedPage, HTMLPage):
class CardPage(LoggedPage, HTMLPage):
def has_no_card(self):
# Persistent message for cardless accounts
return CleanText('//div[@id="alert"]/p[contains(text(), "Aucune donnée n\'a été retournée par le service")]')(self.doc)
return (
CleanText('//div[@id="alert"]/p[contains(text(), "Aucune donnée n\'a été retournée par le service")]')(self.doc)
or not self.doc.xpath('//div[@class="content-boxed"]')
)
def get_cards(self, account_id):
divs = self.doc.xpath('//div[@class="content-boxed"]')
assert len(divs)
msgs = re.compile(
'Vous avez fait opposition sur cette carte bancaire.' +
'|Votre carte bancaire a été envoyée.' +
......
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