Commit 76c78c4ac0b467187ab98f0610fc1827d38c3fd5

Authored by Playtenders
1 parent aff7a571

refactoring and answer\question

... ... @@ -144,6 +144,7 @@ Resource playtender_tende
144 144 open tender page by uaid ${tender_uaid}
145 145 ${field_name} = set variable tender.${field_name}.value
146 146 ${value} = get field_value by field_name on opened page ${field_name}
  147 +# ${value} = get tender field value by name ${field_name}
147 148 [Return] ${value}
148 149
149 150 Внести зміни в тендер
... ... @@ -253,7 +254,7 @@ Resource playtender_tende
253 254 add question ${username} ${tender_uaid} item ${item_id} ${question}
254 255
255 256 Задати запитання на лот
256   - [Arguments] ${username} ${tender_uaid} ${lot_id } ${question}
  257 + [Arguments] ${username} ${tender_uaid} ${lot_id} ${question}
257 258 [Documentation] Створити запитання з даними question до лоту з lot_id
258 259 ... в описі для тендера tender_uaid.
259 260
... ... @@ -265,6 +266,16 @@ Resource playtender_tende
265 266
266 267 add question ${username} ${tender_uaid} tender null ${question}
267 268
  269 +Отримати інформацію із запитання
  270 + [Arguments] ${username} ${tender_uaid} ${question_id} ${field_name}
  271 + [Documentation] Отримати значення поля field_name із запитання з question_id
  272 + ... в описі для тендера tender_uaid.
  273 +
  274 + open tender page by uaid ${tender_uaid}
  275 + ${value} = get question information ${question_id} ${field_name}
  276 + [Return] ${value}
  277 +
  278 +
268 279 ########################################################################################################################
269 280 ################################################### END QUESTION KEYWORDS #############################################
270 281 ########################################################################################################################
... ...
... ... @@ -63,7 +63,7 @@ fill item form in opened popup
63 63 ${description_en} = get from dictionary by keys ${data} description_en
64 64 run keyword if condition is not none ${description_en} input text to exist visible input ${item_form_popup_description_en_input_locator} ${description_en}
65 65 ${quantity} = get from dictionary by keys ${data} quantity
66   - run keyword if condition is not none ${quantity} input number to visible input ${item_form_popup_quantity_input_locator} ${quantity}
  66 + run keyword if condition is not none ${quantity} input number3 to visible input ${item_form_popup_quantity_input_locator} ${quantity}
67 67 ${unit} = get from dictionary by keys ${data} unit name
68 68 run keyword if condition is not none ${unit} select from visible list by label ${item_form_popup_unit_input_locator} ${unit}
69 69 ${classification} = get from dictionary by keys ${data} classification
... ... @@ -75,7 +75,7 @@ get value by locator on opened page
75 75 [Arguments] ${locator} ${type}=${None}
76 76 [Documentation] отримує значення з відповідного локатору і якщо потрібно перетворює до відповідного типу
77 77
78   - __private__set_element_visible_in_browser_area ${locator}
  78 + Run Keyword And Ignore Error __private__set_element_visible_in_browser_area ${locator}
79 79 ${value} = get value by locator ${locator}
80 80 ${value} = convert to specified type ${value} ${type}
81 81 [Return] ${value}
... ... @@ -177,6 +177,13 @@ input number to visible input
177 177 ${number} = convert float to string ${number}
178 178 input text to visible input ${locator} ${number}
179 179
  180 +input number3 to visible input
  181 + [Arguments] ${locator} ${number}
  182 + [Documentation] робить елемент видимим, число перетворює в строку і записує в поле
  183 +
  184 + ${number} = convert_float_to_string_3f ${number}
  185 + input text to visible input ${locator} ${number}
  186 +
180 187 input number to exist visible input
181 188 [Arguments] ${locator} ${text}
182 189 [Documentation] перевіряє чи елемент існує і видимий у вікні браузера, після чого заповнює його
... ...
... ... @@ -9,15 +9,20 @@ add question
9 9 [Arguments] ${username} ${tender_uaid} ${type} ${type_id} ${question}
10 10 [Documentation] Створити запитання з question в описі для тендера tender_uaid.
11 11
12   - click visible element ${question_form_create_question_btn_locator}
  12 + click visible element ${question_form_open_btn_locator}
  13 + capture page screenshot
  14 + click visible element ${question_form_open_create_btn_locator}
  15 +
  16 +# click visible element jquery=#tender-part-pjax a[href*="/tender/question-create"]:first
  17 + capture page screenshot
13 18 wait until popup is visible
14   - input text to exist visible input ${question_form_open_form_answer_input_locator} ${answer_data.data.answer}
15   - Run Keyword If '${type}' == 'tender' Select From List By Value ${question_form_create_questionform_related_of_input_locator} Закупівля
16   - Run Keyword If '${type}' == 'lot' Select From List By Value ${question_form_create_questionform_related_of_input_locator} Лот
  19 +# input text to exist visible input ${question_form_open_form_answer_input_locator} ${question.data.answer}
  20 + Run Keyword If '${type}' == 'tender' Select From List By Label ${question_form_create_questionform_related_of_input_locator} Закупівля
  21 + Run Keyword If '${type}' == 'lot' Select From List By Label ${question_form_create_questionform_related_of_input_locator} Лот
17 22 Run Keyword If '${type}' == 'lot' Click Element ${question_form_create_questionform_related_lot_input_locator}
18 23 ${question_form_create_questionform_related_lot_input_locator} = Run Keyword If '${type}' == 'lot' replace string ${question_form_create_questionform_related_lot_input_locator_tpl} %type_id% ${type_id}
19 24 Run Keyword If '${type}' == 'lot' Click Element ${question_form_create_questionform_related_lot_input_locator}
20   - Run Keyword If '${type}' == 'item' Select From List By Value ${question_form_create_questionform_related_of_input_locator} Предмет закупівлі
  25 + Run Keyword If '${type}' == 'item' Select From List By Label ${question_form_create_questionform_related_of_input_locator} Предмет закупівлі
21 26 Run Keyword If '${type}' == 'item' Click Element ${question_form_create_questionform_related_item_input_locator}
22 27 ${question_form_create_questionform_related_item_input_locator} = Run Keyword If '${type}' == 'item' replace string ${question_form_create_questionform_related_item_input_locator_tpl} %type_id% ${type_id}
23 28 Run Keyword If '${type}' == 'item' Click Element ${question_questionform_related_item_input_locator}
... ... @@ -40,3 +45,25 @@ answer question
40 45 input text to exist visible input ${question_form_open_form_answer_input_locator} ${answer_data.data.answer}
41 46 submit form and check result ${question_form_answer_submit_btn_locator} ${question_form_submit_answer_success_msg} ${tender_created_checker_element_locator}
42 47
  48 +get question information
  49 + [Arguments] ${question_id} ${field_name}
  50 + [Documentation] Отримати значення поля field_name із запитання з question_id
  51 + ... в описі для тендера tender_uaid.
  52 +
  53 + capture page screenshot
  54 + run keyword and ignore error save tender form and wait synchronization
  55 + capture page screenshot
  56 + click visible element ${question_form_open_btn_locator}
  57 + ${question_open_form_answer_locator} = replace string ${question_open_form_answer_btn_locator_tpl} %title% ${question_id}
  58 + wait until page contains element with reloading ${question_open_form_answer_locator}
  59 + capture page screenshot
  60 + ${question_title_value_locator} = Run Keyword If 'title' == '${field_name}' replace string ${question_title_value_locator_tpl} %title% ${question_id}
  61 + ${question_answer_value_locator} = Run Keyword If 'answer' == '${field_name}' replace string ${question_answer_value_locator_tpl} %title% ${question_id}
  62 + ${question_description_value_locator} = Run Keyword If 'description' == '${field_name}' replace string ${question_description_value_locator_tpl} %title% ${question_id}
  63 + Run Keyword If 'answer' == '${field_name}' wait until page contains element with reloading ${question_answer_value_locator}
  64 + ${return_value} = Run Keyword If 'title' == '${field_name}' get_text ${question_title_value_locator}
  65 + ... ELSE Run Keyword If 'answer' == '${field_name}' get_text ${question_answer_value_locator}
  66 + ... ELSE Run Keyword If 'description' == '${field_name}' get_text ${question_description_value_locator}
  67 + [Return] ${return_value}
  68 +
  69 +
... ...
... ... @@ -5,9 +5,9 @@ ${question_form_open_btn_locator} = jquery=#asid
5 5 ${question_open_form_answer_btn_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"]
6 6 ${question_form_open_form_answer_btn_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"] .btn.btn-default
7 7 ${question_form_open_form_answer_input_locator} = jquery=.fancybox-is-open .fancybox-content #tender-question-answer-form #questionanswerform-answer
8   -${question_form_answer_submit_btn_locator} = jquery=.fancybox-is-open .fancybox-content #tender-question-answer-form .js-submit-btn
  8 +${question_form_answer_submit_btn_locator} = jquery=.fancybox-is-open .fancybox-content button.js-submit-btn
9 9 ${question_form_submit_answer_success_msg} = Відповідь на питання успішно надана.
10   -${question_form_create_question_btn_locator} = jquery=.#aside-part-pjax [data-url*="/tender/question-create"]
  10 +${question_form_create_question_btn_locator} = jquery=#aside-part-pjax [data-url*="/tender/question-create"]
11 11 ${question_form_create_questionform_related_of_input_locator} = jquery=.fancybox-is-open .fancybox-content #questionform-related_of
12 12 ${question_form_create_questionform_related_item_input_locator} = jquery=.fancybox-is-open .fancybox-content #questionform-related_item
13 13 ${question_form_create_questionform_related_item_input_locator_tpl} = jquery=.fancybox-is-open .fancybox-content #questionform-related_item option:contains("%type_id%")
... ... @@ -17,4 +17,10 @@ ${question_form_submit_success_msg} = Запита
17 17 ${question_form_create_questionform_related_lot_input_locator} = jquery=.fancybox-is-open .fancybox-content #questionform-related_lot
18 18 ${question_form_create_questionform_related_lot_input_locator} = jquery=.fancybox-is-open .fancybox-content #questionform-related_lot
19 19 ${question_form_create_questionform_related_lot_input_locator_tpl} = jquery=.fancybox-is-open .fancybox-content #questionform-related_lot option:contains("%type_id%")
  20 +${question_form_open_create_btn_locator} = jquery=#tender-part-pjax a[href*="/tender/question-create"]:first
  21 +
  22 +#for viewer
  23 +${question_answer_value_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"] .info-row.answer span.value
  24 +${question_title_value_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"] h4.callout__title
  25 +${question_description_value_locator_tpl} = jquery=#tender-question-list .js-item div[data-title*="%title%"] .info-row.description span.value
20 26
... ...
... ... @@ -130,6 +130,11 @@ def trigger_input_change_event(locator):
130 130 def convert_float_to_string(number):
131 131 return repr(float(number))
132 132
  133 +def convert_esco__float_to_string(number):
  134 + return '{0:.5f}'.format(float(number))
  135 +
  136 +def convert_float_to_string_3f(number):
  137 + return '{0:.3f}'.format(float(number))
133 138
134 139 # convert any variable to specified type
135 140 def convert_to_specified_type(value, type):
... ...
... ... @@ -63,6 +63,7 @@ fill tender general info
63 63 [Documentation] обирає потрібний тип закупівлі, чекає оновлення форми, вказує мультилотовість, заповнює
64 64 ... приховані поля + відкриває попап основних даних, заповнює його і закриває
65 65
  66 + Execute Javascript $(window).scrollTop(0)
66 67 wait until page does not contain element ${popup_dynamic_form_loading_element_locator}
67 68 ${procurement_method_type} = get from dictionary by keys ${data} procurementMethodType
68 69 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}
... ... @@ -82,6 +83,7 @@ fill tender general info
82 83 run keyword if condition is not none ${title} input text to exist visible input ${tender_form_general_tender_description_en_locator} ${description_en}
83 84 ${funders} = get from dictionary by keys ${data} funders
84 85 run keyword if condition is not none ${funders} Click Element ${tender_form_general_tender_funder_locator}
  86 + run keyword if condition is not none ${funders} fill tender form funders ${funders}
85 87 ${amount} = get from dictionary by keys ${data} value amount
86 88 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}
87 89 ${currency} = get from dictionary by keys ${data} value currency
... ... @@ -269,6 +271,14 @@ fill lot form in opened popup
269 271 # ${valueAddedTaxIncluded} = get from dictionary by keys ${data} value valueAddedTaxIncluded
270 272 # run keyword if condition is not none ${valueAddedTaxIncluded} run keyword if ${valueAddedTaxIncluded} Click Element ${tender_form_lots_value_added_tax_input_locator}
271 273
  274 +fill tender form funders
  275 + [Arguments] ${funder_attributes_array}
  276 + [Documentation] заповнення донорів тендеру
  277 +
  278 + :FOR ${funder_attributes} IN @{funder_attributes_array}
  279 + \ ${name} = get from dictionary by keys ${funder_attributes} name
  280 + \ run keyword if condition is not none ${name} select from visible list by label ${tender_form_general_tender_funder_name_locator} ${name}
  281 +
272 282 fill tender required documents
273 283 [Documentation] додає документ до усієї закупівлі для успішної валідації форми
274 284
... ... @@ -283,53 +293,6 @@ open tender search form
283 293
284 294 open page and wait element by locator ${broker_baseurl}/tenders ${tender_search_form_locator}
285 295
286   -get tender field value by name
287   - [Arguments] ${key}
288   - [Documentation] Отримати інформацію із тендера, користуючись ідентіфікатором тендеру та назвою поля ${key}.
289   -
290   - ${prepared_tender_data}= Get From Dictionary ${td_railway_crutch} data
291   - ${items}= get from dictionary by keys ${prepared_tender_data} items
292   - ${lots} = get from dictionary by keys ${prepared_tender_data} lots
293   - Run Keyword If 'enquiryPeriod.endDate' == '${key}' log many ${td_railway_crutch.data.enquiryPeriod.endDate}
294   - Run Keyword And Return If 'enquiryPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.enquiryPeriod.endDate}
295   - Run Keyword And Return If 'enquiryPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.enquiryPeriod.endDate}
296   - Run Keyword If 'tenderPeriod.endDate' == '${key}' log many ${td_railway_crutch.data.tenderPeriod.endDate}
297   - Run Keyword And Return If 'tenderPeriod.endDate' == '${key}' convert_date_to_string_contr ${td_railway_crutch.data.tenderPeriod.endDate}
298   - Run Keyword If 'value.amount' == '${key}' log many ${td_railway_crutch.data.value.amount}
299   - # ${return_value}= Run Keyword If 'value.amount' == '${key}' Evaluate ''.join('${td_railway_crutch.data.value.amount}'.split()[:-3])
300   - Run Keyword And Return If 'value.amount' == '${key}' Convert To Number ${td_railway_crutch.data.value.amount}
301   - Run Keyword And Return If 'value.amount' == '${key}' convert float to string ${td_railway_crutch.data.value.amount}
302   - Run Keyword And Return If 'items[0].description' == '${key}' convert to string ${items[0].description}
303   -
304   -
305   -get item field value by name
306   - [Arguments] ${key}
307   - [Documentation] Отримати інформацію із предмета тендера, користуючись ідентіфікатором тендеру, ідентіфікатором предмету та назвою поля ${key}.
308   -
309   - ${prepared_tender_data}= Get From Dictionary ${td_railway_crutch} data
310   - ${items}= Get From Dictionary ${prepared_tender_data} items
311   -
312   - Run Keyword If 'description' == '${key}' log many ${items[0].quantity}
313   - Run Keyword If 'description' == '${key}' log many ${items[0].description}
314   - Run Keyword And Return If 'description' == '${key}' convert to string ${items[0].description}
315   -
316   -get lot field value by name
317   - [Arguments] ${key}
318   - [Documentation] Отримати інформацію із предмета тендера, користуючись ідентіфікатором тендеру, ідентіфікатором предмету та назвою поля ${key}.
319   -
320   - ${prepared_tender_data}= Get From Dictionary ${td_railway_crutch} data
321   - ${lots} = get from dictionary by keys ${prepared_tender_data} lots
322   - ${items}= get from dictionary by keys ${prepared_tender_data} items
323   -
324   - Run Keyword If 'value.amount' == '${key}' log many ${lots[0].value.amount}
325   - # ${return_value}= Run Keyword If 'value.amount' == '${key}' Evaluate ''.join('${td_railway_crutch.data.value.amount}'.split()[:-3])
326   - Run Keyword And Return If 'value.amount' == '${key}' Convert To Number ${lots[0].value.amount}
327   - Run Keyword And Return If 'value.amount' == '${key}' convert float to string ${lots[0].value.amount}
328   - Run Keyword If 'description' == '${key}' log many ${lots[0].quantity}
329   - Run Keyword If 'description' == '${key}' log many ${lots[0].description}
330   - Run Keyword And Return If 'description' == '${key}' convert to string ${lots[0].description}
331   - Run Keyword And Return If 'title' == '${key}' convert to string ${lots[0].title}
332   -
333 296 save tender form and wait synchronization
334 297 [Documentation] натискає кнопку "Зберегти" і чекає синхронізації тендеру
335 298
... ...
... ... @@ -68,6 +68,7 @@ ${tender_form_general_tender_title_en_locator} = jquery=[id$=
68 68 ${tender_form_general_tender_description_locator} = jquery=[id$="form-description"]
69 69 ${tender_form_general_tender_description_en_locator} = jquery=[id$="form-description_en"]
70 70 ${tender_form_general_tender_funder_locator} = jquery=[id$="form-is_donor"]
  71 +${tender_form_general_tender_funder_name_locator} = jquery=[id$="-funder_organization_id"]
71 72 ${tender_form_general_value_amount_input_locator} = jquery=[id$="form-value_amount"]
72 73 ${tender_form_general_value_currency_input_locator} = jquery=[id$="form-value_currency"]
73 74 ${tender_form_general_value_added_tax_input_locator} = jquery=[id$="form-value_added_tax_included"]
... ... @@ -148,7 +149,7 @@ ${tender_view_checker_element_locator} = id=tender-ge
148 149 ${tender_sync_element_locator} = jquery=#aside-part-pjax .status-label .fa-refresh
149 150 ${tender_uaid_text_locator} = jquery=#tender-general-info .tender-id .value
150 151 ${tender_edit_btn_locator} = jquery=#aside-part-pjax a[href*='tender/update']
151   -
  152 +${tender_status_value_locator} = jquery=#aside-part-pjax .hidden.opstatus
152 153 #елемент проверки загрузки формы в попапе
153 154 ${popup_dynamic_form_loading_element_locator} = jquery=.fancybox-is-open .btn-add .fa-spin
154 155 #${add_file_to_form} xpath=//input[@type='file']
... ... @@ -160,10 +161,42 @@ ${tender_search_form_query_input_locator} = jquery=#tend
160 161 ${tender_search_form_result_locator_tpl} = jquery=#tender-list .lots__item .lot__characteristic li:contains(%query%)
161 162
162 163 # -- for viewer --
163   -${tender_milestones_0_code_value_locator} = jquery=#
164   -${tender_milestones_0_title_value_locator} = jquery=#
165   -${tender_milestones_0_percentage_value_locator} = jquery=#
166   -${tender_milestones_0_duration_days_value_locator} = jquery=#
167   -${tender_milestones_0_duration_type_value_locator} = jquery=#
168   -${tender_value_amount_value_locator} = jquery=#
  164 +${tender_title_value_locator} = jquery=#tender-part-pjax > section > div > h1
  165 +${tender_description_value_locator} = jquery=#tender-part-pjax > section > p
  166 +${tender_mainProcurementCategory_value_locator} = jquery=#tender-part-pjax .main-procurement-category-source.hidden
  167 +${tender_budget_amount_value_locator} = jquery=#tender-general-info .budget-amount.hidden
  168 +${tender_budget_amount_value_type} = float
  169 +${tender_tenderID_value_locator} = jquery=#tender-general-info .info-row.tender-id span.value
  170 +${tender_milestones_0_code_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:first .info-row.code
  171 +${tender_milestones_0_title_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:first .info-row.title
  172 +${tender_milestones_0_percentage_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:first .info-row.percentage
  173 +${tender_milestones_0_duration_days_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:first .info-row.duration_days
  174 +${tender_milestones_0_duration_type_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:first .info-row.duration_type
  175 +${tender_milestones_1_code_value_locator} = jquery=#milestones .pseudo-table__row:nth(2) .milestone-info-wrapper.hidden.info-wrapper .info-row.code
  176 +${tender_milestones_1_title_value_locator} = jquery=#milestones .pseudo-table__row:nth(2) .milestone-info-wrapper.hidden.info-wrapper .info-row.title
  177 +${tender_milestones_1_percentage_value_locator} = jquery=#milestones .pseudo-table__row:nth(2) .milestone-info-wrapper.hidden.info-wrapper .info-row.percentage
  178 +${tender_milestones_1_duration_days_value_locator} = jquery=#milestones .pseudo-table__row:nth(2) .milestone-info-wrapper.hidden.info-wrapper .info-row.duration_days
  179 +${tender_milestones_1_duration_type_value_locator} = jquery=#milestones .pseudo-table__row:nth(2) .milestone-info-wrapper.hidden.info-wrapper .info-row.duration_type
  180 +${tender_milestones_2_code_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:last .info-row.code
  181 +${tender_milestones_2_title_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:last .info-row.title
  182 +${tender_milestones_2_percentage_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:last .info-row.percentage
  183 +${tender_milestones_2_duration_days_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:last .info-row.duration_days
  184 +${tender_milestones_2_duration_type_value_locator} = jquery=#tender-part-pjax .tabs.tabs .milestone-info-wrapper.hidden.info-wrapper:last .info-row.duration_type
  185 +${tender_value_amount_value_locator} = jquery=#tender-general-info .budget-amount.hidden
  186 +${tender_value_amount_value_type} = float
  187 +${tender_value_currency_value_locator} = jquery=
  188 +${tender_value_valueAddedTaxIncluded_value_locator} = jquery=
  189 +${tender_minimalStep_amount_value_locator} = jquery=#tender-general-info .minimal-step-source.hidden
  190 +${tender_minimalStep_amount_value_type} = float
  191 +${tender_procuringEntity_name_value_locator} = jquery=#tender-part-pjax .info-row.organization span.value > span
  192 +${tender_enquiryPeriod_startDate_value_locator} = jquery=#tender-part-pjax .info-row.enquiry-period-start-date.hidden
  193 +${tender_enquiryPeriod_endDate_value_locator} = jquery=#tender-part-pjax .info-row.enquiry-period-end-date.hidden
  194 +${tender_tenderPeriod_startDate_value_locator} = jquery=#tender-part-pjax .info-row.tender-period-start-date.hidden
  195 +${tender_tenderPeriod_endDate_value_locator} = jquery=#tender-part-pjax .info-row.tender-period-end-date.hidden
  196 +
  197 +${tender_items_0_description_value_locator} = jquery=#tender-part-pjax .info-row.tender-period-end-date.hidden
  198 +
  199 +
  200 +
  201 +
169 202
... ...
Please register or login to post a comment