From ee9356a1af907f96aeddec8900d8151ce9991521 Mon Sep 17 00:00:00 2001 From: Etienne Lachere Date: Thu, 3 Oct 2019 09:43:45 -0400 Subject: [PATCH] [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 --- modules/bforbank/pages.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/bforbank/pages.py b/modules/bforbank/pages.py index 4ce16ce985..e4dbc4bbd7 100644 --- a/modules/bforbank/pages.py +++ b/modules/bforbank/pages.py @@ -301,11 +301,13 @@ def obj_date(self): 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.' + -- GitLab