Skip to content

Commit

Permalink
Merge c83d3f1 into 3903cf7
Browse files Browse the repository at this point in the history
  • Loading branch information
OrysiaDrabych committed Apr 12, 2019
2 parents 3903cf7 + c83d3f1 commit 5382d49
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions openprocurement/auction/insider/tests/functional/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from dateutil.tz import tzlocal
from pkg_resources import iter_entry_points
from gevent.subprocess import check_output, sleep
from uuid import uuid4

from openprocurement.auction.tests.main import update_auctionPeriod

Expand All @@ -22,12 +23,11 @@


def run_insider(tender_file_path):
with open(tender_file_path) as _file:
auction_id = json.load(_file).get('data', {}).get('id')
if auction_id:
with update_auctionPeriod(tender_file_path, auction_type='simple') as auction_file:
check_output(TESTS['insider']['worker_cmd'].format(CWD, auction_id, auction_file).split())
auction_id = uuid4().hex
with update_auctionPeriod(tender_file_path, auction_type='simple') as auction_file:
check_output(TESTS['insider']['worker_cmd'].format(CWD, auction_id, auction_file).split())
sleep(30)
return auction_id


TESTS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ ${BROWSER} chrome
Перевірити інформацію з меню

Долучитись до аукціону глядачем
Open Browser http://localhost:8090/insider-auctions/11111111111111111111111111111111 ${BROWSER}
${auctionId}= Get Variable Value ${auction_id}
Open Browser http://localhost:8090/insider-auctions/${auctionId} ${BROWSER}
Set Window Position ${0} ${0}
Set Window Size ${300} ${1200}
Wait Until Page Contains Ви спостерігач і не можете робити ставки
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ def prepare_users_data(tender_data):
with open(auction_worker_defaults) as auction_worker_defaults_file:
auction_worker_defaults_info = yaml.load(auction_worker_defaults_file)
users_data = {}
auction_id = BuiltIn().get_variable_value("${auction_id}")
for index, bid in enumerate(tender_data["bids"]):
signer = Signer(auction_worker_defaults_info["SIGNATURE_KEY"].decode('hex'))
signature = quote(b64encode(signer.signature("{}_{}".format("11111111111111111111111111111111", str(bid['id'])))))
signature = quote(b64encode(signer.signature("{}_{}".format(auction_id, str(bid['id'])))))
users_data[bid["id"]] = {
'login_url': auction_worker_defaults_info['AUCTIONS_URL'].format(auction_id="11111111111111111111111111111111") + '/login?bidder_id={}&signature={}'.format(
'login_url': auction_worker_defaults_info['AUCTIONS_URL'].format(auction_id=auction_id) + '/login?bidder_id={}&signature={}'.format(
bid["id"], signature
),
'amount': bid.get('value', {}).get('amount', ''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ${sealedbid_amount} xpath=(//div[contains(concat(' ', normalize-space(@class),
Set Global Variable ${step_amount}
${invalid_amount}= Evaluate ${step_amount}-1
Поставити ставку ${invalid_amount} Ваша ставка повинна перевищувати ставку переможця попередньої стадії як мінімум на 1 крок (1% від початкової вартості) ${sealedbid_amount}
Click Element id=clear-bid-button

Поставити ставку
[Arguments] ${step} ${msg} ${locator}
Expand All @@ -52,7 +53,7 @@ ${sealedbid_amount} xpath=(//div[contains(concat(' ', normalize-space(@class),
${last_amount}= convert_amount_to_number ${last_amount}
${amount}= Evaluate ${last_amount}+${step}
${input_amount}= Convert To String ${amount}
Input Text id=bid-amount-input ${input_amount}
Input Text name=bid ${input_amount}
sleep 1s
Capture Page Screenshot
Highlight Elements With Text On Time Зробити ставку
Expand All @@ -64,7 +65,7 @@ ${sealedbid_amount} xpath=(//div[contains(concat(' ', normalize-space(@class),
Wait Until Page Contains Element id=edit-bid-button
Highlight Element id=edit-bid-button
Click Element id=edit-bid-button
Input Text id=bid-amount-input 1
Input Text name=bid 1
Capture Page Screenshot
Click Element id=clear-bid-button
Capture Page Screenshot
Expand Down

0 comments on commit 5382d49

Please sign in to comment.