Commit 72ad203a authored by Vladyslav Koval's avatar Vladyslav Koval
Browse files

Add Tests for 1. Links to Auction Module

Check the public and private links to auction module
parent 3ae0be8b
Pipeline #20083 passed with stages
in 39 minutes and 59 seconds
init_bid = {
"bidders": [
{
"identifier": {
"id": "90809977",
"scheme": "UA-EDR",
"legalName": {
"uk_UA": "string"
}
},
"address": {
"streetAddress": {
"uk_UA": "string"
},
"locality": {
"uk_UA": "string"
},
"region": {
"uk_UA": "Харківська область"
},
"postalCode": "string",
"countryName": {
"uk_UA": "string"
}
},
"contactPoint": {
"name": {
"uk_UA": "string"
},
"email": "user@example.com",
"faxNumber": "+380572681111",
"telephone": "+380230102006",
"url": "http://string.com"
}
}
]
}
\ No newline at end of file
from Envirment import AUCTION_TOKEN, BIDDER_TOKEN, WATCHER, amount, minimalStep
init_auction = {
"sellingMethod": "subsoil-dutch-fast",
"auctionPeriod": {
"startDate": "2021-10-30"
},
"title": {
"uk_UA": "Аукціон з продажу надр",
"en_US": "Nadra uaction"
},
"description": {
"uk_UA": "Аукціон з продажу надр",
"en_US": "Nadra uaction"
},
"accessDetails": {
"uk_UA": "Порядок та можливий час ознайомлення з лотом",
"en_US": "Auction access details"
},
"sellingEntity": {
"identifier": {
"id": "38960413",
"scheme": "UA-EDR",
"legalName": {
"uk_UA": "ЕДРПОУ",
"en_US": "EDRPOU"
}
},
"address": {
"streetAddress": {
"uk_UA": "Хрещатик, 43a",
"en_US": "Khreschatyk, 43a"
},
"locality": {
"uk_UA": "Київ",
"en_US": "Kyiv"
},
"region": {
"uk_UA": "Київ",
"en_US": "Kyiv"
},
"postalCode": "01001",
"countryName": {
"uk_UA": "Україна",
"en_US": "Ukraine"
}
},
"contactPoint": {
"name": {
"uk_UA": "Адміністратор",
"en_US": "Admin"
},
"telephone": "+380123456789",
"faxNumber": "+380123456789",
"email": "admin@example.com"
}
},
"x_documentRequirements": {
"uk_UA": "Вимоги до оформлення документів",
"en_US": "Document requirements"
},
"value": {
"currency": "UAH",
"amount": 1000
},
"guarantee": {
"currency": "UAH",
"amount": 1
},
"minimalStep": {
"valueAddedTaxIncluded": True
},
"discount": {
"discount": False
},
"previousAuctionId": "UA-PS-1999-12-12-000000-0",
"tenderAttempts": 2,
"items": [
{
"description": {
"uk_UA": "Чорнозем",
"en_US": "Black soil"
},
"classification": {
"scheme": "CAV",
"id": "09300000-2"
},
"additionalClassifications": [
{
"scheme": "subsoilUsageType",
"id": "01"
},
{
"scheme": "subsoilUsageType",
"id": "01"
}
],
"unit": {
"code": "H87"
},
"quantity": 900,
"address": {
"streetAddress": {
"uk_UA": "Хрещатик, 43a",
"en_US": "Khreschatyk, 43a"
},
"locality": {
"uk_UA": "Київ",
"en_US": "Kyiv"
},
"region": {
"uk_UA": "Київ",
"en_US": "Kyiv"
},
"postalCode": "01001",
"countryName": {
"uk_UA": "Україна",
"en_US": "Ukraine"
}
}
}
],
"dutchStep": {
"dutchStepQuantity": 99
}
}
*** Settings ***
Documentation 1. Формування посилань на модуль аукціону
... Відсутність поданих заяв на участь протягом tenderPeriod
... https://confluence-sale.prozorro.org/pages/viewpage.action?pageId=63276306#id-ТестуванняМАDutch-CBD3-DU-MA-UC-01-01
Resource ../fixtures/Resources/auction_conditions.robot
Test Setup Check For Pass Before
Suite Teardown Close All Browsers
*** Variables ***
${AUCTION_NAME} subsoil-dutch-fast
*** Test Cases ***
Відсутність поданих заяв на участь протягом tenderPeriod
${ACTION_START_TIME}= Get Time format=timestamp time_=UTC +5m
Create Session alias %{PROCEDURE_URL} verify=true
&{headers_post} = Create Dictionary Authorization=auction_token Content-Type=application/json
Import Variables ../fixtures/${AUCTION_NAME}.py init_auction
Set To Dictionary ${init_auction["auctionPeriod"]} startDate ${ACTION_START_TIME}
${RESP} = POST On Session alias /api/procedures json=${init_auction} headers=${HEADERS_POST} expected_status=201
${ID} = Get From Dictionary ${resp.json()} id
Sleep 5m 30s
${RESP} = Get Request and return resp By ${ID} ${WATCHER}
Status Should Be 200 ${RESP}
${STATUS} = Get From Dictionary ${resp.json()} status
Should Be Equal active_auction ${STATUS}
${AUCTION_URL} = Get From Dictionary ${resp.json()} auctionUrl
Should Contain ${AUCTION_URL} %{AUCTION_URL}
*** Settings ***
Documentation 1. Формування посилань на модуль аукціону
... Одна подана заява на участь протягом tenderPeriod (до старту Голландського етапу
... https://confluence-sale.prozorro.org/pages/viewpage.action?pageId=63276306#id-ТестуванняМАDutch-CBD3-DU-MA-UC-01-02
Resource ../fixtures/Resources/auction_conditions.robot
Test Setup Check For Pass Before
Suite Teardown Close All Browsers
*** Variables ***
${AUCTION_NAME} subsoil-dutch-fast
*** Test Cases ***
Подати одну заяву на участь протягом tenderPeriod до старту Голландського раунду.
${ACTION_START_TIME} = Get Time format=timestamp time_=UTC +5m
Create Session alias %{PROCEDURE_URL} verify=true
&{headers_post} = Create Dictionary Authorization=auction_token Content-Type=application/json
Import Variables ../fixtures/${AUCTION_NAME}.py init_auction
Import Variables ../fixtures/subsoil-dutch-fast-bid.py init_bid
Set To Dictionary ${init_auction["auctionPeriod"]} startDate ${ACTION_START_TIME}
${RESP} = POST On Session alias /api/procedures json=${init_auction} headers=${HEADERS_POST} expected_status=201
${ID} = Get From Dictionary ${resp.json()} id
Set Suite Variable ${ID} ${ID}
${RESP}= Get Request and return resp By ${ID} ${WATCHER}
Status Should Be 200 ${RESP}
Sleep 2m 10s Waiting for active_tendering
${RESP}= Get Request and return resp By ${ID} ${WATCHER}
Status Should Be 200 ${RESP}
${STATUS} = Get From Dictionary ${resp.json()} status
Should Be Equal active_tendering ${STATUS}
${RESP} = POST On Session alias /api/procedures/${ID}/bids json=${init_bid} headers=${HEADERS_POST} expected_status=201
Status Should Be 201 ${RESP}
${BID_ID} = Get From Dictionary ${resp.json()} id
Set Suite Variable ${BID_ID} ${BID_ID}
${BID_ACC_TOKEN} = Get From Dictionary ${resp.json()} acc_token
Set Suite Variable ${BID_ACC_TOKEN} ${BID_ACC_TOKEN}
${RESP} = PATCH On Session alias /api/procedures/${ID}/bids/${BID_ID}/status data={"status":"active"} headers=${HEADERS_POST} params=acc_token=${BID_ACC_TOKEN}
Status Should Be 200 ${RESP}
Перевірити формування в ЦБД приватного посилання для участі в модулі аукціону при переходi в active_auction
Sleep 3m 10s Waiting for active_auction
${RESP} = Get Request and return resp By ${ID} ${BID_ACC_TOKEN}
Status Should Be 200 ${RESP}
${ACTIVE_STATUS} = Get From Dictionary ${resp.json()} status
Should Be Equal active_auction ${ACTIVE_STATUS}
${AUCTION_URL} = Get From Dictionary ${resp.json()} auctionUrl
Should Contain ${AUCTION_URL} %{AUCTION_URL}
${BIDDER_URL} = Get Request and return participationUrl By ${ID} ${BID_ACC_TOKEN}
Should Contain ${BIDDER_URL} %{PROCEDURE_URL}
\ No newline at end of file
*** Settings ***
Documentation 1. Формування посилань на модуль аукціону
... Одна подана заява на участь протягом tenderPeriod (під час Голландського етапу)
... https://confluence-sale.prozorro.org/pages/viewpage.action?pageId=63276306#id-ТестуванняМАDutch-CBD3-DU-MA-UC-01-03
Resource ../fixtures/Resources/auction_conditions.robot
Test Setup Check For Pass Before
Suite Teardown Close All Browsers
*** Variables ***
${AUCTION_NAME} subsoil-dutch-initial-auction
*** Test Cases ***
Перевірити формування в ЦБД публічного посилання для спостерігання за модулем аукціону.
${ACTION_START_TIME}= Get Time format=timestamp time_=UTC +5m
Create Session alias %{PROCEDURE_URL} verify=true
&{headers_post} = Create Dictionary Authorization=auction_token Content-Type=application/json
Set Suite Variable &{HEADERS_POST} &{headers_post}
Import Variables ../fixtures/${AUCTION_NAME}.py init_auction
Import Variables ../fixtures/subsoil-dutch-fast-bid.py init_bid
Set To Dictionary ${init_auction["auctionPeriod"]} startDate ${ACTION_START_TIME}
${RESP} = POST On Session alias /api/procedures json=${init_auction} headers=${HEADERS_POST} expected_status=201
${ID} = Get From Dictionary ${resp.json()} id
Set Suite Variable ${ID} ${ID}
Sleep 5m 20s Waiting for active_auction
${RESP} = Get Request and return resp By ${ID} ${WATCHER}
Status Should Be 200 ${RESP}
${STATUS} = Get From Dictionary ${resp.json()} status
Should Be Equal active_auction ${STATUS}
${AUCTION_URL} = Get From Dictionary ${resp.json()} auctionUrl
Set Suite Variable \${AUCTION_URL}
${AUCTION_ID} = Get From Dictionary ${resp.json()} auctionId
Set Suite Variable \${AUCTION_ID}
Подати одну заяву на участь протягом tenderPeriod під час Голландського раунду.
Open Browser Maximized ${AUCTION_URL}
Wait Until Page Contains Element //li[@class='stages-item is-disabled']
${RESP} = POST On Session alias /api/procedures/${ID}/bids json=${init_bid} headers=${HEADERS_POST} expected_status=201
Status Should Be 201 ${RESP}
${BID_ID} = Get From Dictionary ${resp.json()} id
Set Suite Variable ${BID_ID} ${BID_ID}
${BID_ACC_TOKEN} = Get From Dictionary ${resp.json()} acc_token
Set Suite Variable ${BID_ACC_TOKEN} ${BID_ACC_TOKEN}
${RESP} = PATCH On Session alias /api/procedures/${ID}/bids/${BID_ID}/status data={"status":"active"} headers=${HEADERS_POST} params=acc_token=${BID_ACC_TOKEN}
Status Should Be 200 ${RESP}
Перевірити формування в ЦБД приватного посилання для участі в модулі аукціону.
Open Browser Maximized ${AUCTION_URL} ${WATCHER}
Wait Until Page Contains Element //a[@class='header-id']
Element Should Contain //a[@class='header-id'] ${AUCTION_ID}
${BIDDER_URL} = Get Request and return participationUrl By ${ID} ${BID_ACC_TOKEN}
Open Browser Maximized ${BIDDER_URL}
Allow Terms ${BIDDER_URL}
Page Should Contain Element //div[@class='b-user-id-item' and contains(.,'ID')]
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