playtender.robot
42.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
*** Settings ***
Library String
Library DateTime
Library playtender_service.py
*** Variables ***
${planFormSubmitSuccessMessage} = План закупівлі створений, дочекайтесь опублікування на сайті уповноваженого органу.
*** Keywords ***
Підготувати дані для оголошення тендера
[Arguments] ${username} ${tender_data} ${param3}
[return] ${tender_data}
Підготувати клієнт для користувача
[Arguments] ${username}
[Documentation] Відкрити браузер, створити об’єкт api wrapper, тощо
Open Browser ${BROKERS['playtender'].homepage} ${USERS.users['${username}'].browser} alias=${username}
Set Window Size @{USERS.users['${username}'].size}
Set Window Position @{USERS.users['${username}'].position}
inject_urllib3
Login ${username}
Login
[Arguments] ${username}
Run Keyword And Ignore Error Click Element xpath=//button[@class='languages__btn js-popup-open-initiator']
Run Keyword And Ignore Error Wait Until Element Is Visible xpath=//*[contains(@data-language, '1')] 60
Run Keyword And Ignore Error Click Link xpath=//*[contains(@data-language, '1')]
#Go To ${USERS.users['${username}'].homepage}
Wait Until Element Is Visible xpath=//a[@data-action='login'] 60
Click Link xpath=//a[(@data-action='login') and contains(.,'Увійти')]
Wait Until Page Contains Element id=loginform-email 60
Input text id=loginform-email ${USERS.users['${username}'].login}
Input text id=loginform-password ${USERS.users['${username}'].password}
Click Button xpath=//button[(@class='btn btn-lg w-lg-x2 btn-success js-submit-btn') and contains(.,'Увійти')]
Wait Until Page Contains Активні 60
Set Global Variable ${playtender_LOGIN_USER} ${username}
Wait For Page Create Tender
[Arguments] ${url}
Go To ${url}
Sleep 10
Wait Until Page Contains Element xpath=//form[@id="tender-form"] 60
Створити тендер
[Arguments] ${user} ${tender_data}
${tender_data}= procuring_entity_name ${tender_data}
${tender_data_keys}= Get Dictionary Keys ${tender_data.data}
${procurementMethodType} = Set Variable If 'procurementMethodType' in ${tender_data_keys} ${tender_data.data.procurementMethodType} belowThreshold
Set To Dictionary ${USERS.users['${playtender_LOGIN_USER}']} tender_methodtype=${procurementMethodType}
# change organization info
#UserChangeOrgnizationInfo ${tender_data.data.procuringEntity}
# Run Keyword If '${SUITE_NAME}' == 'Tests Files.Complaints' Go To ${BROKERS['playtender'].basepage}/utils/config?tacceleration=${BROKERS['playtender'].intervals.belowThreshold.accelerator}
Run Keyword If '${SUITE_NAME}' == 'Tests Files.Complaints' and '${procurementMethodType}' == 'belowThreshold' Go To ${BROKERS['playtender'].basepage}/utils/config?tacceleration=360
Run Keyword If '${procurementMethodType}' == 'negotiation' Go To ${BROKERS['playtender'].basepage}/utils/config?tacceleration=1080
Run Keyword If '${procurementMethodType}' == 'aboveThresholdUA.defense' Go To ${BROKERS['playtender'].basepage}/utils/config?tacceleration=720
Selenium2Library.Switch Browser ${user}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' and 'lots' not in ${tender_data_keys} Wait Until Keyword Succeeds 100 s 10 s Wait For Page Create Tender ${BROKERS['playtender'].basepage}/tender/create?type=${procurementMethodType}&multilot=0
Run Keyword If '${procurementMethodType}' != 'belowThreshold' or 'lots' in ${tender_data_keys} Wait Until Keyword Succeeds 100 s 10 s Wait For Page Create Tender ${BROKERS['playtender'].basepage}/tender/create?type=${procurementMethodType}
Wait Until Page Contains Element xpath=//form[@id="tender-form"] 60
### BOF - Reporting ###
Run Keyword And Return If '${procurementMethodType}' == 'reporting' Створити тендер без лотів ${user} ${tender_data}
Run Keyword And Return If '${procurementMethodType}' == 'belowThreshold' and 'lots' not in ${tender_data_keys} Створити тендер без лотів ${user} ${tender_data}
### EOF - Reporting ###
${title}= Get From Dictionary ${tender_data.data} title
${description}= Get From Dictionary ${tender_data.data} description
${playtender_proc_type}= Convert_to_Lowercase ${procurementMethodType}
${playtender_proc_type}= Remove String ${playtender_proc_type} \.
Run Keyword If '${mode}' in 'belowThreshold below_funders' and ${number_of_lots} != 0 Click Element xpath=//input[@id='tenderbelowthresholdform-is_multilot']
Input text id=tender${playtender_proc_type}form-title ${title}
Run Keyword If 'cause' in ${tender_data_keys} Select From List By Value id=tender${playtender_proc_type}form-cause ${tender_data.data.cause}
Run Keyword If 'causeDescription' in ${tender_data_keys} Input text id=tender${playtender_proc_type}form-cause_description ${tender_data.data.causeDescription}
Run Keyword If 'title_en' in ${tender_data_keys} Input Text With Checking Input Isset \#tender${playtender_proc_type}form-title_en ${tender_data.data.title_en}
Input text id=tender${playtender_proc_type}form-description ${description}
Run Keyword If 'description_en' in ${tender_data_keys} Input Text With Checking Input Isset \#tender${playtender_proc_type}form-description_en ${tender_data.data.description_en}
Run Keyword If 'fundingKind' in ${tender_data_keys} Select From List By Value id=tender${playtender_proc_type}form-funding_kind ${tender_data.data.fundingKind}
Run Keyword If 'NBUdiscountRate' in ${tender_data_keys} Input Float Multiply100 \#tender${playtender_proc_type}form-nbu_discount_rate ${tender_data.data.NBUdiscountRate}
Click Element id=tender${playtender_proc_type}form-value_added_tax_included
Run Keyword If 'mainProcurementCategory' in ${tender_data_keys} Select From List By Value id=tender${playtender_proc_type}form-main_procurement_category ${tender_data.data.mainProcurementCategory}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Створити тендер enquiryPeriod.startDate ${playtender_proc_type} ${tender_data.data.enquiryPeriod.startDate}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Створити тендер enquiryPeriod.endDate ${playtender_proc_type} ${tender_data.data.enquiryPeriod.endDate}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Створити тендер tenderPeriod.startDate ${playtender_proc_type} ${tender_data.data.tenderPeriod.startDate}
Run Keyword If '${procurementMethodType}' != 'negotiation' Створити тендер tenderPeriod.end_date ${playtender_proc_type} ${tender_data.data.tenderPeriod.endDate}
Select Checkbox id=tender${playtender_proc_type}form-quick_mode
Run Keyword If '${SUITE_NAME}' == 'Tests Files.Complaints' Select Checkbox id=tender${playtender_proc_type}form-auction_skip_mode
### BOF - BelowFunders ###
Run Keyword If 'funders' in ${tender_data_keys} Створити тендер Funder ${tender_data.data.funders[0]}
### EOF - BelowFunders ###
Click Element xpath=//*[contains(@href, '#collapseLots')]
Sleep 1
JsSetScrollToElementBySelector \#collapseLots
Click Element xpath=//span[@data-confirm-text='Ви впевнені що бажаєте видалити поточний лот?']
Click Element xpath=//div[contains(@class, 'jconfirm-box')]//button[contains(text(), 'Так')]
${items}= Get From Dictionary ${tender_data.data} items
${lots}= Get From Dictionary ${tender_data.data} lots
Set To Dictionary ${USERS.users['${playtender_LOGIN_USER}']} lots=${lots}
${lots_length}= Get Length ${lots}
: FOR ${INDEX} IN RANGE 0 ${lots_length}
\ Sleep 2
#cat \ Click Element xpath=//a[@href='#add-lots']
\ Execute Javascript $( 'a[href="#add-lots"]' ).trigger( 'click' )
\ Sleep 2
\ Wait Until Page Contains Товар/послуга № 60
\ Click Element jquery=div[data-type="lot"].active span[data-confirm-text="Ви впевнені що бажаєте видалити поточний товар/послугу?"]
\ Click Element xpath=//div[contains(@class, 'jconfirm-box')]//button[contains(text(), 'Так')]
\ Sleep 1
\ Run Keyword If 'features' in ${tender_data_keys} Додати лот ${lots[${INDEX}]} ${INDEX} ${procurementMethodType} ${items} ${tender_data.data.features}
\ Run Keyword If 'features' not in ${tender_data_keys} Додати лот Ex2 ${lots[${INDEX}]} ${INDEX} ${procurementMethodType} ${items}
Run Keyword If 'features' in ${tender_data_keys} Click Element xpath=//*[contains(@href, '#collapseFeatures')]
Sleep 1
Run Keyword If 'features' in ${tender_data_keys} Add Features Ex ${tender_data.data.features} tenderer ${procurementMethodType} div[@id='collapseFeatures']
${Ids}= Створити тендер Збереження форми
[return] ${Ids}
Створити тендер без лотів
[Arguments] ${user} ${tender_data}
${tender_data_keys}= Get Dictionary Keys ${tender_data.data}
${procurementMethodType}= Get From Dictionary ${USERS.users['${playtender_LOGIN_USER}']} tender_methodtype
${budget}= convert_float_to_string ${tender_data.data.value.amount}
${playtender_proc_type}= Convert_to_Lowercase ${procurementMethodType}
${playtender_proc_type}= Remove String ${playtender_proc_type} \.
# fill general data
Дочекатися І Клікнути xpath=//a[contains(@data-url,'#general-form-popup')]
Input text id=tender${playtender_proc_type}form-title ${tender_data.data.title}
Input text id=tender${playtender_proc_type}form-description ${tender_data.data.description}
JsSetScrollToElementBySelector \#tender${playtender_proc_type}form-value_amount
Input text id=tender${playtender_proc_type}form-value_amount ${budget}
Select From List By Value id=tender${playtender_proc_type}form-value_currency ${tender_data.data.value.currency}
Run Keyword If ${tender_data.data.value.valueAddedTaxIncluded} Click Element id=tender${playtender_proc_type}form-value_added_tax_included
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Input Float \#tender${playtender_proc_type}form-min_step_amount ${tender_data.data.minimalStep.amount}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Створити тендер enquiryPeriod.startDate ${playtender_proc_type} ${tender_data.data.enquiryPeriod.startDate}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Створити тендер enquiryPeriod.endDate ${playtender_proc_type} ${tender_data.data.enquiryPeriod.endDate}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Створити тендер tenderPeriod.startDate ${playtender_proc_type} ${tender_data.data.tenderPeriod.startDate}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Створити тендер tenderPeriod.end_date ${playtender_proc_type} ${tender_data.data.tenderPeriod.endDate}
Run Keyword If '${procurementMethodType}' == 'belowThreshold' Select Checkbox id=tender${playtender_proc_type}form-quick_mode
Scroll To Element xpath=//div[contains(@id,"general-form-popup")]//a[contains(@class,'btn btn-success js-popup-submit')]
Дочекатися і Клікнути xpath=//div[contains(@id,"general-form-popup")]//a[contains(@class,'btn btn-success js-popup-submit')]
# fill items
# Click Element xpath=//*[contains(@href, '#collapseItems')]
# Sleep 1
# JsSetScrollToElementBySelector \#collapseItems
Scroll To Element xpath=//form[@id="tender-form"]//a[contains(@class,'btn btn-default btn-update js-form-popup-add')]
Wait Until Element Is Visible xpath=//form[@id="tender-form"]//a[contains(@class,'btn btn-default btn-update js-form-popup-add')] 6
Sleep 3
Дочекатися і Клікнути xpath=//form[@id="tender-form"]//a[contains(@class,"btn btn-default btn-update js-form-popup-add")]
Wait Until Page Contains Element xpath=//div[contains(@class,"modal modal-form js-form-popup fancybox-content")] 60
# Wait Until Page Contains Товар/послуга № 60
# Wait Until Page Contains Товар/послуга № 60
# Click Element xpath=//span[@data-confirm-text='Ви впевнені що бажаєте видалити поточний товар/послугу?']
# Click Element xpath=//div[contains(@class, 'jconfirm-box')]//button[contains(text(), 'Так')]
${items}= Get From Dictionary ${tender_data.data} items
${items_length}= Get Length ${items}
: FOR ${INDEX} IN RANGE 0 ${items_length}
# \ JsSetScrollToElementBySelector \#collapseItems a[href='#add-items']
# \ Click Element jquery=#collapseItems a[href="#add-items"]
# \ Sleep 2
# \ Додати предмет By Wrapper \#collapseItems div[data-type='item'].active ${items[${INDEX}]} ${procurementMethodType}
# \ Додати предмет By Wrapper //*[@class="modal modal-form js-form-popup fancybox-content"] ${items[${INDEX}]} ${procurementMethodType}
\ Додати предмет By Wrapper \.modal.modal-form.js-form-popup.fancybox-content ${items[${INDEX}]} ${procurementMethodType}
Run Keyword If '${procurementMethodType}' == 'reporting' Додати постачальника For Reporting Fake
${Ids}= Створити тендер Збереження форми
[return] ${Ids}
#Wait For UAID
# Sleep 5
# Reload Page
# ${tender_UAid}= Get Text xpath=//*[contains(@class, 'tender-id')]//*[@class='value']
#Клацнути і дочекатися
# [Arguments] ${click_locator} ${wanted_locator} ${timeout}
# [Documentation]
# ... click_locator: Where to click
# ... wanted_locator: What are we waiting for
# ... timeout: Timeout
# Click Element ${click_locator}
# Sleep 3
# Wait Until Page Contains Element ${wanted_locator} ${timeout}
Клацнути і дочекатися пошук
[Arguments] ${click_locator} ${wanted_locator} ${timeout}
[Documentation]
... click_locator: Where to click
... wanted_locator: What are we waiting for
... timeout: Timeout
Press key ${click_locator} \\13
Sleep 3
Wait Until Page Contains Element ${wanted_locator} ${timeout}
Wait For Sync Tender
[Arguments] ${timeout}
${passed}= Run Keyword And Return Status Wait Until Keyword Succeeds ${timeout} s 0 s Wait For Sync Tender Finish
Run Keyword Unless ${passed} Fatal Error Sync Finish not finish in ${timeout} sec
Wait For Sync Tender Finish
Sleep 3
Reload Page
Page Should Not Contain Element id=tender-sync-info
### BOF - PLANNING ###
Створити план
[Arguments] ${user} ${plan_data}
${plan_data}= procuring_entity_name ${plan_data}
${data}= Get From Dictionary ${plan_data} data
${data_keys}= Get Dictionary Keys ${data}
${start_date}= convert_isodate_to_site_date_plan ${data.tender.tenderPeriod.startDate}
${budget_keys}= Get Dictionary Keys ${data.budget}
### ${classificationWrapper}= Set Variable \//div[@id="general-form-popup"]
${classificationWrapper}= Set Variable \div[id$="general-form-popup"]
## preparing
# UserChangeOrgnizationInfo ${data.procuringEntity}
## load form page
Go To ${BROKERS['playtender'].basepage}/plan/create
Wait Until Page Contains Element xpath=//form[@id="plan-form"] 60
## filling form
Дочекатися І Клікнути xpath=//a[contains(@data-url,'#general-form-popup')]
Select From List By Value id=planform-procurement_method_type ${data.tender.procurementMethodType}
Run Keyword If 'period' in ${budget_keys} input datetime \#planform-period_start_date ${data.budget.period.startDate}
Run Keyword If 'period' in ${budget_keys} input datetime \#planform-period_end_date ${data.budget.period.endDate}
JsInputHiddenText \#planform-budget_id ${data.budget.id}
Input text id=planform-title ${data.budget.description}
Input Float \#planform-value_amount ${data.budget.amount}
Select From List By Value id=planform-value_currency ${data.budget.currency}
JsInputHiddenText \#planform-project_id ${data.budget.project.id}
JsInputHiddenText \#planform-project_name ${data.budget.project.name}
Input text id=planform-tender_start_date ${start_date}
InputClassificationByWrapper ${classificationWrapper} ${data.classification.id}
Run Keyword If 'additionalClassifications' in ${data_keys} InputAdditionalClassificationsByWrapper ${classificationWrapper} ${data.additionalClassifications}
Scroll To Element xpath=//div[contains(@id,"general-form-popup")]//a[contains(@class,"btn btn-success js-popup-submit")]
Дочекатися і Клікнути xpath=//div[contains(@id,"general-form-popup")]//a[contains(@class,"btn btn-success js-popup-submit")]
Run Keyword If 'items' in ${data_keys} InputPlanItems ${data}
## submit form
Дочекатися і Клікнути xpath=//*[@id='submitBtn']
Wait Until Page Contains ${planFormSubmitSuccessMessage} 60
CheckAlertMessageAndCloseIt
Wait For Sync Tender 360
${plan_id} Get Text jquery=#plan-general-info .plan-id .value
[Return] ${plan_id}
Пошук плану по ідентифікатору
[Arguments] ${username} ${tenderId}
Run Keyword If '${ROLE}' == 'viewer' Go To ${BROKERS['playtender'].basepage}/utils/plan-sync?planid=${tenderId}
Run Keyword If '${ROLE}' == 'viewer' Sleep 5
${planNotSynced}= Run Keyword And Return Status Page Should Contain fail
Run Keyword If '${ROLE}' == 'viewer' and ${planNotSynced} Go To ${BROKERS['playtender'].basepage}/utils/queue-plan-update
Run Keyword If '${ROLE}' == 'viewer' and ${planNotSynced} Sleep 30
Go To ${BROKERS['playtender'].basepage}/plans
Wait Until Page Contains Element id=plansearchform-query 60
#cat Input Text id=plansearchform-query ${tenderId}
#cat Click Element jquery=#plan-search-form .js-submit-btn
Input Text xpath=//input[@data-ds='query-input'] ${tenderId}
Click Element xpath=//button[@class='btn btn-default js-submit-btn']
#cat Press key xpath=//input[@data-ds='query-input'] \\13
Sleep 1
${passed}= Run Keyword And Return Status Wait Until Keyword Succeeds 360 s 0 s Шукати і знайти план
Run Keyword Unless ${passed} Fatal Error Тендер не знайдено за 360 секунд
Wait Until Page Does Not Contain Element jquery=#plan-list-pjax.loading-wrapper
Capture Page Screenshot
Click Element xpath=(//div[@id='plan-list-pjax'])//a[contains(@href, '/plan/')][1]
Sleep 5
Шукати і знайти план
Клацнути і дочекатися пошук xpath=//button[@class='btn btn-default js-submit-btn'] xpath=(//div[@id='plan-list-pjax'])//a[contains(@href, '/plan/')][1] 5
Оновити сторінку з планом
[Arguments] ${username} ${tenderId}
Reload Page
Sleep 2s
Внести зміни в план
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} = username
... ${ARGUMENTS[1]} = ${TENDER_UAID}
... ${ARGUMENTS[2]} = key
... ${ARGUMENTS[3]} = value
PlanFormOpenByUAID ${ARGUMENTS[1]}
Run Keyword If '${ARGUMENTS[2]}' == 'budget.amount' Input text id=planform-value_amount ${ARGUMENTS[3]}
Run Keyword If '${ARGUMENTS[2]}' == 'budget.description' Input text id=planform-title ${ARGUMENTS[3]}
Run Keyword If '${ARGUMENTS[2]}' == 'items[0].deliveryDate.endDateitem'
# ... PlanUpdateItemDeliveryEndDate \#collapseItems .tab-content .tab-pane:first ${ARGUMENTS[3]}
... PlanUpdateItemDeliveryEndDateNew \#collapseItems .tab-content .tab-pane:first ${ARGUMENTS[3]}
Run Keyword If '${ARGUMENTS[2]}' == 'items[0].quantity' JsTabShowAndScroll ul.form-nav-tabs a[data-toggle='tab'][href='#collapseItems']
Run Keyword If '${ARGUMENTS[2]}' == 'items[0].quantity' JsTabShowAndScroll \#collapseItems .nav li:first a
Run Keyword If '${ARGUMENTS[2]}' == 'items[0].quantity'
... PlanUpdateItemQuantity \#collapseItems .tab-content .tab-pane:first ${ARGUMENTS[3]}
PlanUpdateSave
Додати предмет закупівлі в план
[Arguments] ${username} ${uaid} ${item_data}
PlanFormOpenByUAID ${uaid}
InputPlanOneItem ${item_data}
PlanUpdateSave
Видалити предмет закупівлі плану
[Arguments] ${username} ${uaid} ${item_key}
PlanFormOpenByUAID ${uaid}
JsTabShowAndScroll ul.form-nav-tabs a[data-toggle='tab'][href='#collapseItems']
Click Element jquery=#collapseItems .nav li[data-title^='${item_key}']
Sleep 1
Click Element jquery=#collapseItems .nav li[data-title^='${item_key}'] .js-dynamic-form-remove
Wait Until Page Contains Ви впевнені що бажаєте видали обрану номенклатуру? 60
Click Element xpath=//div[contains(@class, 'jconfirm-box')]//button[contains(@class, 'btn btn-default waves-effect waves-light btn-lg')]
PlanUpdateSave
Отримати інформацію із плану
[Arguments] ${username} ${uaid} ${key}
${item0Wrapper}= Set Variable \#accordionItems .panel:nth(0) .panel-collapse:first
${item1Wrapper}= Set Variable \#accordionItems .panel:nth(1) .panel-collapse:first
${budget}= get_invisible_text jquery=#general-info .budget-amount
PlanOpenByUAID ${uaid}
JsSetScrollToElementBySelector \#general-info
Run Keyword And Return If '${key}' == 'tender.procurementMethodType' get_invisible_text jquery=#general-info .procurement-method-type
Run Keyword And Return If '${key}' == 'budget.amount' Convert To Number ${budget}
Run Keyword And Return If '${key}' == 'budget.description' get_text jquery=#general-info .budget-description .value
Run Keyword And Return If '${key}' == 'budget.currency' get_invisible_text jquery=#general-info .budget-currency
Run Keyword And Return If '${key}' == 'budget.id' get_text jquery=#general-info .budget-id .value
Run Keyword And Return If '${key}' == 'budget.project.id' get_invisible_text jquery=#general-info .budget-project-id
Run Keyword And Return If '${key}' == 'budget.project.name' get_invisible_text jquery=#general-info .budget-project-name
Run Keyword And Return If '${key}' == 'classification.description' get_invisible_text jquery=#general-info .main-classification-description
Run Keyword And Return If '${key}' == 'classification.scheme' get_invisible_text jquery=#general-info .main-classification-scheme
Run Keyword And Return If '${key}' == 'classification.id' get_invisible_text jquery=#general-info .main-classification-code
Run Keyword And Return If '${key}' == 'tender.tenderPeriod.startDate' get_invisible_text jquery=#general-info .tender-start-date-source
${procuringEntityNeedToBeVisible}= Run Keyword And Return Status Should Start With ${key} procuringEntity
Run Keyword If ${procuringEntityNeedToBeVisible} JsSetScrollToElementBySelector \#procuring-entity-info
Run Keyword And Return If '${key}' == 'procuringEntity.name' get_invisible_text jquery=#procuring-entity-info .name
Run Keyword And Return If '${key}' == 'procuringEntity.identifier.scheme' get_invisible_text jquery=#procuring-entity-info .identifier-scheme
Run Keyword And Return If '${key}' == 'procuringEntity.identifier.id' get_invisible_text jquery=#procuring-entity-info .identifier-code
Run Keyword And Return If '${key}' == 'procuringEntity.identifier.legalName' get_text jquery=#procuring-entity-info .legal-name .value
${item0NeedToBeVisible}= Run Keyword And Return Status Should Start With ${key} items[0]
Run Keyword If ${item0NeedToBeVisible} JsCollapseShowAndScroll ${item0Wrapper}
Run Keyword And Return If '${key}' == 'items[0].description' get_text jquery=div#accordionItems.panel-group div.panel.panel-default .panel-collapse.collapse.in div.panel-body div#w1.item-info-wrapper.info-wrapper p.title span.value
Run Keyword And Return If '${key}' == 'items[0].quantity' Get invisible text number by locator jquery=${item0Wrapper} .item-info-wrapper .quantity-source
Run Keyword And Return If '${key}' == 'items[0].deliveryDate.endDate' get_invisible_text jquery=${item0Wrapper} .item-info-wrapper .delivery-end-date-source
Run Keyword And Return If '${key}' == 'items[0].unit.code' get_invisible_text jquery=${item0Wrapper} .item-info-wrapper .unit-code-source
Run Keyword And Return If '${key}' == 'items[0].unit.name' get_invisible_text jquery=${item0Wrapper} .item-info-wrapper .unit-title-source
Run Keyword And Return If '${key}' == 'items[0].classification.description' get_invisible_text jquery=${item0Wrapper} .item-info-wrapper .main-classification-description
Run Keyword And Return If '${key}' == 'items[0].classification.scheme' get_invisible_text jquery=${item0Wrapper} .item-info-wrapper .main-classification-scheme
Run Keyword And Return If '${key}' == 'items[0].classification.id' get_invisible_text jquery=${item0Wrapper} .item-info-wrapper .main-classification-code
${item1NeedToBeVisible}= Run Keyword And Return Status Should Start With ${key} items[1]
Run Keyword If ${item1NeedToBeVisible} JsCollapseShowAndScroll ${item1Wrapper}
Run Keyword And Return If '${key}' == 'items[1].description' get_text jquery=${item1Wrapper} .item-info-wrapper .title .value
Run Keyword And Return If '${key}' == 'items[1].quantity' Get invisible text number by locator jquery=${item1Wrapper} .item-info-wrapper .quantity-source
Run Keyword And Return If '${key}' == 'items[1].deliveryDate.endDate' get_invisible_text jquery=${item1Wrapper} .item-info-wrapper .delivery-end-date-source
Run Keyword And Return If '${key}' == 'items[1].unit.code' get_invisible_text jquery=${item1Wrapper} .item-info-wrapper .unit-code-source
Run Keyword And Return If '${key}' == 'items[1].unit.name' get_invisible_text jquery=${item1Wrapper} .item-info-wrapper .unit-title-source
Run Keyword And Return If '${key}' == 'items[1].classification.description' get_invisible_text jquery=${item1Wrapper} .item-info-wrapper .main-classification-description
Run Keyword And Return If '${key}' == 'items[1].classification.scheme' get_invisible_text jquery=${item1Wrapper} .item-info-wrapper .main-classification-scheme
Run Keyword And Return If '${key}' == 'items[1].classification.id' get_invisible_text jquery=${item1Wrapper} .item-info-wrapper .main-classification-code
Fail NotImplemented
### EOF - PLANNING ###
### BOF - HELPERS ###
UserChangeOrgnizationInfo
[Arguments] ${data}
${keys}= Get Dictionary Keys ${data}
Go To ${BROKERS['playtender'].basepage}/user/profile
Wait Until Page Contains Інформація про компанію 60
Sleep 1
Run Keyword If 'name' in ${keys} Input text id=profileform-organization_name ${data.name}
Run Keyword If 'identifier' in ${keys} Input text id=profileform-organization_edrpou ${data.identifier.id}
Run Keyword If 'address' in ${keys} JsSetScrollToElementBySelector \#profileform-organization_region_id
Run Keyword If 'address' in ${keys} Select From List By Label jquery=#profileform-organization_region_id ${data.address.region}
Run Keyword If 'address' in ${keys} Input Text jquery=#profileform-organization_postal_code ${data.address.postalCode}
Run Keyword If 'address' in ${keys} Input Text jquery=#profileform-organization_locality ${data.address.locality}
Run Keyword If 'address' in ${keys} Input Text jquery=#profileform-organization_street_address ${data.address.streetAddress}
JsSetScrollToElementBySelector \#user-profile-form .js-submit-btn
Click Element jquery=\#user-profile-form .js-submit-btn
Sleep 1
Wait Until Page Contains Контактна інформація успішно оновлена 60
Click Element xpath=//div[contains(@class, 'jconfirm-box')]//button[contains(@class, 'btn btn-default waves-effect waves-light btn-lg')]
InputClassificationByWrapper
[Arguments] ${wrapper} ${classification_id}
# Click Element jquery=${wrapper} a[href='#classification']
### Дочекатися І Клікнути xpath=//a[contains(@data-target,'#planform-classification_id')]
### Дочекатися І Клікнути xpath=${wrapper}//a[contains(@data-target,'-classification_id')]
Дочекатися І Клікнути jquery=${wrapper} a[data-target$="-classification_id"]
#cat Wait Until Element Is Visible xpath=//div[contains(@id, 'classification-modal')]//h4[contains(@id, 'classificationModalLabel')]
Wait Until Page Contains Element xpath=//div[contains(@id, 'classification-modal')]//h4[contains(@id, 'classificationModalLabel')]
#cat Sleep 1
Input text jquery=#classification-modal .js-search-wrapper .js-input ${classification_id}
# Input text xpath=//div[contains(@id, 'classification-modal')]//input[@class='form-control js-input'] ${classification_id}
#cat Input text xpath=//div[contains(@id, 'classification-modal')]//input[@class='form-control js-input'] 99999999-9
# Press key xpath=//div[contains(@id, 'classification-modal')]//input[@class='form-control js-input'] \\13
# Sleep 1
Wait Until Page Contains Element xpath=//div[contains(@id, 'classification-modal')]//strong[contains(., '${classification_id}')] 60
Click Element xpath=//div[contains(@id, 'classification-modal')]//strong[contains(., '${classification_id}')]
#cat Click Element xpath=//div[contains(@id, 'classification-modal')]//i[@class='jstree-icon jstree-checkbox']
Click Element jquery=#classification-modal div.modal-footer div.buttons-wrapper button.btn.btn-default.waves-effect.waves-light.js-submit
# Click Element xpath=//div[contains(@id, 'classification-modal')]//button[contains(@class, 'btn btn-default waves-effect waves-light js-submit')]
# Sleep 1
InputAdditionalClassificationsByWrapper
[Arguments] ${wrapper} ${additionalClassifications}
## Wait Until Element Is Visible xpath=${wrapper}//a[contains(@data-target,"additional_classification_ids")] 2
# Wait Until Element Is Visible jquery=${wrapper} a[href='#additionalclassification'] 2
## Дочекатися І Клікнути xpath=${wrapper}//a[contains(@data-target,"additional_classification_ids")]
Дочекатися І Клікнути jquery=${wrapper} a[data-target$="additional_classification_ids"]
Wait Until Element Is Visible jquery=${wrapper} a[data-target$="additional_classification_ids"] 2
# Wait Until Element Is Visible xpath=//div[contains(@id, 'additional-classification-modal')]//h4[contains(@id, 'additionalClassificationModalLabel')]
Wait Until Element Is Visible jquery=#additional-classification-modal #addclstab0 .js-search-wrapper .js-input
Sleep 1
${count}= Get Length ${additionalClassifications}
: FOR ${INDEX} IN RANGE 0 ${count}
\ Continue For Loop If '${additionalClassifications[${INDEX}].scheme}' == 'ДКПП' or '${additionalClassifications[${INDEX}].scheme}' == 'UA-ROAD' or '${additionalClassifications[${INDEX}].scheme}' == 'GMDN'
\ Click Element jquery=#additional-classification-modal .nav a[data-toggle="tab"][data-scheme="${additionalClassifications[${INDEX}].scheme}"]
\ Wait Until Element Is Visible jquery=#additional-classification-modal .tab-pane.tree-wrapper.active input.js-input
\ Input text jquery=#additional-classification-modal .tab-pane.tree-wrapper.active input.js-input ${additionalClassifications[${INDEX}].id}
\ Press key jquery=#additional-classification-modal .tab-pane.tree-wrapper.active input.js-input \\13
\ Sleep 2
\ Wait Until Page Contains Element jquery=#additional-classification-modal .tab-pane.tree-wrapper.active .tree.js-search-tree strong:contains("${additionalClassifications[${INDEX}].id}") 60
\ Click Element jquery=#additional-classification-modal .tab-pane.tree-wrapper.active .tree.js-search-tree li:first i.jstree-checkbox
Click Element xpath=//div[contains(@id, 'additional-classification-modal')]//button[contains(@class, 'js-submit')]
# Sleep 1
InputPlanItems
[Arguments] ${data}
${items}= Get From Dictionary ${data} items
${count}= Get Length ${items}
: FOR ${INDEX} IN RANGE 0 ${count}
\ InputPlanOneItem ${items[${INDEX}]}
InputPlanOneItem
[Arguments] ${data}
# ${wrapper}= Set Variable \#collapseItems .tab-content .tab-pane.active
${wrapper}= Set Variable \div.modal-form.js-form-popup.fancybox-content
### div.modal-content div.form-group.form-simple-group
${wrapper_classification}= Set Variable \div.modal modal-form js-form-popup fancybox-content
## div.modal.modal-form.js-form-popup.fancybox-content
${wrapper_classification_x}= Set Variable \//div[@class="modal modal-form js-form-popup fancybox-content"]
${keys}= Get Dictionary Keys ${data}
JsTabShowAndScroll ul.form-nav-tabs a[data-toggle='tab'][href='#collapseItems']
# Click Element jquery=#collapseItems a[href="#add-items"]
Scroll To Element xpath=//*[@id="plan-form"]//a[@class='btn btn-default btn-update js-form-popup-add']
Дочекатися і Клікнути xpath=//*[@id="plan-form"]//a[@class='btn btn-default btn-update js-form-popup-add']
Sleep 2
Wait Until Element Is Visible jquery=${wrapper} [id$='-description'] 3
Input text jquery=${wrapper} [id$='-description'] ${data.description}
## Wait Until Element Is Visible xpath=//input[contains(@class,'form-control js-title')] 3
## Input text xpath=//input[contains(@class,'form-control js-title')] ${data.description}
PlanUpdateItemQuantity ${wrapper} ${data.quantity}
### PlanUpdateItemQuantity ${wrapper} 40
JsSetScrollToElementBySelector ${wrapper} [id$='-unit_id']
### Click Element xpath=//span[@class='select2-selection__rendered'][contains(@id,'id-container')][contains(.,'Одиниці виміру')]
# Click Element jquery=${wrapper} [id$='-unit_id']
# Wait Until Element Is Visible jquery=${wrapper} [id$='-unit_id'] 3
Wait Until Page Contains Element jquery=${wrapper} [id$='-unit_id'] 3
### Execute Javascript $('${wrapper} select2-selection select2-selection--single').trigger("click")
Click Element jquery=${wrapper} span.select2-selection__rendered
Input text xpath=//span[contains(@class,'select2-search select2-search--dropdown')]//input[contains(@class,'select2-search__field')] ${data.unit.name}
Press key xpath=//span[contains(@class,'select2-search select2-search--dropdown')]//input[contains(@class,'select2-search__field')] \\13
# Select From List By Label jquery=${wrapper} [id$='-unit_id'] ${data.unit.name}
InputClassificationByWrapper ${wrapper} ${data.classification.id}
### InputClassificationByWrapper ${wrapper_classification} ${data.classification.id}
Run Keyword If 'additionalClassifications' in ${keys}
... InputAdditionalClassificationsByWrapper ${wrapper} ${data.additionalClassifications}
# PlanUpdateItemDeliveryEndDate ${wrapper} ${data.deliveryDate.endDate}
PlanUpdateItemDeliveryEndDateNew ${wrapper} ${data.deliveryDate.endDate}
Дочекатися і Клікнути jquery=${wrapper} a.btn.btn-success.js-popup-submit
TenderOpenByUAID
[Arguments] ${uaid}
Go To ${BROKERS['playtender'].basepage}/tender/${uaid}
Wait Until Page Contains Закупівля ${uaid} 60
TenderFormOpenByUAID
[Arguments] ${uaid}
TenderOpenByUAID ${uaid}
Click Element xpath=//a[contains(@href, '/tender/update')][1]
Sleep 1
Wait Until Page Contains Element id=tender-form 60
Sleep 1
PlanOpenByUAID
[Arguments] ${uaid}
Go To ${BROKERS['playtender'].basepage}/plan/${uaid}
Wait Until Page Contains ${uaid} 60
# Wait Until Page Contains План ${uaid} 60
PlanFormOpenByUAID
[Arguments] ${uaid}
PlanOpenByUAID ${uaid}
Click Element xpath=//a[contains(@href, '/plan/update')][1]
Wait Until Page Contains Редагування 60
Sleep 1
PlanUpdateItemQuantity
[Arguments] ${wrapper} ${quantity}
${quantity_srt}= Convert To String ${quantity}
JsSetScrollToElementBySelector ${wrapper} [id$='-quantity']
Input text jquery=${wrapper} [id$='-quantity'] ${quantity_srt}
PlanUpdateItemDeliveryEndDate
[Arguments] ${wrapper} ${delivery_end_date}
${date}= convert_isodate_to_site_datetime ${delivery_end_date}
JsInputHiddenText ${wrapper} [id$='-delivery_end_date'] ${date}
PlanUpdateItemDeliveryEndDateNew
[Arguments] ${wrapper} ${delivery_end_date}
${date}= convert_isodate_to_site_date ${delivery_end_date}
JsInputHiddenText ${wrapper} [id$='-delivery_end_date'] ${date}
PlanUpdateSave
JsSetScrollToElementBySelector \#submitBtn
Click Element xpath=//*[@id='submitBtn']
Sleep 1
Wait Until Page Contains План оновлений, дочекайтесь опублікування на сайті уповноваженого органу. 60
Click Element xpath=//div[contains(@class, 'jconfirm-box')]//button[contains(@class, 'btn btn-default waves-effect waves-light btn-lg')]
Wait For Sync Tender 60
JsInputHiddenText
[Arguments] ${selector} ${text}
Execute JavaScript jQuery("${selector}").val("${text}");
JsSetScrollToElementBySelector
[Arguments] ${selector}
Execute JavaScript scrollToElement("${selector}", 0, 10);
Sleep 100ms
JsCollapseShowAndScroll
[Arguments] ${selector}
Execute JavaScript jQuery("${selector}").collapse("show");
Sleep 500ms
JsSetScrollToElementBySelector ${selector}
JsTabShowAndScroll
[Arguments] ${selector}
Execute JavaScript jQuery("${selector}").tab("show");
Sleep 300ms
JsSetScrollToElementBySelector ${selector}
GetDictionaryKeyExist [Arguments] ${Dictionary Name} ${Key}
Run Keyword And Return Status Dictionary Should Contain Key ${Dictionary Name} ${Key}
GetValueFromDictionaryByKey [Arguments] ${Dictionary Name} ${Key}
${KeyIsPresent}= Run Keyword And Return Status Dictionary Should Contain Key ${Dictionary Name} ${Key}
${Value}= Run Keyword If ${KeyIsPresent} Get From Dictionary ${Dictionary Name} ${Key}
Return From Keyword ${Value}
GenerateFakeDocument
${file_path} ${file_name} ${file_content}= op_robot_tests.tests_files.service_keywords.Create Fake Doc
[return] ${file_path}
GenerateFakeText
${text}= Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
[return] ${text}
WaitPageSyncing
[Arguments] ${timeout}
${passed}= Run Keyword And Return Status Wait Until Keyword Succeeds ${timeout} s 0 s GetPageSyncingStatus
Run Keyword Unless ${passed} Fatal Error Sync Finish not finish in ${timeout} sec
GetPageSyncingStatus
Sleep 2
Reload Page
Sleep 1
Page Should Not Contain Element jquery=.wrapper .card-box .fa.fa-refresh
WaitTenderAuctionEnd
[Arguments] ${timeout}
${passed}= Run Keyword And Return Status Wait Until Keyword Succeeds ${timeout} s 0 s GetTenderAuctionEndStatus
Run Keyword Unless ${passed} Fatal Error Tender not changed status from active.auction in ${timeout} sec
GetTenderAuctionEndStatus
Sleep 60
Reload Page
Sleep 5
${tenderStatus}= get_invisible_text xpath=//*[contains(@class, 'hidden opstatus')]
Should Not Be Equal As Strings ${tenderStatus} active.auction
Input Float
[Arguments] ${input_jquery_selector} ${value}
${value}= convert_float_to_string ${value}
Input Text jquery=${input_jquery_selector} ${value}
Input Float Multiply100
[Arguments] ${input_jquery_selector} ${value}
${value}= multiply_hundred ${value}
Input Float ${input_jquery_selector} ${value}
Input DateTime
[Arguments] ${input_jquery_selector} ${date}
${date}= convert_datetime_for_delivery ${date}
${date}= Convert Date ${date} %d.%m.%Y %H:%M
Input Text jquery=${input_jquery_selector} ${date}
Input DateTime XPath
[Arguments] ${input_selector} ${date}
${date}= convert_datetime_for_delivery ${date}
${date}= Convert Date ${date} %d.%m.%Y %H:%M
Input Text xpath=//${input_selector} ${date}
Input Converted DateTime
[Arguments] ${input_jquery_selector} ${date}
Input Text jquery=${input_jquery_selector} ${date}
sleep 1s
execute javascript $("${input_jquery_selector}").blur();
sleep 100ms
Input Text With Checking Input Isset
[Arguments] ${input_jquery_selector} ${text}
Log ${input_jquery_selector}
${input_isset}= Run Keyword And Return Status Page Should Contain Element jquery=${input_jquery_selector}
Run Keyword If ${input_isset} Input Text jquery=${input_jquery_selector} ${text}
Input Text With Checking Input Isset XPath
[Arguments] ${input_selector} ${text}
Log ${input_selector}
${input_isset}= Run Keyword And Return Status Page Should Contain Element xpath=//${input_selector}
Run Keyword If ${input_isset} Input Text xpath=//${input_selector} ${text}
Select From List By Label With Checking Input Isset XPath
[Arguments] ${input_selector} ${text}
Log ${input_selector}
${input_isset}= Run Keyword And Return Status Page Should Contain Element xpath=//${input_selector}
Run Keyword If ${input_isset} Select From List By Label xpath=//${input_selector} ${text}
GetInputProcTypeByProcurementMethodType
[Arguments] ${procurementMethodType}
${playtender_proc_type}= Convert_to_Lowercase ${procurementMethodType}
${playtender_proc_type}= Remove String ${playtender_proc_type} \.
${playtender_proc_type}= Set Variable If '${playtender_proc_type}' == 'belowthreshold' ${EMPTY} ${playtender_proc_type}
[return] ${playtender_proc_type}
### EOF - HELPERS ###
Дочекатися і Клікнути
[Arguments] ${locator}
Wait Until Keyword Succeeds 15 x 1 s Element Should Be Visible ${locator}
Scroll To Element ${locator}
Click Element ${locator}
Scroll To Element
[Arguments] ${locator}
${elem_vert_pos}= Get Vertical Position ${locator}
Execute Javascript window.scrollTo(0,${elem_vert_pos - 300});
CheckAlertMessageAndCloseIt
Дочекатися і Клікнути xpath=//div[@class='closeIcon'][contains(.,'×')]