Commit edd76b4f32b06ccc8f19520806856604941c447d
1 parent
e3018bb7
plans
- updated: opening plan by uaid with updating queue for viewer
Showing
4 changed files
with
57 additions
and
20 deletions
@@ -30,8 +30,8 @@ Resource playtender_plan. | @@ -30,8 +30,8 @@ Resource playtender_plan. | ||
30 | ... час запуску тесту. | 30 | ... час запуску тесту. |
31 | 31 | ||
32 | ${tender_data_keys} = get dictionary keys ${tender_data['data']} | 32 | ${tender_data_keys} = get dictionary keys ${tender_data['data']} |
33 | - run keyword if '${test_role}' == 'tender_owner' and 'procuringEntity' in ${tender_data_keys} prepare procuring entity data ${tender_data['data']['procuringEntity']} | ||
34 | - #run keyword if '${test_role}' == 'tender_owner' and 'buyers' in ${tender_data_keys} prepare buyers data ${tender_data['data']['buyers']} | 33 | + run keyword if ${is_test_role_owner} and 'procuringEntity' in ${tender_data_keys} prepare procuring entity data ${tender_data['data']['procuringEntity']} |
34 | + #run keyword if ${is_test_role_owner} and 'buyers' in ${tender_data_keys} prepare buyers data ${tender_data['data']['buyers']} | ||
35 | [Return] ${tender_data} | 35 | [Return] ${tender_data} |
36 | 36 | ||
37 | Створити план | 37 | Створити план |
@@ -14,6 +14,7 @@ ${broker_baseurl} = | @@ -14,6 +14,7 @@ ${broker_baseurl} = | ||
14 | ${broker_browser} = | 14 | ${broker_browser} = |
15 | ${broker_language_code} = uk | 15 | ${broker_language_code} = uk |
16 | ${test_role} = | 16 | ${test_role} = |
17 | +${is_test_role_owner} = | ||
17 | 18 | ||
18 | @{browser_default_size} = ${1200} ${1000} | 19 | @{browser_default_size} = ${1200} ${1000} |
19 | @{browser_default_position} = ${0} ${0} | 20 | @{browser_default_position} = ${0} ${0} |
@@ -30,6 +31,8 @@ init environment | @@ -30,6 +31,8 @@ init environment | ||
30 | set global variable ${broker_baseurl} ${BROKERS['${broker}'].basepage} | 31 | set global variable ${broker_baseurl} ${BROKERS['${broker}'].basepage} |
31 | set global variable ${broker_browser} ${USERS.users['${broker_username}'].browser} | 32 | set global variable ${broker_browser} ${USERS.users['${broker_username}'].browser} |
32 | set global variable ${test_role} ${ROLE} | 33 | set global variable ${test_role} ${ROLE} |
34 | + ${is_test_role_owner} = set variable if '${test_role}' == 'tender_owner' ${True} ${False} | ||
35 | + set global variable ${is_test_role_owner} ${is_test_role_owner} | ||
33 | 36 | ||
34 | set site language by code | 37 | set site language by code |
35 | [Arguments] ${language_code} | 38 | [Arguments] ${language_code} |
@@ -113,7 +116,7 @@ input text to exist visible input | @@ -113,7 +116,7 @@ input text to exist visible input | ||
113 | [Arguments] ${locator} ${text} | 116 | [Arguments] ${locator} ${text} |
114 | [Documentation] перевіряє чи елемент існує і видимий у вікні браузера, після чого заповнює його | 117 | [Documentation] перевіряє чи елемент існує і видимий у вікні браузера, після чого заповнює його |
115 | 118 | ||
116 | - ${input_exists} = __private__get_is_element_exist ${locator} | 119 | + ${input_exists} = get is element exist ${locator} |
117 | run keyword if ${input_exists} == ${True} input text to visible input ${locator} ${text} | 120 | run keyword if ${input_exists} == ${True} input text to visible input ${locator} ${text} |
118 | ... ELSE __private__log input ${locator} does not exist | 121 | ... ELSE __private__log input ${locator} does not exist |
119 | 122 | ||
@@ -197,8 +200,15 @@ select classification by array of code attributes | @@ -197,8 +200,15 @@ select classification by array of code attributes | ||
197 | \ run keyword if ${disabled} == ${False} __private__select_classification_code_in_opened_popup ${code_attributes['id']} ${code_attributes['scheme']} | 200 | \ run keyword if ${disabled} == ${False} __private__select_classification_code_in_opened_popup ${code_attributes['id']} ${code_attributes['scheme']} |
198 | submit current visible popup | 201 | submit current visible popup |
199 | 202 | ||
203 | +open site page and wait content element | ||
204 | + [Arguments] ${url} ${waiting_timeout}=5s ${waiting_error}=Opening page fails | ||
205 | + [Documentation] переходить по посиланню і чекає контенту сторінки | ||
206 | + | ||
207 | + go to ${url} | ||
208 | + wait until page contains element ${page_content_locator} ${waiting_timeout} ${waiting_error} | ||
209 | + | ||
200 | open page and wait element by locator | 210 | open page and wait element by locator |
201 | - [Arguments] ${url} ${waiting_element_locator} ${waiting_timeout}=30s ${waiting_error}=Opened page does not have specified element locator | 211 | + [Arguments] ${url} ${waiting_element_locator} ${waiting_timeout}=5s ${waiting_error}=Opened page does not have specified element locator |
202 | [Documentation] переходить по посиланню і чекає поки елемент не буде знайдений на сторінці | 212 | [Documentation] переходить по посиланню і чекає поки елемент не буде знайдений на сторінці |
203 | 213 | ||
204 | go to ${url} | 214 | go to ${url} |
@@ -218,7 +228,7 @@ submit current visible popup | @@ -218,7 +228,7 @@ submit current visible popup | ||
218 | click visible element ${popup_opened_last_submit_btn_locator} | 228 | click visible element ${popup_opened_last_submit_btn_locator} |
219 | sleep ${popup_transaction_time} | 229 | sleep ${popup_transaction_time} |
220 | ${popup_last_locator} = set variable id=${popup_last_id} | 230 | ${popup_last_locator} = set variable id=${popup_last_id} |
221 | - ${popup_exists} = __private__get_is_element_exist ${popup_last_locator} | 231 | + ${popup_exists} = get is element exist ${popup_last_locator} |
222 | return from keyword if ${popup_exists} == ${False} | 232 | return from keyword if ${popup_exists} == ${False} |
223 | wait until page does not contain element ${popup_last_locator} 30s Current popup was not hidden | 233 | wait until page does not contain element ${popup_last_locator} 30s Current popup was not hidden |
224 | 234 | ||
@@ -258,14 +268,14 @@ wait until page contains element with reloading | @@ -258,14 +268,14 @@ wait until page contains element with reloading | ||
258 | [Arguments] ${locator} ${retry}=5m ${retry_interval}=2s | 268 | [Arguments] ${locator} ${retry}=5m ${retry_interval}=2s |
259 | [Documentation] чекає поки елемент не з'явиться на сторінці з перезавантаженням сторінки | 269 | [Documentation] чекає поки елемент не з'явиться на сторінці з перезавантаженням сторінки |
260 | 270 | ||
261 | - ${result} = __private__get_is_element_exist ${locator} | 271 | + ${result} = get is element exist ${locator} |
262 | run keyword if ${result} == ${False} wait until keyword succeeds ${retry} ${retry_interval} reload page and fail if element does not exist ${locator} | 272 | run keyword if ${result} == ${False} wait until keyword succeeds ${retry} ${retry_interval} reload page and fail if element does not exist ${locator} |
263 | 273 | ||
264 | wait until page does not contain element with reloading | 274 | wait until page does not contain element with reloading |
265 | [Arguments] ${locator} ${retry}=5m ${retry_interval}=2s | 275 | [Arguments] ${locator} ${retry}=5m ${retry_interval}=2s |
266 | [Documentation] чекає поки елемент не пропаде зі сторінки з перезавантаженням сторінки | 276 | [Documentation] чекає поки елемент не пропаде зі сторінки з перезавантаженням сторінки |
267 | 277 | ||
268 | - ${result} = __private__get_is_element_exist ${locator} | 278 | + ${result} = get is element exist ${locator} |
269 | run keyword if ${result} == ${True} wait until keyword succeeds ${retry} ${retry_interval} reload page and fail if element exists ${locator} | 279 | run keyword if ${result} == ${True} wait until keyword succeeds ${retry} ${retry_interval} reload page and fail if element exists ${locator} |
270 | 280 | ||
271 | wait until tab content is visible | 281 | wait until tab content is visible |
@@ -281,7 +291,7 @@ reload page and fail if element exists | @@ -281,7 +291,7 @@ reload page and fail if element exists | ||
281 | [Documentation] перезавантажує сторінку і фейлить тест якщо елемент присутній | 291 | [Documentation] перезавантажує сторінку і фейлить тест якщо елемент присутній |
282 | 292 | ||
283 | reload page | 293 | reload page |
284 | - ${exists} = __private__get_is_element_exist ${locator} | 294 | + ${exists} = get is element exist ${locator} |
285 | run keyword if ${exists} == ${True} fail | 295 | run keyword if ${exists} == ${True} fail |
286 | 296 | ||
287 | reload page and fail if element does not exist | 297 | reload page and fail if element does not exist |
@@ -289,9 +299,22 @@ reload page and fail if element does not exist | @@ -289,9 +299,22 @@ reload page and fail if element does not exist | ||
289 | [Documentation] перезавантажує сторінку і фейлить тест якщо елемент відсутній | 299 | [Documentation] перезавантажує сторінку і фейлить тест якщо елемент відсутній |
290 | 300 | ||
291 | reload page | 301 | reload page |
292 | - ${exists} = __private__get_is_element_exist ${locator} | 302 | + ${exists} = get is element exist ${locator} |
293 | run keyword if ${exists} == ${False} fail | 303 | run keyword if ${exists} == ${False} fail |
294 | 304 | ||
305 | +get is 404 page | ||
306 | + [Documentation] перевіряє чи поточна сторінка з 404 помилкою | ||
307 | + | ||
308 | + ${exists} = get is element exist ${error_page_404_checker_element_locator} | ||
309 | + [Return] ${exists} | ||
310 | + | ||
311 | +wait until 404 page disappears | ||
312 | + [Arguments] ${retry}=5m ${retry_interval}=2s | ||
313 | + [Documentation] оновлює сторінку і чекає поки не пропаде 404 помилка | ||
314 | + | ||
315 | + ${result} = get is 404 page | ||
316 | + run keyword if ${result} == ${True} wait until keyword succeeds ${retry} ${retry_interval} reload page and fail if element exists ${error_page_404_checker_element_locator} | ||
317 | + | ||
295 | ######################################################################################################################## | 318 | ######################################################################################################################## |
296 | ################################################### PRIVATE KEYWORDS ################################################### | 319 | ################################################### PRIVATE KEYWORDS ################################################### |
297 | ######################################################################################################################## | 320 | ######################################################################################################################## |
@@ -303,14 +326,6 @@ __private__log | @@ -303,14 +326,6 @@ __private__log | ||
303 | log ${msg} | 326 | log ${msg} |
304 | log to console ${msg} | 327 | log to console ${msg} |
305 | 328 | ||
306 | -__private__get_is_element_exist | ||
307 | - [Arguments] ${locator} | ||
308 | - [Documentation] повертає чи елемент присутній на сторінці | ||
309 | - | ||
310 | - ${result} = get is element exist ${locator} | ||
311 | -# ${result} = run keyword and return status page should contain element ${locator} | ||
312 | - [Return] ${result} | ||
313 | - | ||
314 | __private__get_element_attribute | 329 | __private__get_element_attribute |
315 | [Arguments] ${locator} ${attribute} | 330 | [Arguments] ${locator} ${attribute} |
316 | [Documentation] повертає значення атрибуту для вказаного елементу | 331 | [Documentation] повертає значення атрибуту для вказаного елементу |
@@ -358,7 +373,7 @@ __private__select_classification_code_in_opened_popup | @@ -358,7 +373,7 @@ __private__select_classification_code_in_opened_popup | ||
358 | run keyword if ${scheme_is_none} == ${False} and '${scheme}' not in ${site_allowed_schemes} __private__log Scheme "${scheme}" is needed to implement. | 373 | run keyword if ${scheme_is_none} == ${False} and '${scheme}' not in ${site_allowed_schemes} __private__log Scheme "${scheme}" is needed to implement. |
359 | return from keyword if ${scheme_is_none} == ${False} and '${scheme}' not in ${site_allowed_schemes} | 374 | return from keyword if ${scheme_is_none} == ${False} and '${scheme}' not in ${site_allowed_schemes} |
360 | ${scheme_tab_locator} = replace string ${classification_popup_scheme_tab_locator_tpl} %scheme% ${scheme} | 375 | ${scheme_tab_locator} = replace string ${classification_popup_scheme_tab_locator_tpl} %scheme% ${scheme} |
361 | - ${scheme_tab_exists} = __private__get_is_element_exist ${scheme_tab_locator} | 376 | + ${scheme_tab_exists} = get is element exist ${scheme_tab_locator} |
362 | run keyword if ${scheme_tab_exists} == ${True} click visible element ${scheme_tab_locator} | 377 | run keyword if ${scheme_tab_exists} == ${True} click visible element ${scheme_tab_locator} |
363 | run keyword if ${scheme_tab_exists} == ${True} wait until tab content is visible ${scheme_tab_locator} | 378 | run keyword if ${scheme_tab_exists} == ${True} wait until tab content is visible ${scheme_tab_locator} |
364 | ... ELSE __private__log Classification scheme tab ${scheme} does not exist | 379 | ... ELSE __private__log Classification scheme tab ${scheme} does not exist |
@@ -4,6 +4,14 @@ Resource playtender_commo | @@ -4,6 +4,14 @@ Resource playtender_commo | ||
4 | 4 | ||
5 | *** Keywords *** | 5 | *** Keywords *** |
6 | 6 | ||
7 | +update plan queue | ||
8 | + [Documentation] запускає оновлення планів з ЦБД і додає їх в чергу, тобто синхронізація може відбутися не відразу | ||
9 | + ... поточна сторіка повертається | ||
10 | + | ||
11 | + ${current_url} = get location | ||
12 | + go to ${broker_baseurl}/utils/queue-plan-update | ||
13 | + go to ${current_url} | ||
14 | + | ||
7 | open new plan form | 15 | open new plan form |
8 | [Documentation] відкриття сторінки створення плану | 16 | [Documentation] відкриття сторінки створення плану |
9 | 17 | ||
@@ -20,7 +28,15 @@ open plan page by uaid | @@ -20,7 +28,15 @@ open plan page by uaid | ||
20 | [Arguments] ${uaid} | 28 | [Arguments] ${uaid} |
21 | [Documentation] відкриває сторінку з планом | 29 | [Documentation] відкриває сторінку з планом |
22 | 30 | ||
23 | - open page and wait element by locator ${broker_baseurl}/plan/${uaid} ${plan_view_checker_element_locator} | 31 | + open site page and wait content element ${broker_baseurl}/plan/${uaid} |
32 | + ${is_plan_found} = get is element exist ${plan_view_checker_element_locator} | ||
33 | + return from keyword if ${is_plan_found} == ${True} | ||
34 | + ${is_plan_not_found} = get is 404 page | ||
35 | + ${is_needed_to_update_and_wait_sync} = set variable if ${is_test_role_owner} == ${False} and ${is_plan_not_found} ${True} ${False} | ||
36 | + run keyword if ${is_needed_to_update_and_wait_sync} update plan queue | ||
37 | + run keyword if ${is_needed_to_update_and_wait_sync} wait until 404 page disappears | ||
38 | + ${is_plan_found} = get is element exist ${plan_view_checker_element_locator} | ||
39 | + run keyword if ${is_plan_found} == ${False} fail Opening plan page by uaid fails. | ||
24 | 40 | ||
25 | open plan search form | 41 | open plan search form |
26 | [Documentation] відкриває сторінку з пошуком планів | 42 | [Documentation] відкриває сторінку з пошуком планів |
@@ -2,16 +2,22 @@ | @@ -2,16 +2,22 @@ | ||
2 | 2 | ||
3 | ${kekv_schemes} = ["KEKV", "КЕКВ"] | 3 | ${kekv_schemes} = ["KEKV", "КЕКВ"] |
4 | ${site_allowed_schemes} = ["ДК021", "ДК015", "ДК018", "ДК003", "specialNorms", "INN", "ATC"] | 4 | ${site_allowed_schemes} = ["ДК021", "ДК015", "ДК018", "ДК003", "specialNorms", "INN", "ATC"] |
5 | +${page_content_locator} = jquery=.page__content | ||
5 | 6 | ||
6 | -# common | 7 | +# alerts |
7 | ${alert_opened_locator} = jquery=.jconfirm:last .content | 8 | ${alert_opened_locator} = jquery=.jconfirm:last .content |
8 | ${alert_confirm_btn_locator} = jquery=.jconfirm:last .buttons .js-btn-confirm | 9 | ${alert_confirm_btn_locator} = jquery=.jconfirm:last .buttons .js-btn-confirm |
9 | ${alert_opened_close_btn_locator} = jquery=.jconfirm:last .closeIcon | 10 | ${alert_opened_close_btn_locator} = jquery=.jconfirm:last .closeIcon |
10 | ${alert_message_contains_text_locator_tpl} = jquery=.jconfirm:last .message:contains(%text%) | 11 | ${alert_message_contains_text_locator_tpl} = jquery=.jconfirm:last .message:contains(%text%) |
12 | + | ||
13 | +# popups | ||
11 | ${popup_opened_last_locator} = jquery=.fancybox-is-open:last | 14 | ${popup_opened_last_locator} = jquery=.fancybox-is-open:last |
12 | ${popup_opened_last_submit_btn_locator} = jquery=.fancybox-is-open:last .fancybox-slide--current .modal-footer:last .js-submit,.fancybox-is-open:last .fancybox-slide--current .modal-footer:last .js-popup-submit | 15 | ${popup_opened_last_submit_btn_locator} = jquery=.fancybox-is-open:last .fancybox-slide--current .modal-footer:last .js-submit,.fancybox-is-open:last .fancybox-slide--current .modal-footer:last .js-popup-submit |
13 | ${popup_opened_content_locator} = jquery=.fancybox-is-open .fancybox-slide--current .fancybox-content # for checking if it's visible | 16 | ${popup_opened_content_locator} = jquery=.fancybox-is-open .fancybox-slide--current .fancybox-content # for checking if it's visible |
14 | 17 | ||
18 | +# error pages | ||
19 | +${error_page_404_checker_element_locator} = jquery=.site-error[data-error-code="404"] | ||
20 | + | ||
15 | # language | 21 | # language |
16 | ${language_selector_active_element_locator} = jquery=.languages.page-header__languages .languages__btn | 22 | ${language_selector_active_element_locator} = jquery=.languages.page-header__languages .languages__btn |
17 | ${language_selector_active_element_code_attribute_name} = data-language-code | 23 | ${language_selector_active_element_code_attribute_name} = data-language-code |
Please
register
or
login
to post a comment