Commit 470cc3d6b8330cc6903a999a8a1063bdb3d8e430

Authored by ivanka12
1 parent 9be4a528

update auction_full

@@ -321,6 +321,9 @@ Library Selenium2Library @@ -321,6 +321,9 @@ Library Selenium2Library
321 Поставити максимально можливу ставку 321 Поставити максимально можливу ставку
322 Wait Until Page Contains Element id=max_bid_amount_price 322 Wait Until Page Contains Element id=max_bid_amount_price
323 ${last_amount}= Get Text id=max_bid_amount_price 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 Поставити ставку ${last_amount} Заявку прийнято 327 Поставити ставку ${last_amount} Заявку прийнято
325 328
326 329
@@ -373,4 +376,5 @@ Library Selenium2Library @@ -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,8 +39,13 @@ def create_fake_title():
39 def create_fake_date(): 39 def create_fake_date():
40 return get_now().isoformat() 40 return get_now().isoformat()
41 41
  42 +
42 def subtraction(value1, value2): 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 def create_fake_value_amount(): 50 def create_fake_value_amount():
46 return fake.random_int(min=1) 51 return fake.random_int(min=1)
@@ -57,6 +62,10 @@ def translate_country_en(country): @@ -57,6 +62,10 @@ def translate_country_en(country):
57 raise Exception(u"Cannot translate country to english: {}".format(country)) 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 def translate_country_ru(country): 69 def translate_country_ru(country):
61 if country == u"Україна": 70 if country == u"Україна":
62 return u"Украина" 71 return u"Украина"
@@ -50,6 +50,7 @@ from .initial_data import ( @@ -50,6 +50,7 @@ from .initial_data import (
50 create_fake_title, 50 create_fake_title,
51 create_fake_value_amount, 51 create_fake_value_amount,
52 test_change_document_data, 52 test_change_document_data,
  53 + convert_amount,
53 ) 54 )
54 from barbecue import chef 55 from barbecue import chef
55 from restkit import request 56 from restkit import request
Please register or login to post a comment