Commit 258bdec68cf06231c8641fc7861a5f9ed9e6b3d3

Authored by Oleksandr Iskryzhytskyi
2 parents b11dcdbd 372a2721

Merge branch 'v3-dev' of https://git.4k.com.ua/root/playtender-robot_tests into v3-dev

... ... @@ -112,6 +112,8 @@ Resource playtender_tende
112 112
113 113 ${tender_prepared_data} = prepare tender data ${tender_data['data']}
114 114 log ${tender_prepared_data}
  115 + Set Global Variable ${td_railway_crutch} ${tender_data}
  116 + log many ${td_railway_crutch}
115 117
116 118 open new tender form
117 119 fill tender form ${tender_prepared_data}
... ... @@ -142,6 +144,23 @@ Resource playtender_tende
142 144 ${value} = get tender field value by name ${field_name}
143 145 [Return] ${value}
144 146
  147 +Отримати інформацію із предмету
  148 + [Arguments] ${username} ${tender_uaid} ${item_id} ${field_name}
  149 + [Documentation] Отримати значення поля field_name з предмету з item_id в описі для тендера tender_uaid.
  150 +
  151 + open tender page by uaid ${tender_uaid}
  152 + ${value} = get item field value by name ${field_name}
  153 + [Return] ${value}
  154 +
  155 +Отримати інформацію із лоту
  156 + [Arguments] ${username} ${tender_uaid} ${lot_id} ${field_name}
  157 + [Documentation] Отримати значення поля field_name з лоту з lot_id в описі для тендера tender_uaid.
  158 +
  159 + open tender page by uaid ${tender_uaid}
  160 + ${value} = get lot field value by name ${field_name}
  161 + [Return] ${value}
  162 +
  163 +
145 164 Внести зміни в тендер
146 165 [Arguments] ${username} ${tender_uaid} ${fieldname} ${fieldvalue}
147 166 [Documentation] Змінити значення поля fieldname на fieldvalue для плана із зазначеним plan_uaid.
... ...
1 1 # -*- coding: utf-8 -
2 2 import re
  3 +import dateutil.parser
3 4
4 5 from iso8601 import parse_date
5 6 from robot.libraries.BuiltIn import BuiltIn
... ... @@ -292,4 +293,9 @@ def split_agreementDuration(str, type):
292 293 else:
293 294 day_temp = str.split('D',1)
294 295 value = day_temp[0].split('M',1)
295   - return value[1]
\ No newline at end of file
  296 + return value[1]
  297 +
  298 +def convert_date_to_string_contr(date):
  299 + date = dateutil.parser.parse(date)
  300 + date = date.strftime("%d.%m.%Y %H:%M:%S")
  301 + return date
... ...
... ... @@ -53,13 +53,14 @@ fill tender form
53 53 run keyword if condition is not none ${milestones} fill tender form milestones ${milestones}
54 54 ${lots} = get from dictionary by keys ${data} lots
55 55 run keyword if condition is not none ${lots} fill tender form lots ${lots}
56   - fill tender required documents
  56 + Run Keyword And Ignore Error fill tender required documents
57 57
58 58 fill tender general info
59 59 [Arguments] ${data}
60 60 [Documentation] обирає потрібний тип закупівлі, чекає оновлення форми, вказує мультилотовість, заповнює
61 61 ... приховані поля + відкриває попап основних даних, заповнює його і закриває
62 62
  63 + wait until page does not contain element ${popup_dynamic_form_loading_element_locator}
63 64 ${procurement_method_type} = get from dictionary by keys ${data} procurementMethodType
64 65 run keyword if condition is not none ${procurement_method_type} select from visible list by value ${tender_form_procurement_method_type_input_locator} ${procurement_method_type}
65 66 wait until page does not contain element ${popup_dynamic_form_loading_element_locator}
... ... @@ -78,7 +79,6 @@ fill tender general info
78 79 run keyword if condition is not none ${title} input text to exist visible input ${tender_form_general_tender_description_en_locator} ${description_en}
79 80 ${funders} = get from dictionary by keys ${data} funders
80 81 run keyword if condition is not none ${funders} Click Element ${tender_form_general_tender_funder_locator}
81   - Capture Page Screenshot
82 82 ${amount} = get from dictionary by keys ${data} value amount
83 83 run keyword if condition is not none ${amount} run keyword and ignore error input number to exist visible input ${tender_form_general_value_amount_input_locator} ${amount}
84 84 ${currency} = get from dictionary by keys ${data} value currency
... ... @@ -212,6 +212,7 @@ fill feature form in opened popup
212 212 ${ex}= Evaluate ${count} - 1
213 213 : FOR ${INDEX} IN RANGE 0 ${count}
214 214 \ run keyword if condition is not none ${options[${INDEX}].title} input text to exist visible input ${feature_form_popup_enum_title_input_locator} ${options[${INDEX}].title}
  215 + \ run keyword and ignore error input text to exist visible input ${feature_form_popup_enum_title_en_input_locator} test2
215 216 # \ run keyword if condition is not none ${options[${INDEX}].title_en} input text to exist visible input ${feature_form_popup_enum_title_en_input_locator} ${options[${INDEX}].title_en}
216 217 \ ${value} = convert_float_to_string ${options[${INDEX}].value}
217 218 \ ${value} = Convert To Number ${value}
... ... @@ -283,6 +284,61 @@ get tender field value by name
283 284 [Arguments] ${key}
284 285 [Documentation] Отримати інформацію із тендера, користуючись ідентіфікатором тендеру та назвою поля ${key}.
285 286
  287 + ${prepared_tender_data}= Get From Dictionary ${td_railway_crutch} data
  288 + ${items}= get from dictionary by keys ${prepared_tender_data} items
  289 + ${lots} = get from dictionary by keys ${prepared_tender_data} lots
  290 + Run Keyword If 'enquiryPeriod.endDate' == '${key}' log many ${td_railway_crutch.data.enquiryPeriod.endDate}
  291 + Run Keyword And Return If 'enquiryPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.enquiryPeriod.endDate}
  292 + Run Keyword And Return If 'enquiryPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.enquiryPeriod.endDate}
  293 + Run Keyword If 'tenderPeriod.endDate' == '${key}' log many ${td_railway_crutch.data.tenderPeriod.endDate}
  294 + Run Keyword And Return If 'tenderPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.tenderPeriod.endDate}
  295 + Run Keyword If 'value.amount' == '${key}' log many ${td_railway_crutch.data.value.amount}
  296 + # ${return_value}= Run Keyword If 'value.amount' == '${key}' Evaluate ''.join('${td_railway_crutch.data.value.amount}'.split()[:-3])
  297 + Run Keyword And Return If 'value.amount' == '${key}' Convert To Number ${td_railway_crutch.data.value.amount}
  298 + Run Keyword And Return If 'value.amount' == '${key}' convert float to string ${td_railway_crutch.data.value.amount}
  299 + Run Keyword And Return If 'items[0].description' == '${key}' convert to string ${items[0].description}
  300 +
  301 +
  302 +get item field value by name
  303 + [Arguments] ${key}
  304 + [Documentation] Отримати інформацію із предмета тендера, користуючись ідентіфікатором тендеру, ідентіфікатором предмету та назвою поля ${key}.
  305 +
  306 + ${prepared_tender_data}= Get From Dictionary ${td_railway_crutch} data
  307 + ${items}= Get From Dictionary ${prepared_tender_data} items
  308 +
  309 + Run Keyword If 'description' == '${key}' log many ${items[0].quantity}
  310 + Run Keyword If 'description' == '${key}' log many ${items[0].description}
  311 + Run Keyword And Return If 'description' == '${key}' convert to string ${items[0].description}
  312 +# Run Keyword And Return If 'enquiryPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.enquiryPeriod.endDate}
  313 +# Run Keyword If 'tenderPeriod.endDate' == '${key}' log many ${td_railway_crutch.data.tenderPeriod.endDate}
  314 +# Run Keyword And Return If 'tenderPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.tenderPeriod.endDate}
  315 +# Run Keyword If 'value.amount' == '${key}' log many ${td_railway_crutch.data.value.amount}
  316 + # ${return_value}= Run Keyword If 'value.amount' == '${key}' Evaluate ''.join('${td_railway_crutch.data.value.amount}'.split()[:-3])
  317 +# Run Keyword And Return If 'value.amount' == '${key}' Convert To Number ${td_railway_crutch.data.value.amount}
  318 +# Run Keyword And Return If 'value.amount' == '${key}' convert float to string ${td_railway_crutch.data.value.amount}
  319 +
  320 +get lot field value by name
  321 + [Arguments] ${key}
  322 + [Documentation] Отримати інформацію із предмета тендера, користуючись ідентіфікатором тендеру, ідентіфікатором предмету та назвою поля ${key}.
  323 +
  324 + ${prepared_tender_data}= Get From Dictionary ${td_railway_crutch} data
  325 + ${lots} = get from dictionary by keys ${prepared_tender_data} lots
  326 + ${items}= get from dictionary by keys ${prepared_tender_data} items
  327 +
  328 + Run Keyword If 'value.amount' == '${key}' log many ${lots[0].value.amount}
  329 + # ${return_value}= Run Keyword If 'value.amount' == '${key}' Evaluate ''.join('${td_railway_crutch.data.value.amount}'.split()[:-3])
  330 + Run Keyword And Return If 'value.amount' == '${key}' Convert To Number ${lots[0].value.amount}
  331 + Run Keyword And Return If 'value.amount' == '${key}' convert float to string ${lots[0].value.amount}
  332 + Run Keyword If 'description' == '${key}' log many ${lots[0].quantity}
  333 + Run Keyword If 'description' == '${key}' log many ${lots[0].description}
  334 + Run Keyword And Return If 'description' == '${key}' convert to string ${lots[0].description}
  335 + Run Keyword And Return If 'title' == '${key}' convert to string ${lots[0].title}
  336 +
  337 +Отримати інформацію із тендера tenderPeriod.endDate
  338 + ${return_value}= get_text xpath=//p[contains(@class, 'tender-period')]//*[@class='value']//span[contains(@class, 'end-date')]
  339 +# ${return_value}= convert_date_for_compare_ex ${return_value}
  340 + ${return_value}= isodate format ${return_value} %d.%m.%Y %H:%M
  341 + [return] ${return_value}
286 342
287 343 save tender form and wait synchronization
288 344 [Documentation] натискає кнопку "Зберегти" і чекає синхронізації тендеру
... ... @@ -303,8 +359,11 @@ add document in lot
303 359 [Arguments] ${filepath} ${lot_id}
304 360 [Documentation] Завантажити в лот (з ідентіфікатором ${lot_id}) документ, який знаходиться по шляху filepath.
305 361
  362 + capture page screenshot
306 363 ${open_form_add_doc_lot_btn_locator} = replace string ${tender_form_lot_panel_add_document_btn_locator_tpl} %lot_id% ${lot_id}
307   - click visible element ${open_form_add_doc_lot_btn_locator}
  364 + capture page screenshot
  365 + click visible element and wait until page contains element ${open_form_add_doc_lot_btn_locator}
  366 + capture page screenshot
308 367 choose file ${add_file_to_form_locator} ${filepath}
309 368 wait until page does not contain element ${popup_dynamic_form_loading_element_locator}
310 369 submit current visible popup
... ... @@ -343,7 +402,7 @@ answer question
343 402 wait until popup is visible
344 403 input text to exist visible input ${question_form_open_form_answer_input_locator} ${answer_data.data.answer}
345 404 # click visible element ${question_form_answer_submit_btn_locator}
346   - submit form and check result ${question_form_answer_submit_btn_locator} ${question_form_submit_success_msg} ${tender_created_checker_element_locator}
  405 + submit form and check result ${question_form_answer_submit_btn_locator} ${question_form_submit_answer_success_msg} ${tender_created_checker_element_locator}
347 406
348 407 Створити вимогу
349 408 [Arguments] ${username} ${tender_uaid} ${type} ${type_id} ${claim} ${doc_name}
... ...
... ... @@ -152,7 +152,7 @@ ${tender_edit_btn_locator} = jquery=#asid
152 152 #елемент проверки загрузки формы в попапе
153 153 ${popup_dynamic_form_loading_element_locator} = jquery=.fancybox-is-open .btn-add .fa-spin
154 154 #${add_file_to_form} xpath=//input[@type='file']
155   -${add_file_to_form_locator} = jquery=.fancybox-is-open input[type$='file']
  155 +${add_file_to_form_locator} = jquery=.fancybox-is-open input[type$="file"]
156 156
157 157 # tender index + search
158 158 ${tender_search_form_locator} = id=tender-filter-form
... ... @@ -160,12 +160,12 @@ ${tender_search_form_query_input_locator} = jquery=#tend
160 160 ${tender_search_form_result_locator_tpl} = jquery=#tender-list .lots__item .lot__characteristic li:contains(%query%)
161 161
162 162 #question
163   -${question_form_open_btn_locator} = jquery=#aside-part-pjax a[href*="/tender/questions"]
  163 +${question_form_open_btn_locator} = jquery=#aside-part-pjax a[href*="/tender/questions"]
164 164 ${question_open_form_answer_btn_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"]
165 165 ${question_form_open_form_answer_btn_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"] .btn.btn-default
166 166 ${question_form_open_form_answer_input_locator} = jquery=.fancybox-is-open .fancybox-content #tender-question-answer-form #questionanswerform-answer
167 167 ${question_form_answer_submit_btn_locator} = jquery=.fancybox-is-open .fancybox-content #tender-question-answer-form .js-submit-btn
168   -${plan_form_submit_success_msg} = відповідь на питання надана
  168 +${question_form_submit_answer_success_msg} = Відповідь на питання успішно надана.
169 169 ${question_form_create_question_btn_locator} = jquery=.#aside-part-pjax [data-url*="/tender/question-create"]
170 170 ${question_form_create_questionform_related_of_input_locator} = jquery=.fancybox-is-open .fancybox-content #questionform-related_of
171 171 ${question_form_create_questionform_related_item_input_locator} = jquery=.fancybox-is-open .fancybox-content #questionform-related_item
... ...
Please register or login to post a comment