Commit 47a1261a8b65aeaa2628a7d179796d0823f66e8f
1 parent
454bac38
Newtend: tender details view + ask question
Showing
3 changed files
with
360 additions
and
48 deletions
| @@ -4,11 +4,39 @@ Library String | @@ -4,11 +4,39 @@ Library String | ||
| 4 | Library DateTime | 4 | Library DateTime |
| 5 | 5 | ||
| 6 | *** Variables *** | 6 | *** Variables *** |
| 7 | -${locator.tenderId} jquery=h3 | 7 | +${locator.title} xpath=//div[@ng-bind="tender.title"] |
| 8 | +${locator.description} xpath=//div[@ng-bind="tender.description"] | ||
| 9 | +${locator.edit.description} name=tenderDescription | ||
| 10 | +${locator.value.amount} xpath=//div[@ng-bind="tender.value.amount"] | ||
| 11 | +${locator.minimalStep.amount} xpath=//div[@ng-bind="tender.minimalStep.amount"] | ||
| 12 | +${locator.tenderId} xpath=//a[@class="ng-binding ng-scope"] | ||
| 13 | +${locator.procuringEntity.name} xpath=//div[@ng-bind="tender.procuringEntity.name"] | ||
| 14 | +${locator.enquiryPeriod.StartDate} id=start-date-qualification | ||
| 15 | +${locator.enquiryPeriod.endDate} id=end-date-qualification | ||
| 16 | +${locator.tenderPeriod.startDate} id=start-date-registration | ||
| 17 | +${locator.tenderPeriod.endDate} id=end-date-registration | ||
| 18 | +${locator.items[0].deliveryAddress} id=deliveryAddress | ||
| 19 | +${locator.items[0].deliveryDate.endDate} id=end-date-delivery | ||
| 20 | +${locator.items[0].description} xpath=//div[@ng-bind="item.description"] | ||
| 21 | +${locator.items[0].classification.scheme} id=classifier | ||
| 22 | +${locator.items[0].classification.scheme.title} xpath=//label[contains(., "Классификатор CPV")] | ||
| 23 | +${locator.items[0].additional_classification[0].scheme} id=classifier2 | ||
| 24 | +${locator.items[0].additional_classification[0].scheme.title} xpath=//label[@for="classifier2"] | ||
| 25 | +${locator.items[0].quantity} id=quantity | ||
| 26 | +${locator.items[0].unit.name} xpath=//span[@class="unit ng-binding"] | ||
| 27 | +${locator.edit_tender} xpath=//button[@ng-if="actions.can_edit_tender"] | ||
| 28 | +${locator.edit.add_item} xpath=//a[@class="icon-black plus-black remove-field ng-scope"] | ||
| 29 | +${locator.save} xpath=//button[@class="btn btn-lg btn-default cancel pull-right ng-binding"] | ||
| 30 | +${locator.QUESTIONS[0].title} xpath=//span[@class="user ng-binding"] | ||
| 31 | +${locator.QUESTIONS[0].description} xpath=//span[@class="question-description ng-binding"] | ||
| 32 | +${locator.QUESTIONS[0].date} xpath=//span[@class="date ng-binding"] | ||
| 33 | + | ||
| 8 | 34 | ||
| 9 | *** Keywords *** | 35 | *** Keywords *** |
| 10 | Підготувати дані для оголошення тендера | 36 | Підготувати дані для оголошення тендера |
| 11 | ${INITIAL_TENDER_DATA}= prepare_test_tender_data | 37 | ${INITIAL_TENDER_DATA}= prepare_test_tender_data |
| 38 | + ${INITIAL_TENDER_DATA}= Add_data_for_GUI_FrontEnds ${INITIAL_TENDER_DATA} | ||
| 39 | + ${INITIAL_TENDER_DATA}= Update_data_for_Newtend ${INITIAL_TENDER_DATA} | ||
| 12 | [return] ${INITIAL_TENDER_DATA} | 40 | [return] ${INITIAL_TENDER_DATA} |
| 13 | 41 | ||
| 14 | Підготувати клієнт для користувача | 42 | Підготувати клієнт для користувача |
| @@ -18,8 +46,6 @@ ${locator.tenderId} jquery=h3 | @@ -18,8 +46,6 @@ ${locator.tenderId} jquery=h3 | ||
| 18 | Open Browser ${BROKERS['${USERS.users['${username}'].broker}'].url} ${USERS.users['${username}'].browser} alias=${ARGUMENTS[0]} | 46 | Open Browser ${BROKERS['${USERS.users['${username}'].broker}'].url} ${USERS.users['${username}'].browser} alias=${ARGUMENTS[0]} |
| 19 | Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size} | 47 | Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size} |
| 20 | Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position} | 48 | Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position} |
| 21 | - | ||
| 22 | -# sleep 10 | ||
| 23 | Run Keyword If '${username}' != 'Newtend_Viewer' Login | 49 | Run Keyword If '${username}' != 'Newtend_Viewer' Login |
| 24 | 50 | ||
| 25 | Login | 51 | Login |
| @@ -39,16 +65,18 @@ Login | @@ -39,16 +65,18 @@ Login | ||
| 39 | ... ${ARGUMENTS[0]} == username | 65 | ... ${ARGUMENTS[0]} == username |
| 40 | ... ${ARGUMENTS[1]} == initial_tender_data | 66 | ... ${ARGUMENTS[1]} == initial_tender_data |
| 41 | ## Inicialisation | 67 | ## Inicialisation |
| 42 | - ${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} | ||
| 43 | - ${items}= Get From Dictionary ${prepared_tender_data.data} items | ||
| 44 | - ${title}= Get From Dictionary ${prepared_tender_data.data} title | ||
| 45 | - ${description}= Get From Dictionary ${prepared_tender_data.data} description | ||
| 46 | - ${budget}= Get From Dictionary ${prepared_tender_data.data.value} amount | ||
| 47 | - ${step_rate}= Get From Dictionary ${prepared_tender_data.data.minimalStep} amount | ||
| 48 | - ${start_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} startDate | ||
| 49 | - ${end_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} endDate | ||
| 50 | - ${enquiry_start_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} startDate | ||
| 51 | - ${enquiry_end_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} endDate | 68 | + #${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} |
| 69 | + ${INITIAL_TENDER_DATA}= Add_data_for_GUI_FrontEnds ${INITIAL_TENDER_DATA} | ||
| 70 | + ${INITIAL_TENDER_DATA}= Update_data_for_Newtend ${INITIAL_TENDER_DATA} | ||
| 71 | + ${items}= Get From Dictionary ${INITIAL_TENDER_DATA.data} items | ||
| 72 | + ${title}= Get From Dictionary ${INITIAL_TENDER_DATA.data} title | ||
| 73 | + ${description}= Get From Dictionary ${INITIAL_TENDER_DATA.data} description | ||
| 74 | + ${budget}= Get From Dictionary ${INITIAL_TENDER_DATA.data.value} amount | ||
| 75 | + ${step_rate}= Get From Dictionary ${INITIAL_TENDER_DATA.data.minimalStep} amount | ||
| 76 | + ${start_date}= Get From Dictionary ${INITIAL_TENDER_DATA.data.tenderPeriod} startDate | ||
| 77 | + ${end_date}= Get From Dictionary ${INITIAL_TENDER_DATA.data.tenderPeriod} endDate | ||
| 78 | + ${enquiry_start_date}= Get From Dictionary ${INITIAL_TENDER_DATA.data.enquiryPeriod} startDate | ||
| 79 | + ${enquiry_end_date}= Get From Dictionary ${INITIAL_TENDER_DATA.data.enquiryPeriod} endDate | ||
| 52 | 80 | ||
| 53 | Selenium2Library.Switch Browser ${ARGUMENTS[0]} | 81 | Selenium2Library.Switch Browser ${ARGUMENTS[0]} |
| 54 | Go To ${USERS.users['${username}'].homepage} | 82 | Go To ${USERS.users['${username}'].homepage} |
| @@ -57,7 +85,7 @@ Login | @@ -57,7 +85,7 @@ Login | ||
| 57 | Wait Until Page Contains Новый тендер 100 | 85 | Wait Until Page Contains Новый тендер 100 |
| 58 | # Input fields tender | 86 | # Input fields tender |
| 59 | Input text name=tenderName ${title} | 87 | Input text name=tenderName ${title} |
| 60 | - Input text name=tenderDescription ${description} | 88 | + Input text ${locator.edit.description} ${description} |
| 61 | Input text id=budget ${budget} | 89 | Input text id=budget ${budget} |
| 62 | Click Element id=with-nds | 90 | Click Element id=with-nds |
| 63 | Input text id=step ${step_rate} | 91 | Input text id=step ${step_rate} |
| @@ -70,7 +98,7 @@ Login | @@ -70,7 +98,7 @@ Login | ||
| 70 | Set datetime end-date-qualification ${enquiry_end_date} | 98 | Set datetime end-date-qualification ${enquiry_end_date} |
| 71 | Set datetime start-date-qualification ${enquiry_start_date} | 99 | Set datetime start-date-qualification ${enquiry_start_date} |
| 72 | # Save | 100 | # Save |
| 73 | - Click Element xpath=//button[@class="btn btn-lg btn-default cancel pull-right ng-binding"] | 101 | + Click Element ${locator.save} |
| 74 | Wait Until Page Contains Element xpath=//div[@ng-click="goHome()"] 30 | 102 | Wait Until Page Contains Element xpath=//div[@ng-click="goHome()"] 30 |
| 75 | Click Element xpath=//div[@ng-click="goHome()"] | 103 | Click Element xpath=//div[@ng-click="goHome()"] |
| 76 | # Get Ids | 104 | # Get Ids |
| @@ -125,12 +153,10 @@ Set datetime | @@ -125,12 +153,10 @@ Set datetime | ||
| 125 | ${region}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} region | 153 | ${region}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} region |
| 126 | ${locality}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} locality | 154 | ${locality}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} locality |
| 127 | ${streetAddress}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} streetAddress | 155 | ${streetAddress}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} streetAddress |
| 128 | -# Add item | ||
| 129 | - Input text id=itemDescription${ARGUMENTS[1]} ${items_description} | ||
| 130 | - Input text id=quantity${ARGUMENTS[1]} ${quantity} | ||
| 131 | - Click Element xpath=//a[contains(text(), "единицы измерения")] | ||
| 132 | - Click Element xpath=//a[contains(text(), "единицы измерения")]/..//a[contains(text(), '${unit}')] | 156 | + |
| 157 | + Set datetime end-date-delivery${ARGUMENTS[1]} ${deliverydate_end_date} | ||
| 133 | # Set CPV | 158 | # Set CPV |
| 159 | + Wait Until Page Contains Element id=classifier1${ARGUMENTS[1]} | ||
| 134 | Click Element id=classifier1${ARGUMENTS[1]} | 160 | Click Element id=classifier1${ARGUMENTS[1]} |
| 135 | Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100 | 161 | Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100 |
| 136 | Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${cpv} | 162 | Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${cpv} |
| @@ -146,15 +172,17 @@ Set datetime | @@ -146,15 +172,17 @@ Set datetime | ||
| 146 | Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"] | 172 | Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"] |
| 147 | # Set Delivery Address | 173 | # Set Delivery Address |
| 148 | Click Element id=deliveryAddress${ARGUMENTS[1]} | 174 | Click Element id=deliveryAddress${ARGUMENTS[1]} |
| 149 | - Wait Until Page Contains Element xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] 100 | ||
| 150 | - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${countryName} | ||
| 151 | - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${ZIP} | ||
| 152 | - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${region} | ||
| 153 | - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${locality} | ||
| 154 | - Input text xpath=//input[1][@class="form-control ng-pristine ng-untouched ng-valid"] ${streetAddress} | 175 | + Wait Until Page Contains Element xpath=//input[@ng-model="deliveryAddress.postalCode"] 20 |
| 176 | + Input text xpath=//input[@ng-model="deliveryAddress.postalCode"] ${ZIP} | ||
| 177 | + Input text xpath=//input[@ng-model="deliveryAddress.region"] ${region} | ||
| 178 | + Input text xpath=//input[@ng-model="deliveryAddress.locality"] ${locality} | ||
| 179 | + Input text xpath=//input[@ng-model="deliveryAddress.streetAddress"] ${streetAddress} | ||
| 155 | Click Element xpath=//button[@class="btn btn-lg single-btn ng-binding"] | 180 | Click Element xpath=//button[@class="btn btn-lg single-btn ng-binding"] |
| 156 | -# Set Item Datetime | ||
| 157 | - Set datetime end-date-delivery${ARGUMENTS[1]} ${deliverydate_end_date} | 181 | +# Add item main info |
| 182 | + Click Element xpath=//a[contains(text(), "единицы измерения")] | ||
| 183 | + Click Element xpath=//a[contains(text(), "единицы измерения")]/..//a[contains(text(), '${unit}')] | ||
| 184 | + Input text id=quantity${ARGUMENTS[1]} ${quantity} | ||
| 185 | + Input text id=itemDescription${ARGUMENTS[1]} ${items_description} | ||
| 158 | 186 | ||
| 159 | Додати багато придметів | 187 | Додати багато придметів |
| 160 | [Arguments] @{ARGUMENTS} | 188 | [Arguments] @{ARGUMENTS} |
| @@ -162,9 +190,33 @@ Set datetime | @@ -162,9 +190,33 @@ Set datetime | ||
| 162 | ... ${ARGUMENTS[0]} == items | 190 | ... ${ARGUMENTS[0]} == items |
| 163 | ${Items_length}= Get Length ${items} | 191 | ${Items_length}= Get Length ${items} |
| 164 | : FOR ${INDEX} IN RANGE 1 ${Items_length} | 192 | : FOR ${INDEX} IN RANGE 1 ${Items_length} |
| 165 | - \ Click Element xpath=//a[@class="icon-black plus-black remove-field ng-scope"] | 193 | + \ Click Element ${locator.edit.add_item} |
| 166 | \ Додати придмет ${items[${INDEX}]} ${INDEX} | 194 | \ Додати придмет ${items[${INDEX}]} ${INDEX} |
| 167 | 195 | ||
| 196 | +Завантажити документ | ||
| 197 | + [Arguments] @{ARGUMENTS} | ||
| 198 | + [Documentation] | ||
| 199 | + ... ${ARGUMENTS[0]} == username | ||
| 200 | + ... ${ARGUMENTS[1]} == ${TENDER_UAID} | ||
| 201 | + ... ${ARGUMENTS[2]} == ${Complain} | ||
| 202 | + Fail Тест не написаний | ||
| 203 | + | ||
| 204 | +Подати скаргу | ||
| 205 | + [Arguments] @{ARGUMENTS} | ||
| 206 | + [Documentation] | ||
| 207 | + ... ${ARGUMENTS[0]} == username | ||
| 208 | + ... ${ARGUMENTS[1]} == ${TENDER_UAID} | ||
| 209 | + ... ${ARGUMENTS[2]} == ${Complain} | ||
| 210 | + Fail Не реалізований функціонал | ||
| 211 | + | ||
| 212 | +порівняти скаргу | ||
| 213 | + [Arguments] @{ARGUMENTS} | ||
| 214 | + [Documentation] | ||
| 215 | + ... ${ARGUMENTS[0]} == username | ||
| 216 | + ... ${ARGUMENTS[1]} == ${file_path} | ||
| 217 | + ... ${ARGUMENTS[2]} == ${TENDER_UAID} | ||
| 218 | + Fail Не реалізований функціонал | ||
| 219 | + | ||
| 168 | Пошук тендера по ідентифікатору | 220 | Пошук тендера по ідентифікатору |
| 169 | [Arguments] @{ARGUMENTS} | 221 | [Arguments] @{ARGUMENTS} |
| 170 | [Documentation] | 222 | [Documentation] |
| @@ -172,15 +224,267 @@ Set datetime | @@ -172,15 +224,267 @@ Set datetime | ||
| 172 | ... ${ARGUMENTS[1]} == ${TENDER_UAID} | 224 | ... ${ARGUMENTS[1]} == ${TENDER_UAID} |
| 173 | Switch browser ${ARGUMENTS[0]} | 225 | Switch browser ${ARGUMENTS[0]} |
| 174 | Go to ${USERS.users['${ARGUMENTS[0]}'].homepage} | 226 | Go to ${USERS.users['${ARGUMENTS[0]}'].homepage} |
| 175 | - Wait Until Page Contains Element xpath=//div[@class="search-field"]/input 20 | ||
| 176 | -# ${ARGUMENTS[1]}= Convert To String UA-2015-06-08-000023 | ||
| 177 | - Input text xpath=//div[@class="search-field"]/input ${ARGUMENTS[1]} | ||
| 178 | - : FOR ${INDEX} IN RANGE 1 30 | ||
| 179 | - \ Log To Console . no_newline=true | 227 | +### Індексація на тестовому сервері відключена, як наслідок пошук по UAid не працює, отож застосовую обхід цієї функціональності для розблокування наступних тестів |
| 228 | +# Wait Until Page Contains Element xpath=//div[@class="search-field"]/input 20 | ||
| 229 | +# #${ARGUMENTS[1]}= Convert To String UA-2015-06-08-000023 | ||
| 230 | +# Input text xpath=//div[@class="search-field"]/input ${ARGUMENTS[1]} | ||
| 231 | +# : FOR ${INDEX} IN RANGE 1 30 | ||
| 232 | +# \ Log To Console . no_newline=true | ||
| 180 | # \ sleep 1 | 233 | # \ sleep 1 |
| 181 | - \ ${count}= Get Matching Xpath Count xpath=//a[@class="row tender-info ng-scope"] | ||
| 182 | - \ Exit For Loop If '${count}' == '1' | ||
| 183 | - Click Element xpath=//a[@class="row tender-info ng-scope"] | ||
| 184 | - Wait Until Page Contains Element xpath=//a[@class="ng-binding ng-scope"] 30 | ||
| 185 | - ${fould_title}= Get Text xpath=//a[@class="ng-binding ng-scope"] | ||
| 186 | - Should Be Equal ${fould_title} ${ARGUMENTS[1]} | ||
| 234 | +# \ ${count}= Get Matching Xpath Count xpath=//a[@class="row tender-info ng-scope"] | ||
| 235 | +# \ Exit For Loop If '${count}' == '1' | ||
| 236 | + Sleep 2 | ||
| 237 | + Go to ${USERS.users['${ARGUMENTS[0]}'].homepage} | ||
| 238 | + ${ARGUMENTS[1]}= Convert To String Воркераунд для проходженя наступних тестів - пошук не працює. | ||
| 239 | +### | ||
| 240 | + Wait Until Page Contains Element xpath=(//a[@class="row tender-info ng-scope"]) 20 | ||
| 241 | + Sleep 5 | ||
| 242 | + Click Element xpath=(//a[@class="row tender-info ng-scope"]) | ||
| 243 | +# debug | ||
| 244 | + Wait Until Page Contains Element xpath=//a[@class="ng-binding ng-scope"]|//span[@class="ng-binding ng-scope"] 30 | ||
| 245 | +# ${found_title}= Get Text xpath=//a[@class="ng-binding ng-scope"] | ||
| 246 | +# Should Be Equal ${found_title} ${ARGUMENTS[1]} | ||
| 247 | +#<span ng-switch-when="true" class="ng-binding ng-scope">UA-2015-09-02-000151</span> | ||
| 248 | + | ||
| 249 | +отримати інформацію із тендера | ||
| 250 | + [Arguments] @{ARGUMENTS} | ||
| 251 | + [Documentation] | ||
| 252 | + ... ${ARGUMENTS[0]} == username | ||
| 253 | + ... ${ARGUMENTS[1]} == fieldname | ||
| 254 | + Switch browser ${ARGUMENTS[0]} | ||
| 255 | + ${return_value}= run keyword отримати інформацію про ${ARGUMENTS[1]} | ||
| 256 | + [return] ${return_value} | ||
| 257 | + | ||
| 258 | +отримати текст із поля і показати на сторінці | ||
| 259 | + [Arguments] ${fieldname} | ||
| 260 | + sleep 1 | ||
| 261 | + ${return_value}= Get Text ${locator.${fieldname}} | ||
| 262 | + [return] ${return_value} | ||
| 263 | + | ||
| 264 | +отримати інформацію про title | ||
| 265 | + ${title}= отримати текст із поля і показати на сторінці title | ||
| 266 | + [return] ${title} | ||
| 267 | + | ||
| 268 | +отримати інформацію про description | ||
| 269 | + ${description}= отримати текст із поля і показати на сторінці description | ||
| 270 | + [return] ${description} | ||
| 271 | + | ||
| 272 | +отримати інформацію про tenderId | ||
| 273 | + ${tenderId}= отримати текст із поля і показати на сторінці tenderId | ||
| 274 | + [return] ${tenderId} | ||
| 275 | + | ||
| 276 | +отримати інформацію про value.amount | ||
| 277 | + ${valueAmount}= отримати текст із поля і показати на сторінці value.amount | ||
| 278 | + ${valueAmount}= Convert To Number ${valueAmount.split(' ')[0]} | ||
| 279 | + [return] ${valueAmount} | ||
| 280 | + | ||
| 281 | +отримати інформацію про minimalStep.amount | ||
| 282 | + ${minimalStepAmount}= отримати текст із поля і показати на сторінці minimalStep.amount | ||
| 283 | + ${minimalStepAmount}= Convert To Number ${minimalStepAmount.split(' ')[0]} | ||
| 284 | + [return] ${minimalStepAmount} | ||
| 285 | + | ||
| 286 | +Внести зміни в тендер | ||
| 287 | + [Arguments] @{ARGUMENTS} | ||
| 288 | + [Documentation] | ||
| 289 | + ... ${ARGUMENTS[0]} == username | ||
| 290 | + ... ${ARGUMENTS[1]} == id | ||
| 291 | + ... ${ARGUMENTS[2]} == fieldname | ||
| 292 | + ... ${ARGUMENTS[3]} == fieldvalue | ||
| 293 | + Switch browser ${ARGUMENTS[0]} | ||
| 294 | + Click button ${locator.edit_tender} | ||
| 295 | + Wait Until Page Contains Element ${locator.edit.${ARGUMENTS[2]}} 20 | ||
| 296 | + Input Text ${locator.edit.${ARGUMENTS[2]}} ${ARGUMENTS[3]} | ||
| 297 | + Click Element ${locator.save} | ||
| 298 | + Wait Until Page Contains Element ${locator.${ARGUMENTS[2]}} 20 | ||
| 299 | + ${result_field}= отримати текст із поля і показати на сторінці ${ARGUMENTS[2]} | ||
| 300 | + Should Be Equal ${result_field} ${ARGUMENTS[3]} | ||
| 301 | + | ||
| 302 | +отримати інформацію про procuringEntity.name | ||
| 303 | + ${procuringEntity_name}= отримати текст із поля і показати на сторінці procuringEntity.name | ||
| 304 | + [return] ${procuringEntity_name} | ||
| 305 | + | ||
| 306 | +отримати інформацію про enquiryPeriod.endDate | ||
| 307 | + ${enquiryPeriodEndDate}= отримати текст із поля і показати на сторінці enquiryPeriod.endDate | ||
| 308 | + [return] ${enquiryPeriodEndDate} | ||
| 309 | + | ||
| 310 | +отримати інформацію про tenderPeriod.startDate | ||
| 311 | + ${tenderPeriodStartDate}= отримати текст із поля і показати на сторінці tenderPeriod.startDate | ||
| 312 | + [return] ${tenderPeriodStartDate} | ||
| 313 | + | ||
| 314 | +отримати інформацію про tenderPeriod.endDate | ||
| 315 | + ${tenderPeriodEndDate}= отримати текст із поля і показати на сторінці tenderPeriod.endDate | ||
| 316 | + [return] ${tenderPeriodEndDate} | ||
| 317 | + | ||
| 318 | +отримати інформацію про enquiryPeriod.startDate | ||
| 319 | + ${enquiryPeriodStartDate}= отримати текст із поля і показати на сторінці enquiryPeriod.StartDate | ||
| 320 | + [return] ${enquiryPeriodStartDate} | ||
| 321 | + | ||
| 322 | +отримати інформацію про items[0].description | ||
| 323 | + ${description}= отримати текст із поля і показати на сторінці items[0].description | ||
| 324 | + [return] ${description} | ||
| 325 | + | ||
| 326 | +отримати інформацію про items[0].deliveryDate.endDate | ||
| 327 | + ${deliveryDate_endDate}= отримати текст із поля і показати на сторінці items[0].deliveryDate.endDate | ||
| 328 | + [return] ${deliveryDate_endDate} | ||
| 329 | + | ||
| 330 | +отримати інформацію про items[0].deliveryLocation.latitude | ||
| 331 | + Fail Не реалізований функціонал | ||
| 332 | + | ||
| 333 | +отримати інформацію про items[0].deliveryLocation.longitude | ||
| 334 | + Fail Не реалізований функціонал | ||
| 335 | + | ||
| 336 | +## Delivery Address | ||
| 337 | +отримати інформацію про items[0].deliveryAddress.countryName | ||
| 338 | + ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 339 | + [return] ${Delivery_Address.split(', ')[1]} | ||
| 340 | + | ||
| 341 | +отримати інформацію про items[0].deliveryAddress.postalCode | ||
| 342 | + ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 343 | + [return] ${Delivery_Address.split(', ')[0]} | ||
| 344 | + | ||
| 345 | +отримати інформацію про items[0].deliveryAddress.region | ||
| 346 | + ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 347 | + [return] ${Delivery_Address.split(', ')[2]} | ||
| 348 | + | ||
| 349 | +отримати інформацію про items[0].deliveryAddress.locality | ||
| 350 | + ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 351 | + [return] ${Delivery_Address.split(', ')[3]} | ||
| 352 | + | ||
| 353 | +отримати інформацію про items[0].deliveryAddress.streetAddress | ||
| 354 | + ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 355 | + ${Delivery_Address}= Get Substring ${Delivery_Address}= 0 -2 | ||
| 356 | + [return] ${Delivery_Address.split(', ')[4]} | ||
| 357 | + | ||
| 358 | +##CPV | ||
| 359 | +отримати інформацію про items[0].classification.scheme | ||
| 360 | + ${classificationScheme}= отримати текст із поля і показати на сторінці items[0].classification.scheme.title | ||
| 361 | + [return] ${classificationScheme.split(' ')[1]} | ||
| 362 | + | ||
| 363 | +отримати інформацію про items[0].classification.id | ||
| 364 | + ${classification_id}= отримати текст із поля і показати на сторінці items[0].classification.scheme | ||
| 365 | + [return] ${classification_id.split(' - ')[0]} | ||
| 366 | + | ||
| 367 | +отримати інформацію про items[0].classification.description | ||
| 368 | + ${classification_description}= отримати текст із поля і показати на сторінці items[0].classification.scheme | ||
| 369 | + ${classification_description}= Run Keyword If '${classification_description}' == '44617100-9 - Картонки' Convert To String Cartons | ||
| 370 | + [return] ${classification_description} | ||
| 371 | + | ||
| 372 | +##ДКПП | ||
| 373 | +отримати інформацію про items[0].additionalClassifications[0].scheme | ||
| 374 | + ${additional_classificationScheme}= отримати текст із поля і показати на сторінці items[0].additional_classification[0].scheme.title | ||
| 375 | + [return] ${additional_classificationScheme.split(' ')[1]} | ||
| 376 | + | ||
| 377 | +отримати інформацію про items[0].additionalClassifications[0].id | ||
| 378 | + ${additional_classification_id}= отримати текст із поля і показати на сторінці items[0].additional_classification[0].scheme | ||
| 379 | + [return] ${additional_classification_id.split(' - ')[0]} | ||
| 380 | + | ||
| 381 | +отримати інформацію про items[0].additionalClassifications[0].description | ||
| 382 | + ${additional_classification_description}= отримати текст із поля і показати на сторінці items[0].additional_classification[0].scheme | ||
| 383 | + ${additional_classification_description}= Convert To Lowercase ${additional_classification_description} | ||
| 384 | + ${additional_classification_description}= Get Substring ${additional_classification_description}= 0 -2 | ||
| 385 | + [return] ${additional_classification_description.split(' - ')[1]} | ||
| 386 | + | ||
| 387 | +отримати інформацію про items[0].unit.name | ||
| 388 | + ${unit_name}= отримати текст із поля і показати на сторінці items[0].unit.name | ||
| 389 | + ${unit_name}= Run Keyword If '${unit_name}' == 'килограммы' Convert To String кілограм | ||
| 390 | + [return] ${unit_name} | ||
| 391 | + | ||
| 392 | +отримати інформацію про items[0].unit.code | ||
| 393 | + Fail Не реалізований функціонал | ||
| 394 | + ${unit_code}= отримати текст із поля і показати на сторінці items[0].unit.code | ||
| 395 | + [return] ${unit_code} | ||
| 396 | + | ||
| 397 | +отримати інформацію про items[0].quantity | ||
| 398 | + ${quantity}= отримати текст із поля і показати на сторінці items[0].quantity | ||
| 399 | + ${quantity}= Convert To Number ${quantity} | ||
| 400 | + [return] ${quantity} | ||
| 401 | + | ||
| 402 | +додати предмети закупівлі | ||
| 403 | + [Arguments] @{ARGUMENTS} | ||
| 404 | + [Documentation] | ||
| 405 | + ... ${ARGUMENTS[0]} = username | ||
| 406 | + ... ${ARGUMENTS[1]} = ${TENDER_UAID} | ||
| 407 | + ... ${ARGUMENTS[2]} = 3 | ||
| 408 | + ${ADDITIONAL_DATA}= prepare_test_tender_data ${BROKERS['${USERS.users['${tender_owner}'].broker}'].period_interval} multi | ||
| 409 | + #${tender_data}= Add_time_for_GUI_FrontEnds ${ADDITIONAL_DATA} | ||
| 410 | + ${items}= Get From Dictionary ${ADDITIONAL_DATA.data} items | ||
| 411 | + | ||
| 412 | + Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ||
| 413 | + #Пошук тендера по ідентифікатору ${ARGUMENTS[0]} ${ARGUMENTS[1]} | ||
| 414 | + Wait Until Page Contains Element ${locator.edit_tender} 10 | ||
| 415 | + Click Element ${locator.edit_tender} | ||
| 416 | + #Sleep 2 | ||
| 417 | + Wait Until Page Contains Element ${locator.edit.add_item} 10 | ||
| 418 | + Input text ${locator.edit.description} description | ||
| 419 | + Run keyword if '${TEST NAME}' == 'Можливість додати позицію закупівлі в тендер' додати позицію | ||
| 420 | +# debug | ||
| 421 | + Run keyword if '${TEST NAME}' != 'Можливість додати позицію закупівлі в тендер' забрати позицію | ||
| 422 | + #Sleep 2 | ||
| 423 | + Wait Until Page Contains Element ${locator.save} 10 | ||
| 424 | + Click Element ${locator.save} | ||
| 425 | + Wait Until Page Contains Element ${locator.description} 20 | ||
| 426 | + | ||
| 427 | +додати позицію | ||
| 428 | +### Не видно контролів додати пропозицію в хромі, потрібно скролити, скрол не працює. Обхід: додати лише 1 пропозицію + редагувати description для скролу. | ||
| 429 | + Click Element ${locator.edit.add_item} | ||
| 430 | + Додати придмет ${items[1]} 1 | ||
| 431 | + | ||
| 432 | +забрати позицію | ||
| 433 | + Click Element xpath=//a[@title="Добавить лот"]/preceding-sibling::a | ||
| 434 | + | ||
| 435 | + | ||
| 436 | +Задати питання | ||
| 437 | + [Arguments] @{ARGUMENTS} | ||
| 438 | + [Documentation] | ||
| 439 | + ... ${ARGUMENTS[0]} = username | ||
| 440 | + ... ${ARGUMENTS[1]} = ${TENDER_UAID} | ||
| 441 | + ... ${ARGUMENTS[2]} = question_data | ||
| 442 | + ${title}= Get From Dictionary ${ARGUMENTS[2].data} title | ||
| 443 | + ${description}= Get From Dictionary ${ARGUMENTS[2].data} description | ||
| 444 | + Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ||
| 445 | + newtend.Пошук тендера по ідентифікатору ${ARGUMENTS[0]} ${ARGUMENTS[1]} | ||
| 446 | + Click Element xpath=//a[contains(text(), "Уточнения")] | ||
| 447 | + Wait Until Page Contains Element xpath=//button[@class="btn btn-lg btn-default question-btn ng-binding ng-scope"] 20 | ||
| 448 | + Click Element xpath=//button[@class="btn btn-lg btn-default question-btn ng-binding ng-scope"] | ||
| 449 | + Wait Until Page Contains Element xpath=//input[@ng-model="title"] 10 | ||
| 450 | + Input text xpath=//input[@ng-model="title"] ${title} | ||
| 451 | + Input text xpath=//textarea[@ng-model="message"] ${description} | ||
| 452 | + Click Element xpath=//div[@ng-click="sendQuestion()"] | ||
| 453 | + Wait Until Page Contains ${description} 20 | ||
| 454 | + | ||
| 455 | +обновити сторінку з тендером | ||
| 456 | + [Arguments] @{ARGUMENTS} | ||
| 457 | + [Documentation] | ||
| 458 | + ... ${ARGUMENTS[0]} = username | ||
| 459 | + ... ${ARGUMENTS[1]} = ${TENDER_UAID} | ||
| 460 | + Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ||
| 461 | + Reload Page | ||
| 462 | + Wait Until Page Contains ${ARGUMENTS[1]} 20 | ||
| 463 | + | ||
| 464 | +отримати інформацію про QUESTIONS[0].title | ||
| 465 | + #debug | ||
| 466 | + #<span class="ng-binding">Уточнения</span> | ||
| 467 | + Wait Until Page Contains Element xpath=//span[contains(text(), "Уточнения")] 20 | ||
| 468 | + Click Element xpath=//span[contains(text(), "Уточнения")] | ||
| 469 | + Wait Until Page Contains Вы не можете задавать вопросы 20 | ||
| 470 | + ${resp}= отримати текст із поля і показати на сторінці QUESTIONS[0].title | ||
| 471 | + [return] ${resp} | ||
| 472 | + | ||
| 473 | +отримати інформацію про QUESTIONS[0].description | ||
| 474 | + ${resp}= отримати текст із поля і показати на сторінці QUESTIONS[0].description | ||
| 475 | + [return] ${resp} | ||
| 476 | + | ||
| 477 | +отримати інформацію про QUESTIONS[0].date | ||
| 478 | + ${resp}= отримати текст із поля і показати на сторінці QUESTIONS[0].date | ||
| 479 | + ${resp}= Change_day_to_month ${resp} | ||
| 480 | + [return] ${resp} | ||
| 481 | + | ||
| 482 | +Change_day_to_month | ||
| 483 | + [Arguments] @{ARGUMENTS} | ||
| 484 | + [Documentation] | ||
| 485 | + ... ${ARGUMENTS[0]} == date | ||
| 486 | + ${day}= Get Substring ${ARGUMENTS[0]} 0 2 | ||
| 487 | + ${month}= Get Substring ${ARGUMENTS[0]} 3 6 | ||
| 488 | + ${rest}= Get Substring ${ARGUMENTS[0]} 5 | ||
| 489 | + ${return_value}= Convert To String ${month}${day}${rest} | ||
| 490 | + [return] ${return_value} |
| @@ -68,7 +68,6 @@ users: | @@ -68,7 +68,6 @@ users: | ||
| 68 | username: Netcasttest | 68 | username: Netcasttest |
| 69 | homepage: "http://dz2.byustudio.in.ua" | 69 | homepage: "http://dz2.byustudio.in.ua" |
| 70 | browser: chrome | 70 | browser: chrome |
| 71 | - #browser: chrome | ||
| 72 | position: [0, 0] | 71 | position: [0, 0] |
| 73 | size: [600, 800] | 72 | size: [600, 800] |
| 74 | Newtend_Owner: | 73 | Newtend_Owner: |
| @@ -79,7 +78,7 @@ users: | @@ -79,7 +78,7 @@ users: | ||
| 79 | password: 123123 | 78 | password: 123123 |
| 80 | browser: chrome | 79 | browser: chrome |
| 81 | position: [0, 0] | 80 | position: [0, 0] |
| 82 | - size: [1000, 1100] | 81 | + size: [1200, 1200] |
| 83 | Newtend_Provider1: | 82 | Newtend_Provider1: |
| 84 | broker: Newtend | 83 | broker: Newtend |
| 85 | username: Newtendtest | 84 | username: Newtendtest |
| @@ -94,8 +93,8 @@ users: | @@ -94,8 +93,8 @@ users: | ||
| 94 | username: Newtendtest | 93 | username: Newtendtest |
| 95 | homepage: "http://dev23.newtend.com/openprocurement/tenders" | 94 | homepage: "http://dev23.newtend.com/openprocurement/tenders" |
| 96 | browser: chrome | 95 | browser: chrome |
| 97 | - position: [0, 0] | ||
| 98 | - size: [640, 450] | 96 | + position: [800, 400] |
| 97 | + size: [800, 700] | ||
| 99 | Prom_Owner: | 98 | Prom_Owner: |
| 100 | broker: Prom | 99 | broker: Prom |
| 101 | username: Promtest | 100 | username: Promtest |
| @@ -39,8 +39,12 @@ def prepare_prom_test_tender_data(): | @@ -39,8 +39,12 @@ def prepare_prom_test_tender_data(): | ||
| 39 | return munchify({'data': prom_test_tender_data()}) | 39 | return munchify({'data': prom_test_tender_data()}) |
| 40 | 40 | ||
| 41 | def compare_date(data1, data2): | 41 | def compare_date(data1, data2): |
| 42 | + LOGGER.log_message(Message("data1: {}".format(data1), "INFO")) | ||
| 43 | + LOGGER.log_message(Message("data2: {}".format(data2), "INFO")) | ||
| 42 | data1=parse(data1) | 44 | data1=parse(data1) |
| 43 | data2=parse(data2) | 45 | data2=parse(data2) |
| 46 | + LOGGER.log_message(Message("data1: {}".format(data1), "INFO")) | ||
| 47 | + LOGGER.log_message(Message("data2: {}".format(data2), "INFO")) | ||
| 44 | if data1.tzinfo is None: | 48 | if data1.tzinfo is None: |
| 45 | data1 = TIMEZONE.localize(data1) | 49 | data1 = TIMEZONE.localize(data1) |
| 46 | if data2.tzinfo is None: | 50 | if data2.tzinfo is None: |
| @@ -167,13 +171,18 @@ def newtend_date_picker_index(isodate): | @@ -167,13 +171,18 @@ def newtend_date_picker_index(isodate): | ||
| 167 | 171 | ||
| 168 | def Add_data_for_GUI_FrontEnds(INITIAL_TENDER_DATA): | 172 | def Add_data_for_GUI_FrontEnds(INITIAL_TENDER_DATA): |
| 169 | now = datetime.now() | 173 | now = datetime.now() |
| 170 | - INITIAL_TENDER_DATA.data.enquiryPeriod['startDate'] = (now + timedelta(minutes=2)).isoformat() | ||
| 171 | - INITIAL_TENDER_DATA.data.enquiryPeriod['endDate'] = (now + timedelta(minutes=3)).isoformat() | ||
| 172 | - INITIAL_TENDER_DATA.data.tenderPeriod['startDate'] = (now + timedelta(minutes=4)).isoformat() | ||
| 173 | - INITIAL_TENDER_DATA.data.tenderPeriod['endDate'] = (now + timedelta(minutes=5)).isoformat() | 174 | + #INITIAL_TENDER_DATA.data.enquiryPeriod['startDate'] = (now + timedelta(minutes=2)).isoformat() |
| 175 | + INITIAL_TENDER_DATA.data.enquiryPeriod['endDate'] = (now + timedelta(minutes=5)).isoformat() | ||
| 176 | + INITIAL_TENDER_DATA.data.tenderPeriod['startDate'] = (now + timedelta(minutes=6)).isoformat() | ||
| 177 | + INITIAL_TENDER_DATA.data.tenderPeriod['endDate'] = (now + timedelta(minutes=7)).isoformat() | ||
| 174 | return INITIAL_TENDER_DATA | 178 | return INITIAL_TENDER_DATA |
| 175 | 179 | ||
| 176 | def local_path_to_file(file_name): | 180 | def local_path_to_file(file_name): |
| 177 | path = os.getcwd() | 181 | path = os.getcwd() |
| 178 | path = path.split("brokers", 1)[0] + "/src/op_robot_tests/op_robot_tests/tests_files/documents/" + file_name | 182 | path = path.split("brokers", 1)[0] + "/src/op_robot_tests/op_robot_tests/tests_files/documents/" + file_name |
| 179 | return path | 183 | return path |
| 184 | + | ||
| 185 | +def Update_data_for_Newtend(INITIAL_TENDER_DATA): | ||
| 186 | + #INITIAL_TENDER_DATA.data.items.classification['description'] = u"Картонки" | ||
| 187 | + INITIAL_TENDER_DATA.data.procuringEntity['name'] = u"openprocurement" | ||
| 188 | + return INITIAL_TENDER_DATA |
Please
register
or
login
to post a comment