Fix low balance listing

When the balance is low, the span class is "low-balance" and not
balance. Use 'contain' to be more robust
This commit is contained in:
Florent 2015-03-19 22:29:54 +01:00
commit 31f206e697

View file

@ -57,7 +57,7 @@ class HomePage(LoggedPage, HTMLPage):
klass = Subscription klass = Subscription
obj_id = CleanText('//span[@class="welcome-text"]/b') obj_id = CleanText('//span[@class="welcome-text"]/b')
obj__balance = CleanDecimal(CleanText('//span[@class="balance"]'), replace_dots=False) obj__balance = CleanDecimal(CleanText('//span[contains(@class, "balance")]'), replace_dots=False)
obj_label = Format(u"Poivy - %s - %s", Field('id'), Field('_balance')) obj_label = Format(u"Poivy - %s - %s", Field('id'), Field('_balance'))