Commit eb15f058cb79dd5452bf38b91cbbc5eb69c72302
1 parent
ce5122ed
відображення_title+додавання_і_редагування_тендеру
Showing
2 changed files
with
113 additions
and
74 deletions
... | ... | @@ -7,6 +7,10 @@ Library DateTime |
7 | 7 | ${locator.tenderId} jquery=h3 |
8 | 8 | ##Використовую такий шлях у кожного буде мінятись /yboi/. Міняйте на сві шлях до файлу |
9 | 9 | ${file_path} /home/yboi/openprocurement.robottests.buildout/Document.docx |
10 | +${locator.title} xpath=(//div[@class = 'col-sm-8']/p[@class='ng-binding'])[6] | |
11 | +${locator.description} xpath=(//div[@class = 'col-sm-8']/p[@class='ng-binding'])[7] | |
12 | +${locator.minimalStep.amount} xpath=(//div[@class = 'col-sm-8']/p[@class='ng-binding'])[9] | |
13 | +${locator.value.amount} xpath=(//div[@class = 'col-sm-8']/p[@class='ng-binding'])[8] | |
10 | 14 | |
11 | 15 | *** Keywords *** |
12 | 16 | Підготувати клієнт для користувача |
... | ... | @@ -16,7 +20,9 @@ ${file_path} /home/yboi/openprocurement.robottests.buildout/Document.docx |
16 | 20 | Open Browser ${USERS.users['${ARGUMENTS[0]}'].homepage} ${USERS.users['${username}'].browser} alias=${ARGUMENTS[0]} |
17 | 21 | Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size} |
18 | 22 | Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position} |
19 | -# login | |
23 | + Run Keyword If '${username}' != 'E-tender_Viewer' Login | |
24 | + | |
25 | +Login | |
20 | 26 | Wait Until Page Contains Element id=inputUsername 100 |
21 | 27 | Input text id=inputUsername ${USERS.users['${username}'].login} |
22 | 28 | Wait Until Page Contains Element id=inputPassword 100 |
... | ... | @@ -37,8 +43,6 @@ ${file_path} /home/yboi/openprocurement.robottests.buildout/Document.docx |
37 | 43 | ${items_description}= Get From Dictionary ${tender_data.data} description |
38 | 44 | ${quantity}= Get From Dictionary ${items[0]} quantity |
39 | 45 | ${cpv}= Get From Dictionary ${items[0].classification} id |
40 | - ${dkpp_desc}= Get From Dictionary ${items[0].additionalClassifications[0]} description | |
41 | - ${dkpp_id}= Get From Dictionary ${items[0].additionalClassifications[0]} id | |
42 | 46 | ${unit}= Get From Dictionary ${items[0].unit} name |
43 | 47 | ${start_date}= Get From Dictionary ${tender_data.data.tenderPeriod} startDate |
44 | 48 | ${start_date}= convert_date_to_etender_format ${start_date} |
... | ... | @@ -77,7 +81,6 @@ ${file_path} /home/yboi/openprocurement.robottests.buildout/Document.docx |
77 | 81 | Input text xpath=//div[contains(@class, 'form-group col-sm-8')]//div[contains(@class, 'col-sm-2')]//input[@ng-model='data.tenderPeriod.endDate'] ${end_time} |
78 | 82 | Sleep 2 |
79 | 83 | Click Element xpath=//div[contains(@class, 'col-sm-2')]//input[@data-target='#classification'] |
80 | - Wait Until Element Is Visible xpath=//div[contains(@role,'dialog')] | |
81 | 84 | Sleep 1 |
82 | 85 | Input text xpath=//div[contains(@class, 'modal-content')]//input[@ng-model='searchstring'] ${cpv} |
83 | 86 | Sleep 2 |
... | ... | @@ -86,24 +89,18 @@ ${file_path} /home/yboi/openprocurement.robottests.buildout/Document.docx |
86 | 89 | Sleep 1 |
87 | 90 | Click Element xpath=//div[contains(@class, 'modal-content')]//button[@ng-click='choose()'] |
88 | 91 | Sleep 1 |
89 | - Click Element xpath=//div[contains(@class, 'col-sm-2')]//input[@data-target='#addClassification'] | |
90 | - Wait Until Element Is Visible xpath=//div[contains(@id,'addClassification')] | |
91 | - Sleep 1 | |
92 | - Input text xpath=//div[contains(@class, 'modal fade ng-scope in')]//input[@ng-model='searchstring'] ${dkpp_desc} | |
93 | - Wait Until Page Contains ${dkpp_id} | |
94 | - Sleep 1 | |
95 | - Click Element xpath=//td[contains(., '${dkpp_id}')] | |
96 | - Click Element xpath=//div[contains(@class, 'modal fade ng-scope in')]//button[@ng-click='choose()'] | |
97 | - Run Keyword if '${mode}' == 'multi' Додати предмет items | |
92 | + Додати предмет ${items[0]} 0 | |
93 | + Run Keyword if '${mode}' == 'multi' Додати багато предметів items | |
98 | 94 | Sleep 1 |
99 | 95 | Wait Until Page Contains Element xpath=//div[contains(@class, 'form-actions')]//button[@type='submit'] |
100 | 96 | Click Element xpath=//div[contains(@class, 'form-actions')]//button[@type='submit'] |
101 | 97 | Sleep 1 |
102 | 98 | Wait Until Page Contains [ТЕСТУВАННЯ] 100 |
103 | - Click Element xpath=//table[contains(@class, 'table table-hover table-striped table-bordered ng-scope ng-table')]//tr[1]//a | |
99 | + Sleep 20 | |
100 | + Click Element xpath=//*[text()='${title}'] | |
104 | 101 | Sleep 5 |
105 | 102 | ${tender_UAid}= Get Text xpath=//div[contains(@class, "panel-heading")] |
106 | - ${tender_UAid}= Get Substring ${tender_UAid} 7 | |
103 | + ${tender_UAid}= Get Substring ${tender_UAid} 10 | |
107 | 104 | ${Ids}= Convert To String ${tender_UAid} |
108 | 105 | Run keyword if '${mode}' == 'multi' Set Multi Ids ${ARGUMENTS[0]} ${tender_UAid} |
109 | 106 | [return] ${Ids} |
... | ... | @@ -111,52 +108,37 @@ ${file_path} /home/yboi/openprocurement.robottests.buildout/Document.docx |
111 | 108 | Set Multi Ids |
112 | 109 | [Arguments] @{ARGUMENTS} |
113 | 110 | [Documentation] |
114 | - ... ${ARGUMENTS[0]} == username | |
115 | - ${id}= Get Text xpath=//div[contains(@class, "panel-heading")] | |
116 | - ${Ids}= Create List ${tender_UAid} ${id} | |
111 | + ... ${ARGUMENTS[0]} == ${tender_UAid} | |
112 | + ${current_location}= Get Location | |
113 | + ${id}= Get Substring ${current_location} 10 | |
114 | + ${Ids}= Create List ${tender_UAid} ${id} | |
117 | 115 | |
118 | 116 | Додати предмет |
119 | 117 | [Arguments] @{ARGUMENTS} |
120 | 118 | [Documentation] |
121 | 119 | ... ${ARGUMENTS[0]} == items |
122 | - ${dkpp_desc1}= Get From Dictionary ${items[1].additionalClassifications[0]} description | |
123 | - ${dkpp_id1}= Get From Dictionary ${items[1].additionalClassifications[0]} id | |
124 | - ${dkpp_desc2}= Get From Dictionary ${items[2].additionalClassifications[0]} description | |
125 | - ${dkpp_id2}= Get From Dictionary ${items[2].additionalClassifications[0]} id | |
126 | - ${dkpp_desc3}= Get From Dictionary ${items[3].additionalClassifications[0]} description | |
127 | - ${dkpp_id3}= Get From Dictionary ${items[3].additionalClassifications[0]} id | |
128 | - | |
129 | - Wait Until Page Contains Element xpath=.//*[@id='myform']/tender-form/div/button 100 | |
130 | - Sleep 2 | |
131 | - Click Element xpath=.//*[@id='myform']/tender-form/div/button | |
120 | + ... ${ARGUMENTS[1]} == ${INDEX} | |
121 | + ${dkpp_desc}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} description | |
122 | + ${dkpp_id}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} id | |
132 | 123 | Sleep 2 |
133 | - Click Element xpath=(//div[contains(@class, 'col-sm-2')]//input[@data-target='#addClassification'])[2] | |
124 | + Click Element xpath=(//div[contains(@class, 'col-sm-2')]//input[@data-target='#addClassification'])[${ARGUMENTS[1]}+1] | |
134 | 125 | Wait Until Element Is Visible xpath=//div[contains(@id,'addClassification')] |
135 | - Input text xpath=//div[contains(@class, 'modal fade ng-scope in')]//input[@ng-model='searchstring'] ${dkpp_desc1} | |
136 | - Wait Until Page Contains ${dkpp_id1} | |
137 | - Sleep 1 | |
138 | - Click Element xpath=//td[contains(., '${dkpp_id1}')] | |
139 | - Click Element xpath=//div[contains(@class, 'modal fade ng-scope in')]//button[@ng-click='choose()'] | |
140 | 126 | Sleep 2 |
141 | - Click Element xpath=.//*[@id='myform']/tender-form/div/button | |
142 | - Sleep 2 | |
143 | - Click Element xpath=(//div[contains(@class, 'col-sm-2')]//input[@data-target='#addClassification'])[3] | |
144 | - Wait Until Element Is Visible xpath=//div[contains(@id,'addClassification')] | |
145 | - Input text xpath=//div[contains(@class, 'modal fade ng-scope in')]//input[@ng-model='searchstring'] ${dkpp_desc2} | |
146 | - Wait Until Page Contains ${dkpp_id2} | |
127 | + Input text xpath=//div[contains(@class, 'modal fade ng-scope in')]//input[@ng-model='searchstring'] ${dkpp_desc} | |
128 | + Wait Until Page Contains ${dkpp_id} | |
147 | 129 | Sleep 1 |
148 | - Click Element xpath=//td[contains(., '${dkpp_id2}')] | |
130 | + Click Element xpath=//td[contains(., '${dkpp_id}')] | |
149 | 131 | Click Element xpath=//div[contains(@class, 'modal fade ng-scope in')]//button[@ng-click='choose()'] |
150 | 132 | Sleep 2 |
151 | - Click Element xpath=.//*[@id='myform']/tender-form/div/button | |
152 | - Sleep 2 | |
153 | - Click Element xpath=(//div[contains(@class, 'col-sm-2')]//input[@data-target='#addClassification'])[4] | |
154 | - Wait Until Element Is Visible xpath=//div[contains(@id,'addClassification')] | |
155 | - Input text xpath=//div[contains(@class, 'modal fade ng-scope in')]//input[@ng-model='searchstring'] ${dkpp_desc3} | |
156 | - Wait Until Page Contains ${dkpp_id3} | |
157 | - Sleep 1 | |
158 | - Click Element xpath=//td[contains(., '${dkpp_id3}')] | |
159 | - Click Element xpath=//div[contains(@class, 'modal fade ng-scope in')]//button[@ng-click='choose()'] | |
133 | + | |
134 | +Додати багато предметів | |
135 | + [Arguments] @{ARGUMENTS} | |
136 | + [Documentation] | |
137 | + ... ${ARGUMENTS[0]} == items | |
138 | + ${Items_length}= Get Length ${items} | |
139 | + : FOR ${INDEX} IN RANGE 1 ${Items_length} | |
140 | + \ Click Element xpath=.//*[@id='myform']/tender-form/div/button | |
141 | + \ Додати предмет ${items[${INDEX}]} ${INDEX} | |
160 | 142 | |
161 | 143 | Пошук тендера по ідентифікатору |
162 | 144 | [Arguments] @{ARGUMENTS} |
... | ... | @@ -238,6 +220,61 @@ Set Multi Ids |
238 | 220 | Wait Until Page Contains ${ARGUMENTS[1]} 10 |
239 | 221 | sleep 1 |
240 | 222 | |
223 | +Внести зміни в тендер | |
224 | + [Arguments] @{ARGUMENTS} | |
225 | + [Documentation] | |
226 | + ... ${ARGUMENTS[0]} = username | |
227 | + ... ${ARGUMENTS[1]} = ${TENDER_UAID} | |
228 | + ${ADDITIONAL_DATA}= prepare_test_tender_data ${BROKERS['${USERS.users['${tender_owner}'].broker}'].period_interval} single | |
229 | + ${tender_data}= Add_time_for_GUI_FrontEnds ${ADDITIONAL_DATA} | |
230 | + ${items}= Get From Dictionary ${tender_data.data} items | |
231 | + ${description}= Get From Dictionary ${tender_data.data} description | |
232 | + Selenium2Library.Switch Browser ${ARGUMENTS[0]} | |
233 | + etender.Пошук тендера по ідентифікатору ${ARGUMENTS[0]} ${ARGUMENTS[1]} | |
234 | + Wait Until Page Contains Element xpath=//a[@class='btn btn-primary ng-scope'] 10 | |
235 | + Click Element xpath=//a[@class='btn btn-primary ng-scope'] | |
236 | + Sleep 2 | |
237 | + Input text id=description ${description} | |
238 | + Click Element xpath=//button[@class='btn btn-info ng-isolate-scope'] | |
239 | + Capture Page Screenshot | |
240 | + | |
241 | +додати предмети закупівлі | |
242 | + [Arguments] @{ARGUMENTS} | |
243 | + [Documentation] | |
244 | + ... ${ARGUMENTS[0]} = username | |
245 | + ... ${ARGUMENTS[1]} = ${TENDER_UAID} | |
246 | + ... ${ARGUMENTS[2]} = 3 | |
247 | + ${ADDITIONAL_DATA}= prepare_test_tender_data ${BROKERS['${USERS.users['${tender_owner}'].broker}'].period_interval} multi | |
248 | + ${tender_data}= Add_time_for_GUI_FrontEnds ${ADDITIONAL_DATA} | |
249 | + ${items}= Get From Dictionary ${tender_data.data} items | |
250 | + Selenium2Library.Switch Browser ${ARGUMENTS[0]} | |
251 | + Run keyword if '${TEST NAME}' == 'Можливість додати позицію закупівлі в тендер' додати позицію | |
252 | + Run keyword if '${TEST NAME}' != 'Можливість додати позицію закупівлі в тендер' видалити позиції | |
253 | + | |
254 | +додати позицію | |
255 | + etender.Пошук тендера по ідентифікатору ${ARGUMENTS[0]} ${ARGUMENTS[1]} | |
256 | + Sleep 2 | |
257 | + Click Element xpath=//a[@class='btn btn-primary ng-scope'] | |
258 | + Sleep 2 | |
259 | + : FOR ${INDEX} IN RANGE 1 ${ARGUMENTS[2]} +1 | |
260 | + \ Click Element xpath=.//*[@id='myform']/tender-form/div/button | |
261 | + \ Додати предмет ${items[${INDEX}]} ${INDEX} | |
262 | + Sleep 2 | |
263 | + Click Element xpath=//div[@class='form-actions']/button[./text()='Зберегти зміни'] | |
264 | + Wait Until Page Contains [ТЕСТУВАННЯ] 100 | |
265 | + | |
266 | +видалити позиції | |
267 | + etender.Пошук тендера по ідентифікатору ${ARGUMENTS[0]} ${ARGUMENTS[1]} | |
268 | + Click Element xpath=//a[@class='btn btn-primary ng-scope'] | |
269 | + Sleep 2 | |
270 | + : FOR ${INDEX} IN RANGE 1 ${ARGUMENTS[2]} +1 | |
271 | + \ Click Element xpath=(//button[@class='btn btn-danger ng-scope'])[last()] | |
272 | + \ Sleep 1 | |
273 | + Sleep 2 | |
274 | + Wait Until Page Contains Element xpath=//div[@class='form-actions']/button[./text()='Зберегти зміни'] 10 | |
275 | + Click Element xpath=//div[@class='form-actions']/button[./text()='Зберегти зміни'] | |
276 | + Wait Until Page Contains [ТЕСТУВАННЯ] 100 | |
277 | + | |
241 | 278 | отримати інформацію із тендера |
242 | 279 | [Arguments] @{ARGUMENTS} |
243 | 280 | [Documentation] |
... | ... | @@ -245,15 +282,9 @@ Set Multi Ids |
245 | 282 | ... ${ARGUMENTS[1]} == fieldname |
246 | 283 | Switch browser ${ARGUMENTS[0]} |
247 | 284 | ${return_value}= run keyword отримати інформацію про ${ARGUMENTS[1]} |
285 | + Log ${return_value} | |
248 | 286 | [return] ${return_value} |
249 | 287 | |
250 | -Відмітити на сторінці поле з тендера | |
251 | - [Arguments] ${fieldname} ${locator} | |
252 | - ${last_note_id}= Add pointy note ${locator} Found ${fieldname} width=200 position=bottom | |
253 | - Align elements horizontally ${locator} ${last_note_id} | |
254 | - sleep 1 | |
255 | - Remove element ${last_note_id} | |
256 | - | |
257 | 288 | Отримати тест із поля і показати на сторінці |
258 | 289 | [Arguments] ${fieldname} |
259 | 290 | sleep 3 |
... | ... | @@ -261,33 +292,41 @@ Set Multi Ids |
261 | 292 | ${return_value}= Get Text ${locator.${fieldname}} |
262 | 293 | [return] ${return_value} |
263 | 294 | |
264 | -отримати інформацію про tenderId | |
265 | - ${return_value}= Отримати тест із поля і показати на сторінці tenderId | |
266 | - [return] ${return_value.split(' ')[1]} | |
267 | - | |
268 | 295 | отримати інформацію про title |
269 | 296 | ${return_value}= Отримати тест із поля і показати на сторінці title |
270 | 297 | [return] ${return_value} |
271 | 298 | |
272 | 299 | отримати інформацію про description |
273 | - ${description}= Get text xpath=(//div[@class = 'col-sm-8'])[8] | |
274 | - [return] ${description} | |
300 | + ${return_value}= Отримати тест із поля і показати на сторінці description | |
301 | + [return] ${return_value} | |
275 | 302 | |
276 | 303 | отримати інформацію про minimalStep.amount |
277 | - ${step_rate}= Get text xpath=(//div[@class = 'col-sm-8'])[10] | |
278 | - ${step_rate}= Convert To Number ${step_rate.split(' ')[0]} | |
279 | - [return] ${step_rate} | |
304 | + ${return_value}= Отримати тест із поля і показати на сторінці minimalStep.amount | |
305 | + ${return_value}= Convert To Number ${return_value.split(' ')[0]} | |
306 | + [return] ${return_value} | |
307 | + | |
308 | +отримати інформацію про value.amount | |
309 | + ${return_value}= Отримати тест із поля і показати на сторінці value.amount | |
310 | + ${return_value}= Evaluate "".join("${return_value}".split(' ')[:-3]) | |
311 | + ${return_value}= Convert To Number ${return_value} | |
312 | + [return] ${return_value} | |
313 | + | |
314 | +Відмітити на сторінці поле з тендера | |
315 | + [Arguments] ${fieldname} ${locator} | |
316 | + ${last_note_id}= Add pointy note ${locator} Found ${fieldname} width=200 position=bottom | |
317 | + Align elements horizontally ${locator} ${last_note_id} | |
318 | + sleep 1 | |
319 | + Remove element ${last_note_id} | |
320 | + | |
321 | +отримати інформацію про tenderId | |
322 | + ${return_value}= отримати тест із поля і показати на сторінці tenderId | |
323 | + ${return_value}= Get Substring ${return_value} 10 | |
324 | + [return] ${return_value} | |
280 | 325 | |
281 | 326 | отримати інформацію про procuringEntity.name |
282 | 327 | ${return_value}= Отримати тест із поля і показати на сторінці procuringEntity.name |
283 | 328 | [return] ${return_value} |
284 | 329 | |
285 | -отримати інформацію про value.amount | |
286 | - ${budget}= Get text xpath=(//div[@class = 'col-sm-8'])[9] | |
287 | - ${budget}= Evaluate "".join("${budget}".split(' ')[:-3]) | |
288 | - ${budget}= Convert To Number ${budget} | |
289 | - [return] ${budget} | |
290 | - | |
291 | 330 | отримати інформацію про tenderPeriod.startDate |
292 | 331 | ${return_value}= Отримати тест із поля і показати на сторінці tenderPeriod.startDate |
293 | 332 | [return] ${return_value} |
... | ... | @@ -304,7 +343,6 @@ Set Multi Ids |
304 | 343 | ${return_value}= Отримати тест із поля і показати на сторінці enquiryPeriod.endDate |
305 | 344 | [return] ${return_value} |
306 | 345 | |
307 | - | |
308 | 346 | отримати інформацію про items[${item_id}].description |
309 | 347 | відмітити на сторінці поле з тендера items[${item_id}].description jquery=tender-subject-info.ng-isolate-scope>div.row:contains("Детальний опис предмету закупівлі:")>:eq(1)> |
310 | 348 | ${return_value}= Get Text jquery=tender-subject-info.ng-isolate-scope>div.row:contains("Детальний опис предмету закупівлі:")>:eq(1)> | ... | ... |
... | ... | @@ -17,7 +17,7 @@ users: |
17 | 17 | homepage: "http://uat.e-tender.biz/#/profile" |
18 | 18 | login: Misha2 |
19 | 19 | password: Password1 |
20 | - browser: chrome | |
20 | + browser: firefox | |
21 | 21 | position: [0, 1000] |
22 | 22 | size: [740, 550] |
23 | 23 | E-tender_Provider1: |
... | ... | @@ -41,6 +41,7 @@ users: |
41 | 41 | E-tender_Viewer: |
42 | 42 | broker: E-tender |
43 | 43 | username: E-tendertest |
44 | + homepage: "http://uat.e-tender.biz/#/profile" | |
44 | 45 | browser: firefox |
45 | 46 | position: [0, 0] |
46 | 47 | size: [640, 450] | ... | ... |
Please
register
or
login
to post a comment