Showing
1 changed file
with
65 additions
and
0 deletions
publicbid_question.robot
0 → 100644
1 | +*** Settings *** | ||
2 | + | ||
3 | +Resource playtender_common.robot | ||
4 | +Resource playtender_question_variables.robot | ||
5 | + | ||
6 | +*** Keywords *** | ||
7 | + | ||
8 | +add question | ||
9 | + [Arguments] ${username} ${tender_uaid} ${type} ${type_id} ${question} | ||
10 | + [Documentation] Створити запитання з question в описі для тендера tender_uaid. | ||
11 | + | ||
12 | + click visible element ${question_form_open_btn_locator} | ||
13 | + open popup by btn locator ${question_form_open_create_btn_locator} | ||
14 | + Wait Until Page Contains ${popup_opened_content_success_locator} 60 | ||
15 | + wait until element is visible ${question_form_create_questionform_title_input_locator} 60 | ||
16 | + wait until popup is visible | ||
17 | +# input text to exist visible input ${question_form_open_form_answer_input_locator} ${question.data.answer} | ||
18 | + Run Keyword If '${type}' == 'tender' Select From List By Label ${question_form_create_questionform_related_of_input_locator} Закупівля | ||
19 | + Run Keyword If '${type}' == 'lot' Select From List By Label ${question_form_create_questionform_related_of_input_locator} Лот | ||
20 | + Run Keyword If '${type}' == 'lot' run keyword and ignore error Click Element ${question_form_create_questionform_related_lot_input_locator} | ||
21 | + ${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} | ||
22 | + Run Keyword If '${type}' == 'lot' run keyword and ignore error Click Element ${question_form_create_questionform_related_lot_input_locator} | ||
23 | + Run Keyword If '${type}' == 'item' Select From List By Label ${question_form_create_questionform_related_of_input_locator} Предмет закупівлі | ||
24 | + Run Keyword If '${type}' == 'item' run keyword and ignore error Click Element ${question_form_create_questionform_related_item_input_locator} | ||
25 | + ${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} | ||
26 | + Run Keyword If '${type}' == 'item' run keyword and ignore error Click Element ${question_questionform_related_item_input_locator} | ||
27 | + input text to exist visible input ${question_form_create_questionform_title_input_locator} ${question.data.title} | ||
28 | + input text to exist visible input ${question_form_create_questionform_description_input_locator} ${question.data.description} | ||
29 | + submit form and check result ${question_form_answer_submit_btn_locator} ${question_form_submit_success_msg} ${tender_created_checker_element_locator} ${true} | ||
30 | +# click visible element ${question_form_answer_submit_btn_locator} | ||
31 | + wait until page does not contain element with reloading ${tender_sync_element_locator} | ||
32 | + sleep 5 | ||
33 | + | ||
34 | +answer question | ||
35 | + [Arguments] ${answer_data} ${question_id} | ||
36 | + [Documentation] Дати відповідь answer_data на запитання з question_id в описі для тендера tender_uaid. | ||
37 | + | ||
38 | + click visible element ${question_form_open_btn_locator} | ||
39 | + ${question_open_form_answer_locator} = replace string ${question_open_form_answer_btn_locator_tpl} %title% ${question_id} | ||
40 | + wait until page contains element with reloading ${question_open_form_answer_locator} | ||
41 | + ${question_form_open_form_answer_btn_locator} = replace string ${question_form_open_form_answer_btn_locator_tpl} %title% ${question_id} | ||
42 | + wait until page contains element with reloading ${question_form_open_form_answer_btn_locator} | ||
43 | + open popup by btn locator ${question_form_open_form_answer_btn_locator} | ||
44 | + input text to exist visible input ${question_answer_form_answer_input_locator} ${answer_data.data.answer} | ||
45 | + submit form and check result ${question_answer_form_submit_btn_locator} ${question_form_submit_answer_success_msg} ${true} | ||
46 | + | ||
47 | +get question information | ||
48 | + [Arguments] ${question_id} ${field_name} | ||
49 | + [Documentation] Отримати значення поля field_name із запитання з question_id | ||
50 | + ... в описі для тендера tender_uaid. | ||
51 | + | ||
52 | + submit form and check result ${bid_form_refresh_btn_locator} ${bid_form_refresh_success_msg} ${tender_created_checker_element_locator} ${true} | ||
53 | + click visible element ${question_form_open_btn_locator} | ||
54 | + ${question_open_form_answer_locator} = replace string ${question_open_form_answer_btn_locator_tpl} %title% ${question_id} | ||
55 | + wait until page contains element with reloading ${question_open_form_answer_locator} | ||
56 | + ${question_title_value_locator} = Run Keyword If 'title' == '${field_name}' replace string ${question_title_value_locator_tpl} %title% ${question_id} | ||
57 | + ${question_answer_value_locator} = Run Keyword If 'answer' == '${field_name}' replace string ${question_answer_value_locator_tpl} %title% ${question_id} | ||
58 | + ${question_description_value_locator} = Run Keyword If 'description' == '${field_name}' replace string ${question_description_value_locator_tpl} %title% ${question_id} | ||
59 | + Run Keyword If 'answer' == '${field_name}' wait until page contains element with reloading ${question_answer_value_locator} | ||
60 | + ${return_value} = Run Keyword If 'title' == '${field_name}' get_text ${question_title_value_locator} | ||
61 | + ... ELSE Run Keyword If 'answer' == '${field_name}' get_text ${question_answer_value_locator} | ||
62 | + ... ELSE Run Keyword If 'description' == '${field_name}' get_text ${question_description_value_locator} | ||
63 | + [Return] ${return_value} | ||
64 | + | ||
65 | + |
Please
register
or
login
to post a comment