Commit c2ff2e6b authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[bp] update add recipient error xpath and handle message error on add recipient confirm page

Closes: 597827@redmine
parent 05526876
......@@ -186,7 +186,7 @@ class TransferSummary(LoggedPage, CheckTransferError):
class CreateRecipient(LoggedPage, MyHTMLPage):
def choose_country(self, recipient, is_bp_account):
# if this is present, we can't add recipient currently
more_security_needed = self.doc.xpath(u'//iframe[@title="Sécurité renforcée non adhérents"]')
more_security_needed = self.doc.xpath(u'//iframe[@title="Gestion de compte par Internet"]')
if more_security_needed:
raise AddRecipientError(message=u"Pour activer le service Certicode, nous vous invitons à vous rapprocher de votre Conseiller en Bureau de Poste.")
......@@ -221,6 +221,12 @@ class ValidateRecipient(LoggedPage, MyHTMLPage):
class ConfirmPage(LoggedPage, MyHTMLPage):
def on_load(self):
error_msg = CleanText('//h2[contains(text(), "Compte rendu")]/following-sibling::p')(self.doc)
if error_msg:
raise AddRecipientError(message=error_msg)
def set_browser_form(self):
form = self.get_form(name='SaisieOTP')
self.browser.recipient_form = dict((k, v) for k, v in form.items() if v)
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