Commit 06190a67140ece2730aec60022393e1a65be0128
1 parent
75aff637
- added: filling plan "item.deliveryPeriod.endDate"
- added: handling keyword failure
Showing
2 changed files
with
44 additions
and
3 deletions
... | ... | @@ -34,6 +34,8 @@ init environment |
34 | 34 | ${is_test_role_owner} = set variable if '${test_role}' == 'tender_owner' ${True} ${False} |
35 | 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 | 39 | set site language by code |
38 | 40 | [Arguments] ${language_code} |
39 | 41 | [Documentation] змінити мову сайту |
... | ... | @@ -149,13 +151,23 @@ input text to exist visible input |
149 | 151 | run keyword if ${input_exists} == ${True} input text to visible input ${locator} ${text} |
150 | 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 | 165 | input date to visible input |
153 | 166 | [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y |
154 | 167 | [Documentation] перевіряє чи елемент видимий у вікні браузера, після чого заповнює його відформатовоною датою |
155 | 168 | |
156 | 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 | 172 | input datetime to visible input |
161 | 173 | [Arguments] ${locator} ${isodate} ${format}=%d.%m.%Y %H:%M |
... | ... | @@ -397,6 +409,27 @@ wait until 404 page disappears |
397 | 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 | 433 | __private__log |
401 | 434 | [Arguments] ${msg} |
402 | 435 | [Documentation] пише в логи | ... | ... |
... | ... | @@ -103,9 +103,17 @@ fill plan form items |
103 | 103 | \ run keyword if condition is not none ${item_update_index} click visible element ${open_form_btn_locator} |
104 | 104 | \ run keyword if condition is none ${item_update_index} click visible element ${plan_form_add_item_btn_locator} |
105 | 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 | 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 | 117 | fill plan form buyers |
110 | 118 | [Arguments] ${buyer_attributes_array} |
111 | 119 | [Documentation] заповнення замовника плану | ... | ... |
Please
register
or
login
to post a comment