Commit ef407ed9947cf744861c78682c7ab8e84252985a

Authored by Playtenders
1 parent 22593570

Global Variable Option

... ... @@ -111,6 +111,8 @@ Resource playtender_tende
111 111
112 112 ${tender_prepared_data} = prepare tender data ${tender_data['data']}
113 113 log ${tender_prepared_data}
  114 + Set Global Variable ${td_railway_crutch} ${tender_data}
  115 + log many ${td_railway_crutch}
114 116
115 117 open new tender form
116 118 fill tender form ${tender_prepared_data}
... ... @@ -141,6 +143,23 @@ Resource playtender_tende
141 143 ${value} = get tender field value by name ${field_name}
142 144 [Return] ${value}
143 145
  146 +Отримати інформацію із предмету
  147 + [Arguments] ${username} ${tender_uaid} ${item_id} ${field_name}
  148 + [Documentation] Отримати значення поля field_name з предмету з item_id в описі для тендера tender_uaid.
  149 +
  150 + open tender page by uaid ${tender_uaid}
  151 + ${value} = get item field value by name ${field_name}
  152 + [Return] ${value}
  153 +
  154 +Отримати інформацію із лоту
  155 + [Arguments] ${username} ${tender_uaid} ${lot_id} ${field_name}
  156 + [Documentation] Отримати значення поля field_name з лоту з lot_id в описі для тендера tender_uaid.
  157 +
  158 + open tender page by uaid ${tender_uaid}
  159 + ${value} = get lot field value by name ${field_name}
  160 + [Return] ${value}
  161 +
  162 +
144 163 Внести зміни в тендер
145 164 [Arguments] ${username} ${tender_uaid} ${fieldname} ${fieldvalue}
146 165 [Documentation] Змінити значення поля fieldname на fieldvalue для плана із зазначеним plan_uaid.
... ...
... ... @@ -2,6 +2,7 @@
2 2 from robot.libraries.BuiltIn import BuiltIn
3 3 from iso8601 import parse_date
4 4 import re
  5 +import dateutil.parser
5 6
6 7
7 8 def get_library():
... ... @@ -278,4 +279,9 @@ def split_agreementDuration(str, type):
278 279 else:
279 280 day_temp = str.split('D',1)
280 281 value = day_temp[0].split('M',1)
281   - return value[1]
\ No newline at end of file
  282 + return value[1]
  283 +
  284 +def convert_date_to_string_contr(date):
  285 + date = dateutil.parser.parse(date)
  286 + date = date.strftime("%d.%m.%Y %H:%M:%S")
  287 + 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}
... ...
... ... @@ -186,7 +186,7 @@ ${tender_edit_btn_locator} = jquery=#asid
186 186 #елемент проверки загрузки формы в попапе
187 187 ${popup_dynamic_form_loading_element_locator} = jquery=.fancybox-is-open .btn-add .fa-spin
188 188 #${add_file_to_form} xpath=//input[@type='file']
189   -${add_file_to_form_locator} = jquery=.fancybox-is-open input[type$='file']
  189 +${add_file_to_form_locator} = jquery=.fancybox-is-open input[type$="file"]
190 190
191 191 # tender index + search
192 192 ${tender_search_form_locator} = id=tender-filter-form
... ... @@ -194,12 +194,12 @@ ${tender_search_form_query_input_locator} = jquery=#tend
194 194 ${tender_search_form_result_locator_tpl} = jquery=#tender-list .lots__item .lot__characteristic li:contains(%query%)
195 195
196 196 #question
197   -${question_form_open_btn_locator} = jquery=#aside-part-pjax a[href*="/tender/questions"]
  197 +${question_form_open_btn_locator} = jquery=#aside-part-pjax a[href*="/tender/questions"]
198 198 ${question_open_form_answer_btn_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"]
199 199 ${question_form_open_form_answer_btn_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"] .btn.btn-default
200 200 ${question_form_open_form_answer_input_locator} = jquery=.fancybox-is-open .fancybox-content #tender-question-answer-form #questionanswerform-answer
201 201 ${question_form_answer_submit_btn_locator} = jquery=.fancybox-is-open .fancybox-content #tender-question-answer-form .js-submit-btn
202   -${plan_form_submit_success_msg} = відповідь на питання надана
  202 +${question_form_submit_answer_success_msg} = Відповідь на питання успішно надана.
203 203 ${question_form_create_question_btn_locator} = jquery=.#aside-part-pjax [data-url*="/tender/question-create"]
204 204 ${question_form_create_questionform_related_of_input_locator} = jquery=.fancybox-is-open .fancybox-content #questionform-related_of
205 205 ${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