Commit 28832b9cb53a8268aa585ce9022fb459575f5df9

Authored by mykhaly
1 parent ae96a02e

Made code look nicer: openprocurement_client.robot

1 1 *** Settings ***
2 2 Library openprocurement_client_helper.py
3 3
  4 +
4 5 *** Keywords ***
5 6 Отримати internal id по UAid
6 7 [Arguments] @{ARGUMENTS}
... ... @@ -19,6 +20,7 @@ Library openprocurement_client_helper.py
19 20 Dictionary Should Contain Key ${ID_MAP} ${ARGUMENTS[1]}
20 21 Run Keyword And Return Get From Dictionary ${ID_MAP} ${ARGUMENTS[1]}
21 22
  23 +
22 24 Підготувати клієнт для користувача
23 25 [Arguments] @{ARGUMENTS}
24 26 [Documentation] Відкрити браузер, створити об’єкт api wrapper, тощо
... ... @@ -28,10 +30,12 @@ Library openprocurement_client_helper.py
28 30 Set Suite Variable ${ID_MAP}
29 31 Log Variables
30 32
  33 +
31 34 Підготувати дані для оголошення тендера
32 35 ${INITIAL_TENDER_DATA}= prepare_test_tender_data
33 36 [return] ${INITIAL_TENDER_DATA}
34 37
  38 +
35 39 Створити тендер
36 40 [Arguments] @{ARGUMENTS}
37 41 ${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_tender ${ARGUMENTS[1]}
... ... @@ -44,6 +48,7 @@ Library openprocurement_client_helper.py
44 48 Log ${USERS.users['${ARGUMENTS[0]}'].TENDER_DATA}
45 49 [return] ${TENDER_DATA.data.tenderID}
46 50
  51 +
47 52 Пошук тендера по ідентифікатору
48 53 [Arguments] @{ARGUMENTS}
49 54 [Documentation]
... ... @@ -54,12 +59,15 @@ Library openprocurement_client_helper.py
54 59 Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} tender_data ${tender_data}
55 60 [return] ${tender_data}
56 61
  62 +
57 63 Оновити сторінку з тендером
58 64 [Arguments] @{ARGUMENTS}
59 65 [Documentation]
60 66 ... ${ARGUMENTS[0]} == username
61 67 ... ${ARGUMENTS[1]} == tenderId
62   - openprocurement_client.Пошук тендера по ідентифікатору @{ARGUMENTS}
  68 + ${tender_data}= openprocurement_client.Пошук тендера по ідентифікатору @{ARGUMENTS}
  69 + Log ${tender_data}
  70 +
63 71
64 72 Отримати інформацію із тендера
65 73 [Arguments] @{ARGUMENTS}
... ... @@ -71,6 +79,7 @@ Library openprocurement_client_helper.py
71 79 Log ${field_value}
72 80 [return] ${field_value}
73 81
  82 +
74 83 Внести зміни в тендер
75 84 [Arguments] @{ARGUMENTS}
76 85 [Documentation]
... ... @@ -85,6 +94,7 @@ Library openprocurement_client_helper.py
85 94 ${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_tender ${TENDER_DATA}
86 95 Set Global Variable ${TENDER_DATA}
87 96
  97 +
88 98 Отримати тендер
89 99 [Arguments] @{ARGUMENTS}
90 100 [Documentation]
... ... @@ -95,6 +105,7 @@ Library openprocurement_client_helper.py
95 105 ${TENDER_DATA}= set_access_key ${TENDER_DATA} ${USERS.users['${ARGUMENTS[0]}'].access_token}
96 106 Set Global Variable ${TENDER_DATA}
97 107
  108 +
98 109 Відняти предмети закупівлі
99 110 [Arguments] @{ARGUMENTS}
100 111 [Documentation]
... ... @@ -112,6 +123,7 @@ Library openprocurement_client_helper.py
112 123 ${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_tender ${TENDER_DATA}
113 124 ${TENDER_DATA}= set_access_key ${TENDER_DATA} ${USERS.users['${ARGUMENTS[0]}'].access_token}
114 125
  126 +
115 127 Додати предмети закупівлі
116 128 [Arguments] @{ARGUMENTS}
117 129 [Documentation]
... ... @@ -130,19 +142,21 @@ Library openprocurement_client_helper.py
130 142 ${TENDER_DATA}= set_access_key ${TENDER_DATA} ${USERS.users['${ARGUMENTS[0]}'].access_token}
131 143 ${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_tender ${TENDER_DATA}
132 144
  145 +
133 146 Задати питання
134 147 [Documentation]
135 148 ... ${ARGUMENTS[0]} == username
136 149 ... ${ARGUMENTS[1]} == tender_uid
137 150 ... ${ARGUMENTS[2]} == question
138 151 [Arguments] @{ARGUMENTS}
139   - log many @{ARGUMENTS}
  152 + Log many @{ARGUMENTS}
140 153 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
141 154 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
142   - log ${USERS.users['${ARGUMENTS[0]}']}
  155 + Log ${USERS.users['${ARGUMENTS[0]}']}
143 156 ${biddingresponse}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_question ${tender} ${ARGUMENTS[2]}
144 157 [return] ${biddingresponse}
145 158
  159 +
146 160 Відповісти на питання
147 161 [Documentation]
148 162 ... ${ARGUMENTS[0]} == username
... ... @@ -150,23 +164,24 @@ Library openprocurement_client_helper.py
150 164 ... ${ARGUMENTS[2]} == question_id
151 165 ... ${ARGUMENTS[3]} == answer_data
152 166 [Arguments] @{ARGUMENTS}
153   - log many @{ARGUMENTS}
  167 + Log many @{ARGUMENTS}
154 168 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
155 169 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
156   - log many ${USERS.users['${ARGUMENTS[0]}']}
  170 + Log many ${USERS.users['${ARGUMENTS[0]}']}
157 171 ${tender}= set_access_key ${tender} ${USERS.users['${ARGUMENTS[0]}'].access_token}
158 172 ${ARGUMENTS[3].data.id}= Set Variable ${tender.data.questions[${ARGUMENTS[2]}].id}
159 173 ${question_with_answer}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_question ${tender} ${ARGUMENTS[3]}
160   - log many ${USERS.users['${ARGUMENTS[0]}'].client} ${tender} ${ARGUMENTS[3]}
  174 + Log many ${USERS.users['${ARGUMENTS[0]}'].client} ${tender} ${ARGUMENTS[3]}
161 175 Log object data ${question_with_answer} question_with_answer
162 176
  177 +
163 178 Подати скаргу
164 179 [Documentation]
165 180 ... ${ARGUMENTS[0]} == username
166 181 ... ${ARGUMENTS[1]} == tender_uid
167 182 ... ${ARGUMENTS[2]} == complaint
168 183 [Arguments] @{ARGUMENTS}
169   - log many @{ARGUMENTS}
  184 + Log many @{ARGUMENTS}
170 185 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
171 186 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
172 187 ${complaint}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} _create_tender_resource_item ${tender} ${ARGUMENTS[2]} complaints
... ... @@ -174,23 +189,25 @@ Library openprocurement_client_helper.py
174 189 Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} access_token ${access_token}
175 190 Log object data ${complaint} complaint
176 191
  192 +
177 193 Порівняти скаргу
178 194 [Documentation]
179 195 ... ${ARGUMENTS[0]} == username
180 196 ... ${ARGUMENTS[1]} == tender_uid
181 197 ... ${ARGUMENTS[2]} == complaint
182 198 [Arguments] @{ARGUMENTS}
  199 + Log many @{ARGUMENTS}
183 200 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
184 201 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
185 202 ${complaint}= Get Variable Value ${tender.data.complaints[0]}
186   - log ${complaint}
187   - log ${ARGUMENTS[2]}
  203 + Log ${complaint}
188 204 #TODO: COMPARE
189 205 #Dictionary Should Contain Sub Dictionary ${complaint} ${ARGUMENTS[2].data}
190 206 #:FOR ${element} IN ${ARGUMENTS[2].data}
191   - #\ log ${element}
  207 + #\ Log ${element}
192 208 #\ Dictionary Should Contain Value ${complaint} ${element}
193 209
  210 +
194 211 Обробити скаргу
195 212 [Documentation]
196 213 ... ${ARGUMENTS[0]} == username
... ... @@ -198,28 +215,30 @@ Library openprocurement_client_helper.py
198 215 ... ${ARGUMENTS[2]} == question_id
199 216 ... ${ARGUMENTS[3]} == answer_data
200 217 [Arguments] @{ARGUMENTS}
201   - log many @{ARGUMENTS}
  218 + Log many @{ARGUMENTS}
202 219 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
203 220 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
204 221 ${tender}= set_access_key ${tender} ${USERS.users['${ARGUMENTS[0]}'].access_token}
205 222 ${ARGUMENTS[3].data.id}= Set Variable ${tender.data.complaints[${ARGUMENTS[2]}].id}
206 223 ${complaint_with_answer}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} _patch_tender_resource_item ${tender} ${ARGUMENTS[3]} complaints
207   - log many ${USERS.users['${ARGUMENTS[0]}'].client} ${tender} ${ARGUMENTS[3]}
  224 + Log many ${USERS.users['${ARGUMENTS[0]}'].client} ${tender} ${ARGUMENTS[3]}
208 225 Log object data ${complaint_with_answer} complaint_with_answer
209 226
  227 +
210 228 Подати цінову пропозицію
211 229 [Documentation]
212 230 ... ${ARGUMENTS[0]} == username
213 231 ... ${ARGUMENTS[1]} == tender_uid
214 232 ... ${ARGUMENTS[2]} == bid
215 233 [Arguments] @{ARGUMENTS}
216   - log many @{ARGUMENTS}
  234 + Log many @{ARGUMENTS}
217 235 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
218 236 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
219   - log ${tender}Отримати
  237 + Log ${tender}
220 238 ${biddingresponse}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_bid ${tender} ${ARGUMENTS[2]}
221 239 [return] ${biddingresponse}
222 240
  241 +
223 242 Змінити цінову пропозицію
224 243 [Documentation]
225 244 ... ${ARGUMENTS[0]} == username
... ... @@ -232,20 +251,22 @@ Library openprocurement_client_helper.py
232 251 Log ${changed_bid}
233 252 [return] ${changed_bid}
234 253
  254 +
235 255 Скасувати цінову пропозицію
236 256 [Documentation]
237 257 ... ${ARGUMENTS[0]} == username
238 258 ... ${ARGUMENTS[1]} == tender_uid
239 259 ... ${ARGUMENTS[2]} == bid
240 260 [Arguments] @{ARGUMENTS}
  261 + Log many @{ARGUMENTS}
241 262 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
242 263 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
243   - log ${tender}
244   - log ${ARGUMENTS[2]}Отримати
  264 + Log ${tender}
245 265 ${changed_bid}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} delete_bid ${tender} ${ARGUMENTS[2]}
246 266 Log ${changed_bid}
247 267 [return] ${changed_bid}
248 268
  269 +
249 270 Прийняти цінову пропозицію
250 271 [Documentation]
251 272 ... ${ARGUMENTS[0]} == username
... ... @@ -259,25 +280,25 @@ Library openprocurement_client_helper.py
259 280 Log ${award_activeted_response}
260 281 [return] ${award_activeted_response}
261 282
  283 +
262 284 Завантажити документ в ставку
263 285 [Documentation]
264 286 ... ${ARGUMENTS[0]} == username
265 287 ... ${ARGUMENTS[1]} == path
266 288 ... ${ARGUMENTS[2]} == tenderid
267 289 [Arguments] @{ARGUMENTS}
268   - log ${ARGUMENTS[0]}
269   - log ${ARGUMENTS[1]}
270   - log ${ARGUMENTS[2]}
  290 + Log many @{ARGUMENTS}
271 291 ${bid_id}= Get Variable Value ${USERS.users['${ARGUMENTS[0]}'].bidresponses['resp'].data.id}
272 292 ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[2]}
273 293 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
274 294 ${tender}= set_access_key ${tender} ${USERS.users['${ARGUMENTS[0]}'].bidresponses['resp'].access.token}
275 295 ${response}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} upload_bid_document ${ARGUMENTS[1]} ${tender} ${bid_id}
276 296 ${uploaded_file} = Create Dictionary filepath ${ARGUMENTS[1]} upload_response ${response}
277   - log ${response}
  297 + Log ${response}
278 298 Log object data ${uploaded_file}
279 299 [return] ${uploaded_file}
280 300
  301 +
281 302 Змінити документ в ставці
282 303 [Documentation]
283 304 ... ${ARGUMENTS[0]} == username
... ... @@ -285,27 +306,24 @@ Library openprocurement_client_helper.py
285 306 ... ${ARGUMENTS[2]} == bidid
286 307 ... ${ARGUMENTS[3]} == docid
287 308 [Arguments] @{ARGUMENTS}
288   - log ${ARGUMENTS[0]}
289   - log ${ARGUMENTS[1]}
290   - log ${ARGUMENTS[2]}
291   - ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${TENDER['TENDER_UAID']}
  309 + Log many @{ARGUMENTS}
  310 + ${internalid}= Отримати internal id по UAid ${ARGUMENTS[0]} ${TENDER['TENDER['TENDER_UAID']']}
292 311 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${internalid}
293 312 ${tender}= set_access_key ${tender} ${USERS.users['${ARGUMENTS[0]}'].bidresponses['resp'].access.token}
294 313 ${response}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} update_bid_document ${ARGUMENTS[1]} ${tender} ${ARGUMENTS[2]} ${ARGUMENTS[3]}
295 314 ${uploaded_file} = Create Dictionary filepath ${ARGUMENTS[1]} upload_response ${response}
296   - log ${response}
  315 + Log ${response}
297 316 Log object data ${uploaded_file}
298 317 [return] ${uploaded_file}
299 318
  319 +
300 320 Завантажити документ
301 321 [Documentation]
302 322 ... ${ARGUMENTS[0]} == username
303 323 ... ${ARGUMENTS[1]} == filepath
304   - ... ${ARGUMENTS[2]} == tenderUAID
  324 + ... ${ARGUMENTS[2]} == TENDER['TENDER_UAID']
305 325 [Arguments] @{ARGUMENTS}
306   - log ${ARGUMENTS[0]}
307   - log ${ARGUMENTS[1]}
308   - log ${ARGUMENTS[2]}
  326 + Log many @{ARGUMENTS}
309 327 ${tenderID}= openprocurement_client.Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[2]}
310 328 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${tenderID}
311 329 ${tender}= set_access_key ${tender} ${USERS.users['${ARGUMENTS[0]}'].access_token}
... ... @@ -313,17 +331,20 @@ Library openprocurement_client_helper.py
313 331 Log object data ${reply} reply
314 332 [return] ${reply}
315 333
  334 +
316 335 Отримати посилання на аукціон для глядача
317 336 [Arguments] ${username} ${tender_uid}
318 337 ${internalid}= Отримати internal id по UAid ${username} ${tender_uid}
319 338 ${tender}= Call Method ${USERS.users['${username}'].client} get_tender ${internalid}
320 339 [return] ${tender.data.auctionUrl}
321 340
  341 +
322 342 Отримати посилання на аукціон для учасника
323 343 [Arguments] ${username} ${tender_uid}
324 344 ${bid}= Викликати для учасника ${username} Отримати пропозицію ${tender_uid}
325 345 [return] ${bid.data.participationUrl}
326 346
  347 +
327 348 Отримати пропозицію
328 349 [Arguments] ${username} ${tender_uid}
329 350 ${internalid}= Отримати internal id по UAid ${username} ${tender_uid}
... ... @@ -333,20 +354,19 @@ Library openprocurement_client_helper.py
333 354 ${bid}= Call Method ${USERS.users['${username}'].client} get_bid ${tender} ${bid_id} ${token}
334 355 [return] ${bid}
335 356
  357 +
336 358 Отримати документ
337 359 [Documentation]
338 360 ... ${ARGUMENTS[0]} == username
339   - ... ${ARGUMENTS[1]} == tenderUaID
  361 + ... ${ARGUMENTS[1]} == TENDER['TENDER_UAID']
340 362 ... ${ARGUMENTS[2]} == url
341 363 [Arguments] @{ARGUMENTS}
342   - log ${ARGUMENTS[0]}
343   - log ${ARGUMENTS[1]}
344   - log ${ARGUMENTS[2]}
  364 + Log many @{ARGUMENTS}
345 365 ${tenderID}= openprocurement_client.Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[1]}
346 366 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${tenderID}
347 367 ${token}= Get Variable Value ${USERS.users['${ARGUMENTS[0]}'].bidresponses['resp'].access.token}
348 368 ${contents} ${filename}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_file ${tender} ${ARGUMENTS[2]} ${token}
349   - log ${filename}
  369 + Log ${filename}
350 370 [return] ${contents} ${filename}
351 371
352 372
... ... @@ -356,24 +376,26 @@ Library openprocurement_client_helper.py
356 376 ... ${ARGUMENTS[1]} == tender
357 377 ... ${ARGUMENTS[2]} == lot
358 378 [Arguments] @{ARGUMENTS}
359   - log many @{ARGUMENTS}
  379 + Log many @{ARGUMENTS}
360 380 ${tender}= set_access_key ${ARGUMENTS[1]} ${USERS.users['${ARGUMENTS[0]}'].access_token}
361 381 ${tender_lot}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_lot ${tender} ${ARGUMENTS[2]}
362 382 Log ${tender_lot}
363 383 [return] ${tender_lot}
364 384
  385 +
365 386 Змінити лот
366 387 [Documentation]
367 388 ... ${ARGUMENTS[0]} == username
368 389 ... ${ARGUMENTS[1]} == tender
369 390 ... ${ARGUMENTS[2]} == lot
370 391 [Arguments] @{ARGUMENTS}
371   - log many @{ARGUMENTS}
  392 + Log many @{ARGUMENTS}
372 393 ${tender}= set_access_key ${ARGUMENTS[1]} ${USERS.users['${ARGUMENTS[0]}'].access_token}
373 394 ${tender_lot}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_lot ${tender} ${ARGUMENTS[2]}
374 395 Log ${tender_lot}
375 396 [return] ${tender_lot}
376 397
  398 +
377 399 Завантажити документ в лот
378 400 [Documentation]
379 401 ... ${ARGUMENTS[0]} == username
... ... @@ -381,7 +403,7 @@ Library openprocurement_client_helper.py
381 403 ... ${ARGUMENTS[2]} == tenderUAID
382 404 ... ${ARGUMENTS[3]} == lot_id
383 405 [Arguments] @{ARGUMENTS}
384   - log many @{ARGUMENTS}
  406 + Log many @{ARGUMENTS}
385 407 ${tenderID}= openprocurement_client.Отримати internal id по UAid ${ARGUMENTS[0]} ${ARGUMENTS[2]}
386 408 ${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${tenderID}
387 409 ${tender}= set_access_key ${tender} ${USERS.users['${ARGUMENTS[0]}'].access_token}
... ... @@ -391,13 +413,14 @@ Library openprocurement_client_helper.py
391 413 Log object data ${reply} reply
392 414 [return] ${reply}
393 415
  416 +
394 417 Видалити лот
395 418 [Documentation]
396 419 ... ${ARGUMENTS[0]} == username
397 420 ... ${ARGUMENTS[1]} == tender
398 421 ... ${ARGUMENTS[2]} == lot
399 422 [Arguments] @{ARGUMENTS}
400   - log many @{ARGUMENTS}
  423 + Log many @{ARGUMENTS}
401 424 ${tender}= set_access_key ${ARGUMENTS[1]} ${USERS.users['${ARGUMENTS[0]}'].access_token}
402 425 ${tender_lot}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} delete_lot ${tender} ${ARGUMENTS[2]}
403 426 Log ${tender_lot}
... ...
Please register or login to post a comment