Commit 8f74aa8b authored by Maxime Gasselin's avatar Maxime Gasselin Committed by Romain Bignon

[creditmutuel] Fix card navigation

With the async method, (thanks to creditmutuel website) the navigation were sometimes random to reach the good page
in order to get the card type information. Consequently some immediate cards were
still returned. Here we replace with the open method (will do step by step to reach the good page).

Closes: 8831@zendesk
parent 63ef6b95
......@@ -1865,7 +1865,6 @@ class NewCardsListPage(LoggedPage, HTMLPage):
obj_type = Account.TYPE_CARD
obj__new_space = True
obj__is_inv = False
load_details = Field('_link_id') & AsyncLoad
def obj__secondpage(self):
# Necessary to reach the good history page
......@@ -1909,8 +1908,8 @@ class NewCardsListPage(LoggedPage, HTMLPage):
def parse(self, el):
# We have to reach the good page with the information of the type of card
async_page = Async('details').loaded_page(self)
card_type_page = Link('//div/ul/li/a[contains(text(), "Fonctions")]')(async_page.doc)
history_page ='_link_id')(self)).page
card_type_page = Link('//div/ul/li/a[contains(text(), "Fonctions")]')(history_page.doc)
doc =
card_type_line = doc.xpath('//tbody/tr[th[contains(text(), "Débit des paiements")]]')
if card_type_line:
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