publicbid.robot
11.5 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
*** Settings ***
Library Selenium2Screenshots
Library String
Library DateTime
*** Variables ***
${mail} test@mail.com
${telephone} +380976535447
*** Keywords ***
Підготувати клієнт для користувача
[Arguments] @{ARGUMENTS}
[Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо
... ${ARGUMENTS[0]} == username
Open Browser ${USERS.users['${ARGUMENTS[0]}'].homepage} ${USERS.users['${username}'].browser} alias=${ARGUMENTS[0]}
Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size}
Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position}
# login
Run Keyword And Ignore Error Wait Until Page Contains Element id=mForm:j_idt56 10
Click Element id=mForm:j_idt56
Run Keyword And Ignore Error Wait Until Page Contains Element id=mForm:email 10
Input text id=mForm:email ${USERS.users['${username}'].login}
Sleep 2
Input text id=mForm:pwd ${USERS.users['${username}'].password}
Click Button id=mForm:login
Створити тендер
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tender_data
${file_path}= local_path_to_file TestDocument.docx
${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]}
${items}= Get From Dictionary ${prepared_tender_data.data} items
${title}= Get From Dictionary ${prepared_tender_data.data} title
${description}= Get From Dictionary ${prepared_tender_data.data} description
${budget}= Get From Dictionary ${prepared_tender_data.data.value} amount
${step_rate}= Get From Dictionary ${prepared_tender_data.data.minimalStep} amount
${countryName}= Get From Dictionary ${prepared_tender_data.data.procuringEntity.address} countryName
${delivery_end_date}= Get From Dictionary ${items[0].deliveryDate} endDate
${delivery_end_date}= convert_datetime_to_dot_format ${delivery_end_date}
${cpv}= Convert To String "Картонки"
${cpv_id}= Get From Dictionary ${items[0].classification} id
${cpv_id_1}= Get Substring ${cpv_id} 0 3
${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description
${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id
${code}= Get From Dictionary ${items[0].unit} code
${quantity}= Get From Dictionary ${items[0]} quantity
${name}= Get From Dictionary ${prepared_tender_data.data.procuringEntity.contactPoint} name
Selenium2Library.Switch Browser ${ARGUMENTS[0]}
Wait Until Page Contains Element xpath=//*[contains(@class, 'ui-button-text ui-c')][./text()='Нова закупівля'] 10
Click Element xpath=//*[contains(@class, 'ui-button-text ui-c')][./text()='Нова закупівля']
Wait Until Page Contains Element id=mForm:data:name
Input text id=mForm:data:name ${title}
Input text id=mForm:data:desc ${description}
Input text id=mForm:data:budget ${budget}
Input text id=mForm:data:step ${step_rate}
Click Element xpath=//*[@id='mForm:data:vat']/tbody/tr/td[1]//span
Input text id=mForm:data:dEPr_input ${delivery_end_date}
Click Element id=mForm:data:cKind_label
Click Element xpath=//div[@id='mForm:data:cKind_panel']//li[3]
Input text id=mForm:data:cCpvGr_input ${cpv_id_1}
Wait Until Page Contains Element xpath=.//*[@id='mForm:data:cCpvGr_panel']/table/tbody/tr/td[2]/span 10
Click Element xpath=.//*[@id='mForm:data:cCpvGr_panel']/table/tbody/tr/td[2]/span
Input text id=mForm:data:subject0 ${dkpp_desc}
Input text id=mForm:data:cCpv0_input ${cpv_id}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cCpv0_panel']//td[1]/span 10
Click Element xpath=//div[@id='mForm:data:cCpv0_panel']//td[1]/span
Input text id=mForm:data:unit0_input ${code}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:unit0_panel']//tr/td[1] 10
Click Element xpath=//div[@id='mForm:data:unit0_panel']//tr/td[1]
Input text id=mForm:data:amount0 ${quantity}
Input text id=mForm:data:cDkpp0_input ${dkpp_id}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cDkpp0_panel']//tr[1]/td[2]/span 10
Click Element xpath=//div[@id='mForm:data:cDkpp0_panel']//tr[1]/td[2]/span
Input text id=mForm:data:rName ${name}
Input text id=mForm:data:rPhone ${telephone}
Input text id=mForm:data:rMail ${mail}
Choose File id=mForm:data:docFile_input ${file_path}
Sleep 2
Run Keyword if '${mode}' == 'multi' Додати предмет items
# Save
Click Element id=mForm:bSave
Sleep 5
# Announce
Click Element xpath=//span[text()="Оголосити"]
Sleep 2
# Confirm in message box
Click Element xpath=//div[contains(@class, "ui-confirm-dialog") and @aria-hidden="false"]//span[text()="Оголосити"]
# More smart wait for id is needed there.
Sleep 5
${tender_UAid}= Get Text id=mForm:nBid
${tender_UAid}= Get Substring ${tender_UAid} 19
${Ids} Convert To String ${tender_UAid}
Run keyword if '${mode}' == 'multi' Set Multi Ids ${tender_UAid}
[return] ${Ids}
Set Multi Ids
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == ${tender_UAid}
${id}= Get Text id=mForm:nBid
${Ids} Create List ${tender_UAid} ${id}
Додати предмет
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == items
${dkpp_desc1}= Get From Dictionary ${items[1].additionalClassifications[0]} description
${dkpp_id11}= Get From Dictionary ${items[1].additionalClassifications[0]} id
${dkpp_desc2}= Get From Dictionary ${items[2].additionalClassifications[0]} description
${dkpp_id2}= Get From Dictionary ${items[2].additionalClassifications[0]} id
${dkpp_desc3}= Get From Dictionary ${items[3].additionalClassifications[0]} description
${dkpp_id3}= Get From Dictionary ${items[3].additionalClassifications[0]} id
Wait Until Page Contains Element xpath=//button[@class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"] 10
Wait Until Page Contains Element xpath=//button[contains(@class, 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only')] 10
Wait Until Page Contains Element xpath=//button[@id="mForm:data:j_idt911"]|//button[@id="mForm:data:j_idt726"] 10
Click Element xpath=//button[@id="mForm:data:j_idt911"]|//button[@id="mForm:data:j_idt726"]
Wait Until Page Contains Element id=mForm:data:subject1 10
Input text id=mForm:data:subject1 ${dkpp_desc1}
Input text id=mForm:data:cCpv1_input ${cpv_id}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cCpv1_panel']/table/tbody/tr/td[1]/span 10
Click Element xpath=//div[@id='mForm:data:cCpv1_panel']/table/tbody/tr/td[1]/span
Input text id=mForm:data:unit1_input ${code}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:unit1_panel']/table/tbody/tr/td[1] 10
Click Element xpath=//div[@id='mForm:data:unit1_panel']/table/tbody/tr/td[1]
Input text id=mForm:data:amount1 ${quantity}
Input text id=mForm:data:cDkpp1_input ${dkpp_id11}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cDkpp1_panel']/table/tbody/tr/td[1]/span 10
Click Element xpath=//div[@id='mForm:data:cDkpp1_panel']/table/tbody/tr/td[1]/span
Click Element xpath=//button[@id="mForm:data:j_idt911"]|//button[@id="mForm:data:j_idt726"]
Wait Until Page Contains Element id=mForm:data:subject2 10
Input text id=mForm:data:subject2 ${dkpp_desc2}
Input text id=mForm:data:cCpv2_input ${cpv_id}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cCpv2_panel']/table/tbody/tr/td[1]/span 10
Click Element xpath=//div[@id='mForm:data:cCpv2_panel']/table/tbody/tr/td[1]/span
Input text id=mForm:data:unit2_input ${code}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:unit2_panel']/table/tbody/tr/td[1] 10
Click Element xpath=//div[@id='mForm:data:unit2_panel']/table/tbody/tr/td[1]
Input text id=mForm:data:amount2 ${quantity}
Input text id=mForm:data:cDkpp2_input ${dkpp_id2}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cDkpp2_panel']/table/tbody/tr/td[1]/span 10
Click Element xpath=//div[@id='mForm:data:cDkpp2_panel']/table/tbody/tr/td[1]/span
Click Element xpath=//button[@id="mForm:data:j_idt911"]|//button[@id="mForm:data:j_idt726"]
Wait Until Page Contains Element id=mForm:data:subject3 10
Input text id=mForm:data:subject3 ${dkpp_desc3}
Input text id=mForm:data:cCpv3_input ${cpv_id}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cCpv3_panel']/table/tbody/tr/td[1]/span 10
Click Element xpath=//div[@id='mForm:data:cCpv3_panel']/table/tbody/tr/td[1]/span
Input text id=mForm:data:unit3_input ${code}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:unit3_panel']/table/tbody/tr/td[1] 10
Click Element xpath=//div[@id='mForm:data:unit3_panel']/table/tbody/tr/td[1]
Input text id=mForm:data:amount3 ${quantity}
Input text id=mForm:data:cDkpp3_input ${dkpp_id3}
Wait Until Page Contains Element xpath=//div[@id='mForm:data:cDkpp3_panel']/table/tbody/tr/td[1]/span 10
Click Element xpath=//div[@id='mForm:data:cDkpp3_panel']/table/tbody/tr/td[1]/span
Пошук тендера по ідентифікатору
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tenderId
... ${ARGUMENTS[2]} == id
Switch browser ${ARGUMENTS[0]}
${current_location}= Get Location
Wait Until Page Contains Офіційний майданчик державних закупівель України 10
sleep 1
Input Text id=j_idt18:datalist:j_idt67 ${ARGUMENTS[1]}
sleep 2
${last_note_id}= Add pointy note jquery=a[href^="#/tenderDetailes"] Found tender with tenderID "${ARGUMENTS[1]}" width=200 position=bottom
sleep 1
Remove element ${last_note_id}
Click Link jquery=a[href^="#/tenderDetailes"]
Wait Until Page Contains ${ARGUMENTS[1]} 10
sleep 1
Capture Page Screenshot