From cb70565d3b114e264af24c7b7a9c6d9059f20edd Mon Sep 17 00:00:00 2001 From: Jerome Berthier Date: Mon, 8 Apr 2019 19:13:01 +0200 Subject: [PATCH] [caissedepargne] netpro, handle a different website behavior with more then 2 accounts When there are several accounts but only one is a checking and other are loans, the website does not display the account selection box. --- modules/caissedepargne/pages.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index b1c11113f8..3d903a156e 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -591,9 +591,12 @@ def go_loan_list(self): def is_history_of(self, account_id): """ - Check whether the displayed history is for the correct account + Check whether the displayed history is for the correct account. + If we do not find the select box we consider we are on the expected account (like it was before this check) """ - return bool(self.doc.xpath('//option[@value="%s" and @selected]' % account_id)) + if self.doc.xpath('//select[@id="MM_HISTORIQUE_COMPTE_m_ExDropDownList"]'): + return bool(self.doc.xpath('//option[@value="%s" and @selected]' % account_id)) + return True def go_history(self, info, is_cbtab=False): form = self.get_form(id='main') -- GitLab