Showing
1 changed file
with
257 additions
and
0 deletions
publicbid_bid.robot
0 → 100644
1 | +*** Settings *** | ||
2 | + | ||
3 | +Resource playtender_common.robot | ||
4 | +Resource playtender_variables.robot | ||
5 | +Resource playtender_bid_variables.robot | ||
6 | + | ||
7 | +*** Keywords *** | ||
8 | + | ||
9 | + | ||
10 | +fill bid form | ||
11 | + [Arguments] ${tender_uaid} ${bid} ${lots_ids} ${features_ids} | ||
12 | + [Documentation] Подати цінову пропозицію bid для тендера tender_uaid на лоти lots_ids (якщо lots_ids != None) з неціновими показниками features_ids (якщо features_ids != None). | ||
13 | + | ||
14 | + submit form and check result ${bid_form_refresh_btn_locator} ${bid_form_refresh_success_msg} ${tender_created_checker_element_locator} ${true} | ||
15 | + open popup by btn locator ${bid_form_open_btn_locator} ${bid_popup_locator} | ||
16 | + ${value} = get from dictionary by keys ${bid.data} value amount | ||
17 | +# ${amount} = run keyword if condition is not none ${value} convert_float_to_string ${bid.data.value.amount} | ||
18 | + run keyword if condition is not none ${value} input number to exist visible input ${bid_form_value_amount_input_locator} ${value} | ||
19 | + capture page screenshot | ||
20 | +# ${lots} = get from dictionary by keys ${data} lots | ||
21 | + run keyword if condition is not none ${lots_ids} fill bid form lots ${bid} ${lots_ids} ${features_ids} | ||
22 | + capture page screenshot | ||
23 | +# run keyword if condition is none ${lots_ids} fill bid form whithout lots ${bid} | ||
24 | +# ${features} = get from dictionary by keys ${data} features | ||
25 | +# run keyword if condition is not none ${features_ids} fill bid form features ${bid} ${tender_form_general_panel_add_feature_btn_locator} | ||
26 | + fill bid required documents_all | ||
27 | + capture page screenshot | ||
28 | +## submit form and check result ${bid_form_submit_btn_locator} ${bid_form_submit_success_msg} ${tender_created_checker_element_locator} | ||
29 | + | ||
30 | +fill bid form lots | ||
31 | + [Arguments] ${bid} ${lots_ids}=${None} ${features_ids}=${None} | ||
32 | + [Documentation] Заповнити лотову цінову пропозицію bid для тендера tender_uaid на лоти lots_ids з неціновими показниками features_ids (якщо features_ids != None). | ||
33 | + | ||
34 | + ${lots} = get from dictionary by keys ${bid.data} lotValues | ||
35 | + ${lots_length} = Get Length ${lots} | ||
36 | + : FOR ${INDEX} IN RANGE 0 ${lots_length} | ||
37 | + \ Run Keyword And Ignore Error run keyword if condition is not none ${lots} input number to exist visible input ${bid_form_value_amount_input_locator} ${lots[${INDEX}].value.amount} | ||
38 | + \ capture page screenshot | ||
39 | + \ ${self_qualified} = get from dictionary by keys ${bid.data} selfQualified | ||
40 | +# \ run keyword if condition is not none ${self_qualified} click visible element ${bid_form_value_self_qualified_input_locator} | ||
41 | + \ run keyword if condition is not none ${self_qualified} execute javascript $('.fancybox-is-open .fancybox-content input[id*="-self_qualified"]').click() | ||
42 | + \ capture page screenshot | ||
43 | + \ ${self_eligible} = get from dictionary by keys ${bid.data} selfEligible | ||
44 | +# \ run keyword if condition is not none ${self_eligible} click visible element ${bid_form_value_self_eligible_input_locator} | ||
45 | + \ run keyword if condition is not none ${self_eligible} execute javascript $('.fancybox-is-open .fancybox-content input[id*="-self_eligible"]').click() | ||
46 | + \ capture page screenshot | ||
47 | + \ ${feature_id} = get from dictionary by keys ${bid.data} parameters | ||
48 | + \ run keyword if condition is not none ${feature_id} fill bid form features ${feature_id} | ||
49 | + \ capture page screenshot | ||
50 | + \ run keyword if '${mode}' in 'open_esco' fill bid form lots Esco ${bid.data.lotValues} | ||
51 | + | ||
52 | +fill bid form features | ||
53 | + [Arguments] ${bid_parameters} | ||
54 | + [Documentation] Заповнити нецінові показники цінової пропозиції. | ||
55 | + | ||
56 | + log many ${bid_parameters} | ||
57 | + ${features_length} = Get Length ${bid_parameters} | ||
58 | + : FOR ${INDEX} IN RANGE 0 ${features_length} | ||
59 | + \ ${bid_form_feature_input_locator} replace string ${bid_form_feature_input_locator_tpl} %title% ${bid_parameters[${INDEX}]['code']} | ||
60 | + \ ${bid_form_get_feature_input_locator} replace string ${bid_form_get_feature_input_locator_tpl} %title% ${bid_parameters[${INDEX}]['code']} | ||
61 | + \ ${bid_form_feature_input_locator_select} replace string ${bid_form_feature_input_locator_select_tpl} %title% ${bid_parameters[${INDEX}]['code']} | ||
62 | + \ ${value_enum} = convert float to string ${bid_parameters[${INDEX}]['value']} | ||
63 | + \ ${bid_form_feature_value_input_locator} set variable ${bid_form_feature_input_locator} ${bid_form_feature_value_input_locator_tpl} | ||
64 | + \ ${bid_form_get_feature_value_input_locator} set variable ${bid_form_get_feature_input_locator} ${bid_form_get_feature_value_input_locator_tpl} | ||
65 | + \ ${bid_form_feature_value_input_locator} replace string ${bid_form_feature_value_input_locator} _ ' ' | ||
66 | + \ ${bid_form_get_feature_value_input_locator} replace string ${bid_form_get_feature_value_input_locator} _ ' ' | ||
67 | + \ ${bid_form_feature_value_input_locator} replace string ${bid_form_feature_value_input_locator} %value% ${value_enum} | ||
68 | + \ ${bid_form_get_feature_value_input_locator} replace string ${bid_form_get_feature_value_input_locator} %value% ${value_enum} | ||
69 | + \ ${enum_val} set variable ${bid_form_get_feature_value_input_locator} | ||
70 | + \ ${enum_val1}= run keyword if ${bid_parameters[${INDEX}]['value']} == 0 Execute Javascript return $('[data-weight-source="0"]').text() | ||
71 | + \ ... ELSE Execute Javascript ${enum_val} | ||
72 | + \ capture page screenshot | ||
73 | + \ Run Keyword And Ignore Error select from list by label ${bid_form_feature_input_locator_select} ${enum_val1} | ||
74 | + \ capture page screenshot | ||
75 | + | ||
76 | +fill bid form lots Esco | ||
77 | + [Arguments] ${values} | ||
78 | + [Documentation] Заповнити цінову пропозицію Esco | ||
79 | + | ||
80 | + log many ${values} | ||
81 | + ${values_length} = Get Length ${values} | ||
82 | + : FOR ${INDEX} IN RANGE 0 ${values_length} | ||
83 | + \ input number to exist visible input ${bid_form_value_yearly_payments_percentage_input_locator} ${values[${INDEX}].value.yearlyPaymentsPercentage} | ||
84 | + \ capture page screenshot | ||
85 | + \ input text to exist visible input ${bid_form_value_contract_duration_years_input_locator} ${values[${INDEX}].value.contractDuration.years} | ||
86 | + \ capture page screenshot | ||
87 | + \ input text to exist visible input ${bid_form_value_contract_duration_days_input_locator} ${values[${INDEX}].value.contractDuration.days} | ||
88 | + \ capture page screenshot | ||
89 | + \ fill bid form lots Esco AnnualCostsReduction ${values[${INDEX}].value.annualCostsReduction} | ||
90 | + \ capture page screenshot | ||
91 | + | ||
92 | +fill bid form lots Esco AnnualCostsReduction | ||
93 | + [Arguments] ${values} | ||
94 | + [Documentation] Заповнити цінову пропозицію Esco (параметр AnnualCostsReduction). | ||
95 | + | ||
96 | + ${input_index} = set variable 1 | ||
97 | + : FOR ${value} IN @{values} | ||
98 | + \ ${input_index_tmp}= convert to string ${input_index} | ||
99 | + \ ${bid_form_value_annual_costs_reduction_input_locator} replace string ${bid_form_value_annual_costs_reduction_input_locator_tpl} %index% ${input_index_tmp} | ||
100 | + \ input number to exist visible input ${bid_form_value_annual_costs_reduction_input_locator} ${value} | ||
101 | + \ ${input_index} = evaluate ${input_index} + 1 | ||
102 | + | ||
103 | +fill bid required documents_all | ||
104 | + [Arguments] | ||
105 | + [Documentation] Додати фейковий документ до цінової пропозиції при створенні. | ||
106 | + | ||
107 | + ${file_path} ${file_name} ${file_content} = create_fake_doc | ||
108 | +# click visible element and wait until page contains element ${open_form_add_doc_lot_btn_locator} jquery=.modal.modal-form.js-form-popup.fancybox-content | ||
109 | + #click visible element ${bid_form_add_document_all_btn_locator} | ||
110 | + capture page screenshot | ||
111 | +### execute javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents .js-upload-documents input[type$="file"]:first').click() | ||
112 | + capture page screenshot | ||
113 | + choose file ${add_file_to_bid_form_locator} ${file_path} | ||
114 | + capture page screenshot | ||
115 | + wait until element is visible ${bid_form_add_document_type_input_locator} | ||
116 | +# submit current visible popup | ||
117 | + Run Keyword And Ignore Error Select From List By Value ${bid_form_add_document_type_input_locator} qualificationDocuments | ||
118 | + click visible element ${bid_form_add_document_description_btn_locator} | ||
119 | + capture page screenshot | ||
120 | + wait until element is visible ${bid_form_add_document_description_input_locator} | ||
121 | + input text to exist visible input ${bid_form_add_document_description_input_locator} test2 | ||
122 | + click visible element ${bid_form_add_document_close_description_btn_locator} | ||
123 | + capture page screenshot | ||
124 | + | ||
125 | +fill bid form edit | ||
126 | + [Arguments] ${fieldname} ${fieldvalue} | ||
127 | + [Documentation] Змінити поле fieldname на fieldvalue цінової пропозиції користувача username для тендера tender_uaid. | ||
128 | + | ||
129 | + open popup by btn locator ${bid_form_open_btn_locator} ${bid_popup_locator} | ||
130 | + Run Keyword If '${fieldname}' == 'lotValues[0].value.amount' or '${fieldname}' == 'value.amount' and '${mode}' != 'open_esco' input number to exist visible input ${bid_form_value_amount_input_locator} ${fieldvalue} | ||
131 | +# submit form and check result ${bid_form_submit_btn_locator} ${bid_form_submit_edit_success_msg} ${tender_created_checker_element_locator} | ||
132 | + | ||
133 | + | ||
134 | +add document to bid | ||
135 | + [Arguments] ${path} ${doc_type} ${doc_name} | ||
136 | + #=documents | ||
137 | + [Documentation] Завантажити документ типу doc_type, який знаходиться за шляхом path, | ||
138 | + ... до цінової пропозиції користувача username для тендера tender_uaid. | ||
139 | + | ||
140 | + open popup by btn locator ${bid_form_open_btn_locator} ${bid_popup_locator} | ||
141 | +### execute javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents .js-upload-documents input[type$="file"]:first').click() | ||
142 | + choose file ${add_file_to_bid_form_locator} ${path} | ||
143 | + run keyword and ignore error wait until page does not contain element ${popup_dynamic_form_loading_element_locator} | ||
144 | + wait until element is visible ${bid_form_add_document_type_input_locator} | ||
145 | +# submit current visible popup | ||
146 | + log many ${doc_type} | ||
147 | +# run keyword if '${doc_type}' == 'documents' Select From List By Value ${bid_form_add_document_type_input_locator} qualificationDocuments | ||
148 | +# ... else Select From List By Value ${bid_form_add_document_type_input_locator} ${doc_type} | ||
149 | + Run Keyword And Ignore Error select from visible list by value ${bid_form_add_document_type_input_locator} commercialProposal | ||
150 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'documents' and "${mode}" not in "openeu open_competitive_dialogue" select from visible list by value ${bid_form_add_document_type_input_locator} commercialProposal | ||
151 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'documents' and "${mode}" in "openeu open_competitive_dialogue" select from visible list by value ${bid_form_add_document_type_input_locator} qualificationDocuments | ||
152 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'financial_documents' select from visible list by value ${bid_form_add_document_type_input_locator} commercialProposal | ||
153 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'qualification_documents' select from visible list by value ${bid_form_add_document_type_input_locator} qualificationDocuments | ||
154 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'eligibility_documents' select from visible list by value ${bid_form_add_document_type_input_locator} eligibilityDocuments | ||
155 | + capture page screenshot | ||
156 | + | ||
157 | + Run Keyword And Ignore Error Execute Javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents select[id*="-document_type"]:last').val('commercialProposal').change() | ||
158 | + capture page screenshot | ||
159 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'documents' and "${mode}" not in "openeu open_competitive_dialogue" Execute Javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents select[id*="-document_type"]:last').val('commercialProposal').change() | ||
160 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'documents' and "${mode}" in "openeu open_competitive_dialogue" Execute Javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents select[id*="-document_type"]:last').val('qualificationDocuments').change() | ||
161 | + capture page screenshot | ||
162 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'financial_documents' Execute Javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents select[id*="-document_type"]:last').val('commercialProposal').change() | ||
163 | + capture page screenshot | ||
164 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'qualification_documents' Execute Javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents select[id*="-document_type"]:last').val('qualificationDocuments').change() | ||
165 | + capture page screenshot | ||
166 | + Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'eligibility_documents' Execute Javascript $('.fancybox-is-open .fancybox-content .field-bidform-documents select[id*="-document_type"]:last').val('eligibilityDocuments').change() | ||
167 | +# Run Keyword And Ignore Error select from visible list by value ${bid_form_add_document_type_input_locator} commercialProposal | ||
168 | +# Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'documents' select from visible list by value ${bid_form_add_document_type_input_locator} commercialProposal | ||
169 | +# Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'financial_documents' select from visible list by value ${bid_form_add_document_type_input_locator} commercialProposal | ||
170 | +# Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'qualification_documents' select from visible list by value ${bid_form_add_document_type_input_locator} qualificationDocuments | ||
171 | +# Run Keyword And Ignore Error Run Keyword If '${doc_type}' == 'eligibility_documents' select from visible list by value ${bid_form_add_document_type_input_locator} eligibilityDocuments | ||
172 | + capture page screenshot | ||
173 | + | ||
174 | + click visible element ${bid_form_add_document_description_btn_locator} | ||
175 | + wait until element is visible ${bid_form_add_document_description_input_locator} | ||
176 | + input text to exist visible input ${bid_form_add_document_description_input_locator} test2 | ||
177 | + click visible element ${bid_form_add_document_close_description_btn_locator} | ||
178 | + | ||
179 | +document to bid edit | ||
180 | + [Arguments] ${path} ${doc_type}=documents | ||
181 | + [Documentation] Змінити документ з doc_id в описі в пропозиції користувача username для | ||
182 | + ... тендера tender_uaid на документ, який знаходиться по шляху path. | ||
183 | + | ||
184 | + open popup by btn locator ${bid_form_open_btn_locator} ${bid_popup_locator} | ||
185 | +# click visible element ${bid_form_edit_document_all_btn_locator} | ||
186 | + capture page screenshot | ||
187 | + choose file ${bid_form_edit_document_all_btn_locator} ${path} | ||
188 | + capture page screenshot | ||
189 | +# wait until element is visible ${bid_form_add_document_type_input_locator} | ||
190 | + | ||
191 | +fill bid form edit document | ||
192 | + [Arguments] ${doc_data} ${doc_id} | ||
193 | + [Documentation] Змінити тип документа з doc_id в заголовку в пропозиції користувача | ||
194 | + ... username для тендера tender_uaid. Дані про новий тип документа знаходяться в doc_data. | ||
195 | + | ||
196 | + open popup by btn locator ${bid_form_open_btn_locator} ${bid_popup_locator} | ||
197 | + ##### BOF - TMP for confidentiality##### | ||
198 | + execute javascript $('#tender-bid-form .documents-dynamic-forms-wrapper:last [href$="#edit"]:last').click() | ||
199 | +# click visible element $('#tender-bid-form .documents-dynamic-forms-wrapper:last [href$="#edit"]:last').click() | ||
200 | + set element scroll into view ${bid_form_add_document_close_description_btn_locator} | ||
201 | + capture page screenshot | ||
202 | + wait until element is visible ${bid_form_add_document_description_input_locator} 60 | ||
203 | + execute javascript $('#tender-bid-form .documents-dynamic-forms-wrapper:last .popover.fade.top.in [id$="-confidentiality"]').click() | ||
204 | + | ||
205 | +# click visible element ${bid_form_add_document_confidentiality_input_locator} | ||
206 | + capture page screenshot | ||
207 | + input text to exist visible input ${bid_form_add_document_confidentialityrationale_input_locator} ${doc_data.data.confidentialityRationale} | ||
208 | + capture page screenshot | ||
209 | + click visible element ${bid_form_add_document_close_description_btn_locator} | ||
210 | + capture page screenshot | ||
211 | + ##### EOF - TMP ##### | ||
212 | + | ||
213 | +get bid information | ||
214 | + [Arguments] ${field} | ||
215 | + [Documentation] Отримати значення поля field пропозиції користувача | ||
216 | + ... username для тендера tender_uaid. | ||
217 | + | ||
218 | + capture page screenshot | ||
219 | + Run Keyword If 'status' == '${field}' submit form and check result ${bid_form_refresh_btn_locator} ${bid_form_refresh_success_msg} ${tender_created_checker_element_locator} ${true} | ||
220 | + Run Keyword If 'status' != '${field}' open popup by btn locator ${bid_form_open_btn_locator} ${bid_popup_locator} | ||
221 | +# click visible element ${bid_form_open_btn_locator} | ||
222 | + capture page screenshot | ||
223 | + Run Keyword If 'status' != '${field}' wait until popup is visible | ||
224 | +# ${question_open_form_answer_locator} = replace string ${question_open_form_answer_btn_locator_tpl} %title% ${question_id} | ||
225 | +# wait until page contains element with reloading ${question_open_form_answer_locator} | ||
226 | + capture page screenshot | ||
227 | + Run Keyword If 'status' == '${field}' submit form and check result ${bid_form_refresh_btn_locator} ${bid_form_refresh_success_msg} ${tender_created_checker_element_locator} ${true} | ||
228 | + #${return_value} = Run Keyword If 'lotValues[0].value.amount' == '${field}' get value by locator on opened page ${bid_lotValues_0_value_amount_value_locator} | ||
229 | + ${return_value} = Run Keyword If 'lotValues[0].value.amount' == '${field}' get bid value ${bid_lotValues_0_value_amount_value_locator} | ||
230 | + ... ELSE Run Keyword If 'status' == '${field}' get value by locator on opened page ${bid_form_bid_status_btn_locator} | ||
231 | + ... ELSE Run Keyword If 'value.amount' == '${field}' get bid value ${bid_form_value_amount_input_locator} | ||
232 | +## ${return_value} = Run Keyword If 'lotValues[0].value.amount' == '${field}' get value by locator on opened page ${bid_lotValues_0_value_amount_value_locator} | ||
233 | +# ... ELSE Run Keyword If 'status' == '${field}' get_text ${bid_form_bid_status_btn_locator} | ||
234 | +## ... ELSE Run Keyword If 'status' == '${field}' get value by locator on opened page ${bid_form_bid_status_btn_locator} | ||
235 | +## ... ELSE Run Keyword If 'value.amount' == '${field}' get value by locator on opened page ${bid_form_value_amount_input_locator} | ||
236 | +# submit current visible popup | ||
237 | +## ${return_value} = Run Keyword If 'lotValues[0].value.amount' == '${field}' or 'value.amount' == '${field}' playtender_service.split_joinvalue ${return_value} | ||
238 | +## ${return_value} = Run Keyword If 'lotValues[0].value.amount' == '${field}' or 'value.amount' == '${field}' Convert To Number ${return_value} | ||
239 | + [Return] ${return_value} | ||
240 | + | ||
241 | +fill bid form remove | ||
242 | + [Documentation] Змінити статус цінової пропозиції для тендера tender_uaid | ||
243 | + ... користувача username на cancelled. | ||
244 | + | ||
245 | + click visible element ${bid_form_remove_btn_locator} | ||
246 | + submit form and check result ${alert_opened_close_bid_btn_locator} ${bid_form_submit_remove_success_msg} ${tender_created_checker_element_locator} ${true} | ||
247 | + | ||
248 | +get bid value | ||
249 | + [Arguments] ${field} | ||
250 | + [Documentation] Отримати значення поля field пропозиції користувача | ||
251 | + ... username для тендера tender_uaid. | ||
252 | + | ||
253 | + ${return_value} = get value by locator on opened page ${field} | ||
254 | + ${return_value} = playtender_service.split_joinvalue ${return_value} | ||
255 | + ${return_value} = Convert To Number ${return_value} | ||
256 | + [Return] ${return_value} | ||
257 | + |
Please
register
or
login
to post a comment