Commit 0867d0dac7ce1b519877a0bc94402e7082cb5a6e
Merge branch 'v3-dev' of https://git.4k.com.ua/root/playtender-robot_tests into v3-dev
Showing
2 changed files
with
44 additions
and
3 deletions
@@ -34,6 +34,8 @@ init environment | @@ -34,6 +34,8 @@ init environment | ||
34 | ${is_test_role_owner} = set variable if '${test_role}' == 'tender_owner' ${True} ${False} | 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} | 35 | set global variable ${is_test_role_owner} ${is_test_role_owner} |
36 | 36 | ||
37 | + register keyword to run on failure __private__handle_keyword_failure | ||
38 | + | ||
37 | set site language by code | 39 | set site language by code |
38 | [Arguments] ${language_code} | 40 | [Arguments] ${language_code} |
39 | [Documentation] змінити мову сайту | 41 | [Documentation] змінити мову сайту |
@@ -149,13 +151,23 @@ input text to exist visible input | @@ -149,13 +151,23 @@ input text to exist visible input | ||
149 | run keyword if ${input_exists} == ${True} input text to visible input ${locator} ${text} | 151 | run keyword if ${input_exists} == ${True} input text to visible input ${locator} ${text} |
150 | ... ELSE __private__log input ${locator} does not exist | 152 | ... ELSE __private__log input ${locator} does not exist |
151 | 153 | ||
154 | +input date to input | ||
155 | + [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y | ||
156 | + | ||
157 | + ${date} = isodate format ${isodate} ${format} | ||
158 | + input text to hidden input ${locator} ${date} | ||
159 | + | ||
160 | +input datetime to input | ||
161 | + [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y %H:%M | ||
162 | + | ||
163 | + input date to input ${locator} ${isodate} ${format} | ||
164 | + | ||
152 | input date to visible input | 165 | input date to visible input |
153 | [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y | 166 | [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y |
154 | [Documentation] перевіряє чи елемент видимий у вікні браузера, після чого заповнює його відформатовоною датою | 167 | [Documentation] перевіряє чи елемент видимий у вікні браузера, після чого заповнює його відформатовоною датою |
155 | 168 | ||
156 | __private__set_element_visible_in_browser_area ${locator} | 169 | __private__set_element_visible_in_browser_area ${locator} |
157 | - ${date} = isodate format ${isodate} ${format} | ||
158 | - input text ${locator} ${date} | 170 | + input date to input ${locator} ${isodate} ${format} |
159 | 171 | ||
160 | input datetime to visible input | 172 | input datetime to visible input |
161 | [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y %H:%M | 173 | [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y %H:%M |
@@ -397,6 +409,27 @@ wait until 404 page disappears | @@ -397,6 +409,27 @@ wait until 404 page disappears | ||
397 | ################################################### PRIVATE KEYWORDS ################################################### | 409 | ################################################### PRIVATE KEYWORDS ################################################### |
398 | ######################################################################################################################## | 410 | ######################################################################################################################## |
399 | 411 | ||
412 | +__private__handle_keyword_failure | ||
413 | + [Documentation] обробка падіння тесту, збір можливої інформації для аналізу проблеми | ||
414 | + | ||
415 | + capture page screenshot | ||
416 | + ${form_errors} = __private__get_all_form_errors | ||
417 | + log dictionary ${form_errors} | ||
418 | + | ||
419 | +__private__get_all_form_errors | ||
420 | + [Documentation] збирає всі помилки форм на сторінці | ||
421 | + | ||
422 | + ${errors} = execute javascript | ||
423 | + ... var errors = {}; | ||
424 | + ... $('.has-error .help-block-error').each(function () { | ||
425 | + ... var cssClass = $(this).attr('class'), text = $(this).text(); | ||
426 | + ... cssClass = cssClass.replace("help-block-error", ""); | ||
427 | + ... cssClass = cssClass.replace("help-block", ""); | ||
428 | + ... errors[cssClass] = text; | ||
429 | + ... }); | ||
430 | + ... return errors; | ||
431 | + [Return] ${errors} | ||
432 | + | ||
400 | __private__log | 433 | __private__log |
401 | [Arguments] ${msg} | 434 | [Arguments] ${msg} |
402 | [Documentation] пише в логи | 435 | [Documentation] пише в логи |
@@ -103,9 +103,17 @@ fill plan form items | @@ -103,9 +103,17 @@ fill plan form items | ||
103 | \ run keyword if condition is not none ${item_update_index} click visible element ${open_form_btn_locator} | 103 | \ run keyword if condition is not none ${item_update_index} click visible element ${open_form_btn_locator} |
104 | \ run keyword if condition is none ${item_update_index} click visible element ${plan_form_add_item_btn_locator} | 104 | \ run keyword if condition is none ${item_update_index} click visible element ${plan_form_add_item_btn_locator} |
105 | \ wait until popup is visible | 105 | \ wait until popup is visible |
106 | - \ fill item form in opened popup ${item_attributes} | 106 | + \ fill plan item form in opened popup ${item_attributes} |
107 | \ run keyword and ignore error submit current visible popup | 107 | \ run keyword and ignore error submit current visible popup |
108 | 108 | ||
109 | +fill plan item form in opened popup | ||
110 | + [Arguments] ${data} | ||
111 | + | ||
112 | + fill item form in opened popup ${data} | ||
113 | + | ||
114 | + ${delivery_end_date} = get from dictionary by keys ${data} deliveryDate endDate | ||
115 | + run keyword if condition is not none ${delivery_end_date} run keyword and ignore error input date to input ${item_form_popup_delivery_end_date_input_locator} ${delivery_end_date} | ||
116 | + | ||
109 | fill plan form buyers | 117 | fill plan form buyers |
110 | [Arguments] ${buyer_attributes_array} | 118 | [Arguments] ${buyer_attributes_array} |
111 | [Documentation] заповнення замовника плану | 119 | [Documentation] заповнення замовника плану |
Please
register
or
login
to post a comment