Showing
3 changed files
with
16 additions
and
2 deletions
... | ... | @@ -321,6 +321,9 @@ Library Selenium2Library |
321 | 321 | Поставити максимально можливу ставку |
322 | 322 | Wait Until Page Contains Element id=max_bid_amount_price |
323 | 323 | ${last_amount}= Get Text id=max_bid_amount_price |
324 | + ${last_amount}= convert_amount_string_to_float ${last_amount} | |
325 | + ${value}= Convert To Number 0.01 | |
326 | + ${last_amount}= subtraction ${last_amount} ${value} | |
324 | 327 | Поставити ставку ${last_amount} Заявку прийнято |
325 | 328 | |
326 | 329 | |
... | ... | @@ -373,4 +376,5 @@ Library Selenium2Library |
373 | 376 | |
374 | 377 | |
375 | 378 | Перевірити чи ставка була прийнята |
376 | - Page Should Contain ${USERS['${CURRENT_USER}']['last_amount']} | |
379 | + ${last_amount}= convert_amount ${USERS['${CURRENT_USER}']['last_amount']} | |
380 | + Page Should Contain ${last_amount} | ... | ... |
... | ... | @@ -39,8 +39,13 @@ def create_fake_title(): |
39 | 39 | def create_fake_date(): |
40 | 40 | return get_now().isoformat() |
41 | 41 | |
42 | + | |
42 | 43 | def subtraction(value1, value2): |
43 | - return (int(value1) - int(value2)) | |
44 | + if "." in str (value1) or "." in str (value2): | |
45 | + return (float (value1) - float (value2)) | |
46 | + else: | |
47 | + return (int (value1) - int (value2)) | |
48 | + | |
44 | 49 | |
45 | 50 | def create_fake_value_amount(): |
46 | 51 | return fake.random_int(min=1) |
... | ... | @@ -57,6 +62,10 @@ def translate_country_en(country): |
57 | 62 | raise Exception(u"Cannot translate country to english: {}".format(country)) |
58 | 63 | |
59 | 64 | |
65 | +def convert_amount(amount): | |
66 | + return (("{:,}".format(float (amount))).replace(',',' ').replace('.',',')) | |
67 | + | |
68 | + | |
60 | 69 | def translate_country_ru(country): |
61 | 70 | if country == u"Україна": |
62 | 71 | return u"Украина" | ... | ... |
Please
register
or
login
to post a comment