From e0fcfcd25d6e5209609c56189e813e7063a89bd8 Mon Sep 17 00:00:00 2001 From: Guillaume Risbourg Date: Mon, 28 Sep 2020 10:42:29 +0200 Subject: [PATCH] [boursorama] Handle error message on new transfers page When no account can emit transfers, we have an error message where we expected a form and the list of account. --- modules/boursorama/pages.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/boursorama/pages.py b/modules/boursorama/pages.py index 034588d09d..63c6a09061 100644 --- a/modules/boursorama/pages.py +++ b/modules/boursorama/pages.py @@ -1322,6 +1322,12 @@ def obj_enabled_at(self): class NewTransferAccounts(LoggedPage, HTMLPage): def submit_account(self, account_id): + no_account_msg = CleanText('//div[contains(@class, "alert--warning")]')(self.doc) + if 'Vous ne possédez pas de compte éligible au virement' in no_account_msg: + raise AccountNotFound() + elif no_account_msg: + raise AssertionError('Unhandled error message : "%s"' % no_account_msg) + form = self.get_form() debit_account = CleanText( '//input[./following-sibling::div/span/span[contains(text(), "%s")]]/@value' % account_id -- GitLab