Commit f6309348017b9ea6d01c490b78209cd28b63836c

Authored by Taras Kozlovskyi
1 parent 332b20e4

Added auction keywords

@@ -3,10 +3,16 @@ Library op_robot_tests.tests_files.ApiCommands @@ -3,10 +3,16 @@ Library op_robot_tests.tests_files.ApiCommands
3 Library String 3 Library String
4 LIbrary Collections 4 LIbrary Collections
5 LIbrary Selenium2Library 5 LIbrary Selenium2Library
  6 +Library DebugLibrary
6 7
7 8
8 *** Keywords *** 9 *** Keywords ***
  10 +Init auction data
  11 + ${auction_data}= load_initial_data_from aucion_data.yaml
  12 + Set Global Variable ${auction_data}
  13 +
9 Create api wrapper 14 Create api wrapper
  15 + Init auction data
10 ${API}= prepare_api ${api_key} 16 ${API}= prepare_api ${api_key}
11 Set Global Variable ${API} 17 Set Global Variable ${API}
12 LOG ${API} 18 LOG ${API}
@@ -20,7 +26,7 @@ Create tender @@ -20,7 +26,7 @@ Create tender
20 ${init_tender_data}= prepare_test_tender_data 26 ${init_tender_data}= prepare_test_tender_data
21 Log object data ${init_tender_data} 27 Log object data ${init_tender_data}
22 ${tender}= Call Method ${API} create_tender ${init_tender_data} 28 ${tender}= Call Method ${API} create_tender ${init_tender_data}
23 - Log object data ${tender} 29 + Log object data ${tender} tender_creater
24 ${access_token}= Get Variable Value ${tender.access.token} 30 ${access_token}= Get Variable Value ${tender.access.token}
25 Set Global Variable ${access_token} 31 Set Global Variable ${access_token}
26 ${tender_id}= Get Variable Value ${tender.data.id} 32 ${tender_id}= Get Variable Value ${tender.data.id}
@@ -42,7 +48,7 @@ Change tender title @@ -42,7 +48,7 @@ Change tender title
42 Log object data ${tender} 48 Log object data ${tender}
43 ${tender}= Call Method ${API} patch_tender ${tender} 49 ${tender}= Call Method ${API} patch_tender ${tender}
44 Set Global Variable ${tender} 50 Set Global Variable ${tender}
45 - Log object data ${tender} 51 + Log object data ${tender} tender_changed_titles
46 Set access key on tender 52 Set access key on tender
47 53
48 Change tender periods 54 Change tender periods
@@ -51,7 +57,7 @@ Change tender periods @@ -51,7 +57,7 @@ Change tender periods
51 Log object data ${tender} 57 Log object data ${tender}
52 ${tender}= Call Method ${API} patch_tender ${tender} 58 ${tender}= Call Method ${API} patch_tender ${tender}
53 Set Global Variable ${tender} 59 Set Global Variable ${tender}
54 - Log object data ${tender} 60 + Log object data ${tender} tender_changed_periods
55 Set access key on tender 61 Set access key on tender
56 62
57 Upload tender documentation 63 Upload tender documentation
@@ -62,7 +68,7 @@ Create question @@ -62,7 +68,7 @@ Create question
62 ${question}= test question data 68 ${question}= test question data
63 Log object data ${question} 69 Log object data ${question}
64 ${question}= Call Method ${API} create_question ${tender} ${question} 70 ${question}= Call Method ${API} create_question ${tender} ${question}
65 - Log object data ${question} 71 + Log object data ${question} question_created
66 [return] ${question} 72 [return] ${question}
67 73
68 74
@@ -91,29 +97,33 @@ Review tender @@ -91,29 +97,33 @@ Review tender
91 Log object data ${tender} 97 Log object data ${tender}
92 Set access key on tender 98 Set access key on tender
93 99
94 -Wait to TenderPeriod  
95 - Sleep 2 minutes 10 seconds Wait on TenderPeriod status 100 +Wait to tender period with name ${period_name}
  101 + log ${tender.data.${period_name}.startDate}
  102 + ${wait_seconds}= calculate wait to date ${tender.data.${period_name}.startDate}
  103 + Sleep ${wait_seconds} Wait on ${period_name}
  104 + Review tender
96 105
97 -Wait to start of auction's worker 106 +Wait to start of auction's worker
98 Sleep 4 minutes 107 Sleep 4 minutes
99 108
100 Submit bids 109 Submit bids
101 - ${bids} = Create Dictionary  
102 - Log object data ${bids}  
103 - :FOR ${index} IN RANGE 2 110 + Review tender
  111 + Log object data ${tender} tender_before_submit_bids
  112 + ${bids_items}= Get Dictionary Items ${auction_data.bidders}
  113 + :FOR ${bidder_key} ${bidder_data} IN @{bids_items}
104 \ ${bid}= test bid data 114 \ ${bid}= test bid data
105 - \ Log object data ${bid}  
106 - \ ${temp_amount}= Evaluate ${bid['data']['value']['amount']} - ${index} 115 + \ Log object data ${bid}
  116 + \ ${temp_amount}= Get Variable Value ${auction_data.bidders.${bidder_key}.start_bid}
107 \ Log ${temp_amount} 117 \ Log ${temp_amount}
108 \ ${bid.data.value.amount}= Get Variable Value ${temp_amount} 118 \ ${bid.data.value.amount}= Get Variable Value ${temp_amount}
109 - \ ${bids_data}= Submit bid with data ${bid}  
110 - \ Set To Dictionary ${bids} ${index} ${bids_data}  
111 - Set Global Variable ${bids}  
112 - Log object data ${bids} 119 + \ ${bids_data}= Submit in tender bid with data ${bid}
  120 + \ Set To Dictionary ${auction_data.bidders.${bidder_key}} tender_bid_data ${bids_data}
  121 + Log object data ${auction_data} auction_data_after_submit_bids
  122 + Set Global Variable ${auction_data}
113 123
114 124
115 125
116 -Submit bid with data 126 +Submit in tender bid with data
117 [Arguments] ${bid} 127 [Arguments] ${bid}
118 ${bid_data}= Call Method ${API} create_bid ${tender} ${bid} 128 ${bid_data}= Call Method ${API} create_bid ${tender} ${bid}
119 Log object data ${bid_data} 129 Log object data ${bid_data}
@@ -121,21 +131,96 @@ Submit bid with data @@ -121,21 +131,96 @@ Submit bid with data
121 131
122 132
123 Get particular urls for bids 133 Get particular urls for bids
124 - ${bids_items}= Get Dictionary Items ${bids}  
125 - :FOR ${index} ${bid} IN @{bids_items}  
126 - \ ${approved_bid}= Call Method ${API} get_bid ${tender} ${bid.data.id} ${bid.access.token} 134 + ${bids_items}= Get Dictionary Items ${auction_data.bidders}
  135 + :FOR ${bidder_key} ${bidder_data} IN @{bids_items}
  136 + \ ${approved_bid}= Call Method ${API} get_bid ${tender} ${bidder_data.tender_bid_data.data.id} ${bidder_data.tender_bid_data.access.token}
127 \ Log object data ${approved_bid} 137 \ Log object data ${approved_bid}
128 - \ Log ${approved_bid.data.participationUrl} 138 + \ Log ${approved_bid.data.participationUrl}
  139 + \ Set To Dictionary ${auction_data.bidders.${bidder_key}} start_url ${approved_bid.data.participationUrl}
  140 + Log object data ${auction_data} auction_data_after_get_particular_urls
  141 + Set Global Variable ${auction_data}
  142 +
  143 +
  144 +Get auction url for observer
  145 + Review tender
  146 + Set To Dictionary ${auction_data.observer} start_url ${tender.data.auctionUrl}
  147 + Log object data ${auction_data} auction_data_after_add_auction_url
  148 + Set Global Variable ${auction_data}
129 149
130 150
131 Wait to end of auction 151 Wait to end of auction
132 - Sleep 45 minutes Wait to end of auction 152 + Sleep 1 minutes Wait to end of auction
133 153
134 154
135 Activate award 155 Activate award
  156 + Review tender
  157 + Log object data ${tender} tender_after_add_auction
136 ${awards}= Call Method ${API} get_awards ${tender} 158 ${awards}= Call Method ${API} get_awards ${tender}
137 - Log object data ${awards} 159 + Log object data ${awards} awards
138 ${award_approve}= create_approve_award_request_data ${awards.data[0].id} 160 ${award_approve}= create_approve_award_request_data ${awards.data[0].id}
139 Log object data ${award_approve} 161 Log object data ${award_approve}
140 ${approved_award}= Call Method ${API} patch_award ${tender} ${award_approve} 162 ${approved_award}= Call Method ${API} patch_award ${tender} ${award_approve}
141 - Log object data ${approved_award} 163 + Log object data ${approved_award} award_approved
  164 +
  165 +
  166 +Game process begin
  167 + Open Browser To bidder0 Login Page
  168 + Open Browser To bidder1 Login Page
  169 + Open Browser as observer
  170 + Auction is on round 1
  171 + bidder1 leaves bid 40000
  172 + Capture Page Screenshot
  173 + bidder0 leaves bid 39000
  174 + Capture Page Screenshot
  175 + Auction is finished
  176 + Capture Page Screenshot
  177 +
  178 +Open Browser To ${bidder} Login Page
  179 + Open Browser ${auction_data.bidders.${bidder}.start_url} ${auction_data.bidders.${bidder}.browser} ${bidder}
  180 + Maximize Browser Window
  181 + Oauth Confirm Page Should Be Open
  182 + ${bidder} agree with rules
  183 + Sleep 2
  184 + Capture Page Screenshot
  185 +
  186 +
  187 +Open Browser as observer
  188 + Open Browser ${auction_data.observer.start_url} ${auction_data.observer.browser} observer
  189 + Maximize Browser Window
  190 + Capture Page Screenshot
  191 +
  192 +Oauth Confirm Page Should Be Open
  193 + Title Should Be Authorization
  194 + Capture Page Screenshot
  195 +
  196 +${bidder} agree with rules
  197 + Click Element css=.btn.btn-success
  198 + Wait Until Page Contains ${tender.data.tenderID} 20
  199 + Capture Page Screenshot
  200 +
  201 +
  202 +submit bid ${amount} on auction
  203 + Wait Until Page Contains до закінчення вашої черги 600
  204 + Input Text xpath = //input[@id="bid"] ${amount}
  205 + Click Button xpath = //button[@class="btn btn-success ng-scope"]
  206 + Wait Until Page Contains Заявку прийнято 10
  207 + Page Should Not Contain Надто висока заявка
  208 +
  209 +${bidder} leaves bid ${amount}
  210 + Switch Browser ${bidder}
  211 + submit bid ${amount} on auction
  212 +
  213 +
  214 +Auction is finished
  215 + Wait Until Page Contains Аукціон завершився 600
  216 + ${value} = Get Text xpath= //p[@class="round-number ng-scope"]
  217 + Should Be Equal ${value} Завершено
  218 + Capture Page Screenshot
  219 +
  220 +Auction is on round ${value3}
  221 + Wait Until Page Contains до закінчення раунду 1200
  222 + ${round} = Get Text xpath = //p[@class="round-label ng-scope"]
  223 + ${number} = Get Text xpath = //p[@class="round-number ng-binding"]
  224 + Should Be Equal ${round} Раунд
  225 + Should Be Equal ${number} ${value3}
  226 + Capture Page Screenshot
Please register or login to post a comment