Commit 196a3acc0d4eb7e17d9b9d774ecf8d0604b5f541
1 parent
66a09b4a
Newtend: Export to separate repository
https://github.com/openprocurement/robot_tests.broker.newtend
Showing
3 changed files
with
1 additions
and
502 deletions
| @@ -38,6 +38,7 @@ gh_push = git@github.com: | @@ -38,6 +38,7 @@ gh_push = git@github.com: | ||
| 38 | barbecue = git ${remotes:gh}openprocurement/barbecue.git | 38 | barbecue = git ${remotes:gh}openprocurement/barbecue.git |
| 39 | openprocurement_client = git ${remotes:gh}openprocurement/openprocurement.client.python.git | 39 | openprocurement_client = git ${remotes:gh}openprocurement/openprocurement.client.python.git |
| 40 | robot_tests.broker.etender = git ${remotes:gh}openprocurement/robot_tests.broker.etender.git | 40 | robot_tests.broker.etender = git ${remotes:gh}openprocurement/robot_tests.broker.etender.git |
| 41 | +robot_tests.broker.newtend = git ${remotes:gh}openprocurement/robot_tests.broker.newtend.git | ||
| 41 | robot_tests.broker.privatmarket = git ${remotes:gh}openprocurement/robot_tests.broker.privatmarket.git | 42 | robot_tests.broker.privatmarket = git ${remotes:gh}openprocurement/robot_tests.broker.privatmarket.git |
| 42 | robot_tests.broker.prom = git ${remotes:gh}openprocurement/robot_tests.broker.prom.git | 43 | robot_tests.broker.prom = git ${remotes:gh}openprocurement/robot_tests.broker.prom.git |
| 43 | robot_tests.broker.publicbid = git ${remotes:gh}openprocurement/robot_tests.broker.publicbid.git | 44 | robot_tests.broker.publicbid = git ${remotes:gh}openprocurement/robot_tests.broker.publicbid.git |
| 1 | -*** Settings *** | ||
| 2 | -Library Selenium2Screenshots | ||
| 3 | -Library String | ||
| 4 | -Library DateTime | ||
| 5 | -Library newtend_service.py | ||
| 6 | - | ||
| 7 | -*** Variables *** | ||
| 8 | -${locator.title} xpath=//div[@ng-bind="tender.title"] | ||
| 9 | -${locator.description} xpath=//div[@ng-bind="tender.description"] | ||
| 10 | -${locator.edit.description} name=tenderDescription | ||
| 11 | -${locator.value.amount} xpath=//div[@ng-bind="tender.value.amount"] | ||
| 12 | -${locator.minimalStep.amount} xpath=//div[@ng-bind="tender.minimalStep.amount"] | ||
| 13 | -${locator.tenderId} xpath=//a[@class="ng-binding ng-scope"] | ||
| 14 | -${locator.procuringEntity.name} xpath=//div[@ng-bind="tender.procuringEntity.name"] | ||
| 15 | -${locator.enquiryPeriod.StartDate} id=start-date-qualification | ||
| 16 | -${locator.enquiryPeriod.endDate} id=end-date-qualification | ||
| 17 | -${locator.tenderPeriod.startDate} id=start-date-registration | ||
| 18 | -${locator.tenderPeriod.endDate} id=end-date-registration | ||
| 19 | -${locator.items[0].deliveryAddress} id=deliveryAddress | ||
| 20 | -${locator.items[0].deliveryDate.endDate} id=end-date-delivery | ||
| 21 | -${locator.items[0].description} xpath=//div[@ng-bind="item.description"] | ||
| 22 | -${locator.items[0].classification.scheme} id=classifier | ||
| 23 | -${locator.items[0].classification.scheme.title} xpath=//label[contains(., "Классификатор CPV")] | ||
| 24 | -${locator.items[0].additional_classification[0].scheme} id=classifier2 | ||
| 25 | -${locator.items[0].additional_classification[0].scheme.title} xpath=//label[@for="classifier2"] | ||
| 26 | -${locator.items[0].quantity} id=quantity | ||
| 27 | -${locator.items[0].unit.name} xpath=//span[@class="unit ng-binding"] | ||
| 28 | -${locator.edit_tender} xpath=//button[@ng-if="actions.can_edit_tender"] | ||
| 29 | -${locator.edit.add_item} xpath=//a[@class="icon-black plus-black remove-field ng-scope"] | ||
| 30 | -${locator.save} xpath=//button[@class="btn btn-lg btn-default cancel pull-right ng-binding"] | ||
| 31 | -${locator.QUESTIONS[0].title} xpath=//span[@class="user ng-binding"] | ||
| 32 | -${locator.QUESTIONS[0].description} xpath=//span[@class="question-description ng-binding"] | ||
| 33 | -${locator.QUESTIONS[0].date} xpath=//span[@class="date ng-binding"] | ||
| 34 | - | ||
| 35 | -*** Keywords *** | ||
| 36 | -Підготувати дані для оголошення тендера | ||
| 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} | ||
| 40 | - [return] ${INITIAL_TENDER_DATA} | ||
| 41 | - | ||
| 42 | -Підготувати клієнт для користувача | ||
| 43 | - [Arguments] @{ARGUMENTS} | ||
| 44 | - [Documentation] Відкрити браузер, створити об’єкт api wrapper, тощо | ||
| 45 | - ... ${ARGUMENTS[0]} == username | ||
| 46 | - Open Browser | ||
| 47 | - ... ${USERS.users['${ARGUMENTS[0]}'].homepage} | ||
| 48 | - ... ${USERS.users['${ARGUMENTS[0]}'].browser} | ||
| 49 | - ... alias=${ARGUMENTS[0]} | ||
| 50 | - Set Window Size @{USERS.users['${ARGUMENTS[0]}'].size} | ||
| 51 | - Set Window Position @{USERS.users['${ARGUMENTS[0]}'].position} | ||
| 52 | - Run Keyword If '${username}' != 'Newtend_Viewer' Login | ||
| 53 | - | ||
| 54 | -Login | ||
| 55 | - Wait Until Page Contains Element id=indexpage_login 20 | ||
| 56 | - Click Element id=indexpage_login | ||
| 57 | - Wait Until Page Contains Element id=password 20 | ||
| 58 | - Input text id=login-email ${USERS.users['${username}'].login} | ||
| 59 | - Input text id=password ${USERS.users['${username}'].password} | ||
| 60 | - Click Element id=submit-login-button | ||
| 61 | - Wait Until Page Contains Element xpath =//a[@class="close-modal-dialog"] 20 | ||
| 62 | - Go to ${USERS.users['${ARGUMENTS[0]}'].homepage} | ||
| 63 | -# Wait Until Page Contains Element xpath=//div[@class="introjs-overlay"] 20 | ||
| 64 | - | ||
| 65 | -Створити тендер | ||
| 66 | - [Arguments] @{ARGUMENTS} | ||
| 67 | - [Documentation] | ||
| 68 | - ... ${ARGUMENTS[0]} == username | ||
| 69 | - ... ${ARGUMENTS[1]} == tender_data | ||
| 70 | -## Initialisation | ||
| 71 | - ${prepared_tender_data}= Add_data_for_GUI_FrontEnds ${ARGUMENTS[1]} | ||
| 72 | - ${prepared_tender_data}= Update_data_for_Newtend ${prepared_tender_data} | ||
| 73 | - ${items}= Get From Dictionary ${prepared_tender_data.data} items | ||
| 74 | - ${title}= Get From Dictionary ${prepared_tender_data.data} title | ||
| 75 | - ${description}= Get From Dictionary ${prepared_tender_data.data} description | ||
| 76 | - ${budget}= Get From Dictionary ${prepared_tender_data.data.value} amount | ||
| 77 | - ${step_rate}= Get From Dictionary ${prepared_tender_data.data.minimalStep} amount | ||
| 78 | - ${start_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} startDate | ||
| 79 | - ${end_date}= Get From Dictionary ${prepared_tender_data.data.tenderPeriod} endDate | ||
| 80 | - ${enquiry_start_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} startDate | ||
| 81 | - ${enquiry_end_date}= Get From Dictionary ${prepared_tender_data.data.enquiryPeriod} endDate | ||
| 82 | - | ||
| 83 | - Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ||
| 84 | - Go To ${USERS.users['${username}'].homepage} | ||
| 85 | - Wait Until Page Contains Element xpath=//a[@href="#/create-tender"] 100 | ||
| 86 | - Click Link xpath=//a[@href="#/create-tender"] | ||
| 87 | - Wait Until Page Contains Новый тендер 100 | ||
| 88 | -# Input fields tender | ||
| 89 | - Input text name=tenderName ${title} | ||
| 90 | - Input text ${locator.edit.description} ${description} | ||
| 91 | - Input text id=budget ${budget} | ||
| 92 | - Click Element id=with-nds | ||
| 93 | - Input text id=step ${step_rate} | ||
| 94 | -# Add Item(s) | ||
| 95 | - Додати придмет ${items[0]} 0 | ||
| 96 | - Run Keyword If '${mode}' == 'multi' Додати багато придметів items | ||
| 97 | -# Set tender datatimes | ||
| 98 | - Set datetime start-date-registration ${start_date} | ||
| 99 | - Set datetime end-date-registration ${end_date} | ||
| 100 | - Set datetime end-date-qualification ${enquiry_end_date} | ||
| 101 | - Set datetime start-date-qualification ${enquiry_start_date} | ||
| 102 | -# Save | ||
| 103 | - Click Element ${locator.save} | ||
| 104 | - Wait Until Page Contains Element xpath=//div[@ng-click="goHome()"] 30 | ||
| 105 | - Click Element xpath=//div[@ng-click="goHome()"] | ||
| 106 | -# Get Ids | ||
| 107 | - Wait Until Page Contains Element xpath=//div[@class="title"] 30 | ||
| 108 | - ${tender_UAid}= Get Text xpath=//div[@class="title"] | ||
| 109 | - ${Ids}= Convert To String ${tender_UAid} | ||
| 110 | - Run keyword if '${mode}' == 'multi' Set Multi Ids ${tender_UAid} | ||
| 111 | - [return] ${Ids} | ||
| 112 | - | ||
| 113 | -Set Multi Ids | ||
| 114 | - [Arguments] @{ARGUMENTS} | ||
| 115 | - [Documentation] | ||
| 116 | - ... ${ARGUMENTS[0]} == ${tender_UAid} | ||
| 117 | - ${current_location}= Get Location | ||
| 118 | - ${id}= Get Substring ${current_location} -41 -9 | ||
| 119 | - ${Ids}= Create List ${tender_UAid} ${id} | ||
| 120 | - | ||
| 121 | -Set datetime | ||
| 122 | - [Arguments] @{ARGUMENTS} | ||
| 123 | - [Documentation] | ||
| 124 | - ... ${ARGUMENTS[0]} == control_id | ||
| 125 | - ... ${ARGUMENTS[1]} == date | ||
| 126 | -#Pick Date | ||
| 127 | - Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/../span[@class="calendar-btn"] | ||
| 128 | - Wait Until Page Contains Element xpath=//td[@class="text-center ng-scope"] 30 | ||
| 129 | - ${datapicker_id}= Get Element Attribute xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@class="text-center ng-scope"]@id | ||
| 130 | - ${datapicker_id}= Get Substring ${datapicker_id} 0 -1 | ||
| 131 | - ${date_index}= newtend_date_picker_index ${ARGUMENTS[1]} | ||
| 132 | - ${datapicker_id}= Convert To String ${datapicker_id}${date_index} | ||
| 133 | - Click Element xpath=//input[@id="${ARGUMENTS[0]}"]/..//td[@id="${datapicker_id}"]/button | ||
| 134 | -#Set time | ||
| 135 | - ${hous}= Get Substring ${ARGUMENTS[1]} 11 13 | ||
| 136 | - ${minutes}= Get Substring ${ARGUMENTS[1]} 14 16 | ||
| 137 | - Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="hours"] ${hous} | ||
| 138 | - Input text xpath=//input[@id="${ARGUMENTS[0]}"]/../..//input[@ng-model="minutes"] ${minutes} | ||
| 139 | - | ||
| 140 | -Додати придмет | ||
| 141 | - [Arguments] @{ARGUMENTS} | ||
| 142 | - [Documentation] | ||
| 143 | - ... ${ARGUMENTS[0]} == items_n | ||
| 144 | - ... ${ARGUMENTS[1]} == index | ||
| 145 | -## Get values for item | ||
| 146 | - ${items_description}= Get From Dictionary ${ARGUMENTS[0]} description | ||
| 147 | - ${quantity}= Get From Dictionary ${ARGUMENTS[0]} quantity | ||
| 148 | - ${cpv}= Convert To String Картонки | ||
| 149 | - ${dkpp_desc}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} description | ||
| 150 | - ${dkpp_id}= Get From Dictionary ${ARGUMENTS[0].additionalClassifications[0]} id | ||
| 151 | - ${unit}= Get From Dictionary ${ARGUMENTS[0].unit} name | ||
| 152 | - ${deliverydate_end_date}= Get From Dictionary ${ARGUMENTS[0].deliveryDate} endDate | ||
| 153 | - ${countryName}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} countryName | ||
| 154 | - ${ZIP}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} postalCode | ||
| 155 | - ${region}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} region | ||
| 156 | - ${locality}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} locality | ||
| 157 | - ${streetAddress}= Get From Dictionary ${ARGUMENTS[0].deliveryAddress} streetAddress | ||
| 158 | - | ||
| 159 | - Set datetime end-date-delivery${ARGUMENTS[1]} ${deliverydate_end_date} | ||
| 160 | -# Set CPV | ||
| 161 | - Wait Until Page Contains Element id=classifier1${ARGUMENTS[1]} | ||
| 162 | - Click Element id=classifier1${ARGUMENTS[1]} | ||
| 163 | - Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100 | ||
| 164 | - Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${cpv} | ||
| 165 | - Wait Until Page Contains Element xpath=//span[contains(text(),'${cpv}')] 20 | ||
| 166 | - Click Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] | ||
| 167 | - Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"] | ||
| 168 | -# Set ДКПП | ||
| 169 | - Click Element id=classifier2${ARGUMENTS[1]} | ||
| 170 | - Wait Until Page Contains Element xpath=//input[@class="ng-pristine ng-untouched ng-valid"] 100 | ||
| 171 | - Input text xpath=//input[@class="ng-pristine ng-untouched ng-valid"] ${dkpp_desc} | ||
| 172 | - Wait Until Page Contains Element xpath=//span[contains(text(),'${dkpp_id}')] 100 | ||
| 173 | - Click Element xpath=//span[contains(text(),'${dkpp_id}')]/../..//input[@class="ng-pristine ng-untouched ng-valid"] | ||
| 174 | - Click Element xpath=//button[@class="btn btn-default btn-lg pull-right choose ng-binding"] | ||
| 175 | -# Set Delivery Address | ||
| 176 | - Click Element id=deliveryAddress${ARGUMENTS[1]} | ||
| 177 | - Wait Until Page Contains Element xpath=//input[@ng-model="deliveryAddress.postalCode"] 20 | ||
| 178 | - Input text xpath=//input[@ng-model="deliveryAddress.postalCode"] ${ZIP} | ||
| 179 | - Input text xpath=//input[@ng-model="deliveryAddress.region"] ${region} | ||
| 180 | - Input text xpath=//input[@ng-model="deliveryAddress.locality"] ${locality} | ||
| 181 | - Input text xpath=//input[@ng-model="deliveryAddress.streetAddress"] ${streetAddress} | ||
| 182 | - Click Element xpath=//button[@class="btn btn-lg single-btn ng-binding"] | ||
| 183 | -# Add item main info | ||
| 184 | - Click Element xpath=//a[contains(text(), "единицы измерения")] | ||
| 185 | - Click Element xpath=//a[contains(text(), "единицы измерения")]/..//a[contains(text(), '${unit}')] | ||
| 186 | - Input text id=quantity${ARGUMENTS[1]} ${quantity} | ||
| 187 | - Input text id=itemDescription${ARGUMENTS[1]} ${items_description} | ||
| 188 | - | ||
| 189 | -Додати багато придметів | ||
| 190 | - [Arguments] @{ARGUMENTS} | ||
| 191 | - [Documentation] | ||
| 192 | - ... ${ARGUMENTS[0]} == items | ||
| 193 | - ${Items_length}= Get Length ${items} | ||
| 194 | - : FOR ${INDEX} IN RANGE 1 ${Items_length} | ||
| 195 | - \ Click Element ${locator.edit.add_item} | ||
| 196 | - \ Додати придмет ${items[${INDEX}]} ${INDEX} | ||
| 197 | - | ||
| 198 | -Завантажити документ | ||
| 199 | - [Arguments] @{ARGUMENTS} | ||
| 200 | - [Documentation] | ||
| 201 | - ... ${ARGUMENTS[0]} == username | ||
| 202 | - ... ${ARGUMENTS[1]} == ${TENDER_UAID} | ||
| 203 | - ... ${ARGUMENTS[2]} == ${Complain} | ||
| 204 | - Fail Тест не написаний | ||
| 205 | - | ||
| 206 | -Подати скаргу | ||
| 207 | - [Arguments] @{ARGUMENTS} | ||
| 208 | - [Documentation] | ||
| 209 | - ... ${ARGUMENTS[0]} == username | ||
| 210 | - ... ${ARGUMENTS[1]} == ${TENDER_UAID} | ||
| 211 | - ... ${ARGUMENTS[2]} == ${Complain} | ||
| 212 | - Fail Не реалізований функціонал | ||
| 213 | - | ||
| 214 | -порівняти скаргу | ||
| 215 | - [Arguments] @{ARGUMENTS} | ||
| 216 | - [Documentation] | ||
| 217 | - ... ${ARGUMENTS[0]} == username | ||
| 218 | - ... ${ARGUMENTS[1]} == ${file_path} | ||
| 219 | - ... ${ARGUMENTS[2]} == ${TENDER_UAID} | ||
| 220 | - Fail Не реалізований функціонал | ||
| 221 | - | ||
| 222 | -Пошук тендера по ідентифікатору | ||
| 223 | - [Arguments] @{ARGUMENTS} | ||
| 224 | - [Documentation] | ||
| 225 | - ... ${ARGUMENTS[0]} == username | ||
| 226 | - ... ${ARGUMENTS[1]} == ${TENDER_UAID} | ||
| 227 | - Switch browser ${ARGUMENTS[0]} | ||
| 228 | - Go to ${USERS.users['${ARGUMENTS[0]}'].homepage} | ||
| 229 | -### Індексація на тестовому сервері відключена, як наслідок пошук по UAid не працює, отож застосовую обхід цієї функціональності для розблокування наступних тестів | ||
| 230 | -# Wait Until Page Contains Element xpath=//div[@class="search-field"]/input 20 | ||
| 231 | -# #${ARGUMENTS[1]}= Convert To String UA-2015-06-08-000023 | ||
| 232 | -# Input text xpath=//div[@class="search-field"]/input ${ARGUMENTS[1]} | ||
| 233 | -# : FOR ${INDEX} IN RANGE 1 30 | ||
| 234 | -# \ Log To Console . no_newline=true | ||
| 235 | -# \ sleep 1 | ||
| 236 | -# \ ${count}= Get Matching Xpath Count xpath=//a[@class="row tender-info ng-scope"] | ||
| 237 | -# \ Exit For Loop If '${count}' == '1' | ||
| 238 | - Sleep 2 | ||
| 239 | - Go to ${USERS.users['${ARGUMENTS[0]}'].homepage} | ||
| 240 | - ${ARGUMENTS[1]}= Convert To String Воркераунд для проходженя наступних тестів - пошук не працює. | ||
| 241 | -### | ||
| 242 | - Wait Until Page Contains Element xpath=(//a[@class="row tender-info ng-scope"]) 20 | ||
| 243 | - Sleep 5 | ||
| 244 | - Click Element xpath=(//a[@class="row tender-info ng-scope"]) | ||
| 245 | - Wait Until Page Contains Element xpath=//a[@class="ng-binding ng-scope"]|//span[@class="ng-binding ng-scope"] 30 | ||
| 246 | - | ||
| 247 | -отримати інформацію із тендера | ||
| 248 | - [Arguments] @{ARGUMENTS} | ||
| 249 | - [Documentation] | ||
| 250 | - ... ${ARGUMENTS[0]} == username | ||
| 251 | - ... ${ARGUMENTS[1]} == fieldname | ||
| 252 | - Switch browser ${ARGUMENTS[0]} | ||
| 253 | - Run Keyword And Return Отримати інформацію про ${ARGUMENTS[1]} | ||
| 254 | - | ||
| 255 | -отримати текст із поля і показати на сторінці | ||
| 256 | - [Arguments] ${fieldname} | ||
| 257 | - sleep 1 | ||
| 258 | - ${return_value}= Get Text ${locator.${fieldname}} | ||
| 259 | - [return] ${return_value} | ||
| 260 | - | ||
| 261 | -отримати інформацію про title | ||
| 262 | - ${title}= отримати текст із поля і показати на сторінці title | ||
| 263 | - [return] ${title} | ||
| 264 | - | ||
| 265 | -отримати інформацію про description | ||
| 266 | - ${description}= отримати текст із поля і показати на сторінці description | ||
| 267 | - [return] ${description} | ||
| 268 | - | ||
| 269 | -отримати інформацію про tenderId | ||
| 270 | - ${tenderId}= отримати текст із поля і показати на сторінці tenderId | ||
| 271 | - [return] ${tenderId} | ||
| 272 | - | ||
| 273 | -отримати інформацію про value.amount | ||
| 274 | - ${valueAmount}= отримати текст із поля і показати на сторінці value.amount | ||
| 275 | - ${valueAmount}= Convert To Number ${valueAmount.split(' ')[0]} | ||
| 276 | - [return] ${valueAmount} | ||
| 277 | - | ||
| 278 | -отримати інформацію про minimalStep.amount | ||
| 279 | - ${minimalStepAmount}= отримати текст із поля і показати на сторінці minimalStep.amount | ||
| 280 | - ${minimalStepAmount}= Convert To Number ${minimalStepAmount.split(' ')[0]} | ||
| 281 | - [return] ${minimalStepAmount} | ||
| 282 | - | ||
| 283 | -Внести зміни в тендер | ||
| 284 | - [Arguments] @{ARGUMENTS} | ||
| 285 | - [Documentation] | ||
| 286 | - ... ${ARGUMENTS[0]} == username | ||
| 287 | - ... ${ARGUMENTS[1]} == id | ||
| 288 | - ... ${ARGUMENTS[2]} == fieldname | ||
| 289 | - ... ${ARGUMENTS[3]} == fieldvalue | ||
| 290 | - Switch browser ${ARGUMENTS[0]} | ||
| 291 | - Click button ${locator.edit_tender} | ||
| 292 | - Wait Until Page Contains Element ${locator.edit.${ARGUMENTS[2]}} 20 | ||
| 293 | - Input Text ${locator.edit.${ARGUMENTS[2]}} ${ARGUMENTS[3]} | ||
| 294 | - Click Element ${locator.save} | ||
| 295 | - Wait Until Page Contains Element ${locator.${ARGUMENTS[2]}} 20 | ||
| 296 | - ${result_field}= отримати текст із поля і показати на сторінці ${ARGUMENTS[2]} | ||
| 297 | - Should Be Equal ${result_field} ${ARGUMENTS[3]} | ||
| 298 | - | ||
| 299 | -отримати інформацію про procuringEntity.name | ||
| 300 | - ${procuringEntity_name}= отримати текст із поля і показати на сторінці procuringEntity.name | ||
| 301 | - [return] ${procuringEntity_name} | ||
| 302 | - | ||
| 303 | -отримати інформацію про enquiryPeriod.endDate | ||
| 304 | - ${enquiryPeriodEndDate}= отримати текст із поля і показати на сторінці enquiryPeriod.endDate | ||
| 305 | - [return] ${enquiryPeriodEndDate} | ||
| 306 | - | ||
| 307 | -отримати інформацію про tenderPeriod.startDate | ||
| 308 | - ${tenderPeriodStartDate}= отримати текст із поля і показати на сторінці tenderPeriod.startDate | ||
| 309 | - [return] ${tenderPeriodStartDate} | ||
| 310 | - | ||
| 311 | -отримати інформацію про tenderPeriod.endDate | ||
| 312 | - ${tenderPeriodEndDate}= отримати текст із поля і показати на сторінці tenderPeriod.endDate | ||
| 313 | - [return] ${tenderPeriodEndDate} | ||
| 314 | - | ||
| 315 | -отримати інформацію про enquiryPeriod.startDate | ||
| 316 | - ${enquiryPeriodStartDate}= отримати текст із поля і показати на сторінці enquiryPeriod.StartDate | ||
| 317 | - [return] ${enquiryPeriodStartDate} | ||
| 318 | - | ||
| 319 | -отримати інформацію про items[0].description | ||
| 320 | - ${description}= отримати текст із поля і показати на сторінці items[0].description | ||
| 321 | - [return] ${description} | ||
| 322 | - | ||
| 323 | -отримати інформацію про items[0].deliveryDate.endDate | ||
| 324 | - ${deliveryDate_endDate}= отримати текст із поля і показати на сторінці items[0].deliveryDate.endDate | ||
| 325 | - [return] ${deliveryDate_endDate} | ||
| 326 | - | ||
| 327 | -отримати інформацію про items[0].deliveryLocation.latitude | ||
| 328 | - Fail Не реалізований функціонал | ||
| 329 | - | ||
| 330 | -отримати інформацію про items[0].deliveryLocation.longitude | ||
| 331 | - Fail Не реалізований функціонал | ||
| 332 | - | ||
| 333 | -## Delivery Address | ||
| 334 | -отримати інформацію про items[0].deliveryAddress.countryName | ||
| 335 | - ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 336 | - [return] ${Delivery_Address.split(', ')[1]} | ||
| 337 | - | ||
| 338 | -отримати інформацію про items[0].deliveryAddress.postalCode | ||
| 339 | - ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 340 | - [return] ${Delivery_Address.split(', ')[0]} | ||
| 341 | - | ||
| 342 | -отримати інформацію про items[0].deliveryAddress.region | ||
| 343 | - ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 344 | - [return] ${Delivery_Address.split(', ')[2]} | ||
| 345 | - | ||
| 346 | -отримати інформацію про items[0].deliveryAddress.locality | ||
| 347 | - ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 348 | - [return] ${Delivery_Address.split(', ')[3]} | ||
| 349 | - | ||
| 350 | -отримати інформацію про items[0].deliveryAddress.streetAddress | ||
| 351 | - ${Delivery_Address}= отримати текст із поля і показати на сторінці items[0].deliveryAddress | ||
| 352 | - ${Delivery_Address}= Get Substring ${Delivery_Address}= 0 -2 | ||
| 353 | - [return] ${Delivery_Address.split(', ')[4]} | ||
| 354 | - | ||
| 355 | -##CPV | ||
| 356 | -отримати інформацію про items[0].classification.scheme | ||
| 357 | - ${classificationScheme}= отримати текст із поля і показати на сторінці items[0].classification.scheme.title | ||
| 358 | - [return] ${classificationScheme.split(' ')[1]} | ||
| 359 | - | ||
| 360 | -отримати інформацію про items[0].classification.id | ||
| 361 | - ${classification_id}= отримати текст із поля і показати на сторінці items[0].classification.scheme | ||
| 362 | - [return] ${classification_id.split(' - ')[0]} | ||
| 363 | - | ||
| 364 | -отримати інформацію про items[0].classification.description | ||
| 365 | - ${classification_description}= отримати текст із поля і показати на сторінці items[0].classification.scheme | ||
| 366 | - Run Keyword And Return If '${classification_description}' == '44617100-9 - Картонки' Convert To String Cartons | ||
| 367 | - [return] ${classification_description} | ||
| 368 | - | ||
| 369 | -##ДКПП | ||
| 370 | -отримати інформацію про items[0].additionalClassifications[0].scheme | ||
| 371 | - ${additional_classificationScheme}= отримати текст із поля і показати на сторінці items[0].additional_classification[0].scheme.title | ||
| 372 | - [return] ${additional_classificationScheme.split(' ')[1]} | ||
| 373 | - | ||
| 374 | -отримати інформацію про items[0].additionalClassifications[0].id | ||
| 375 | - ${additional_classification_id}= отримати текст із поля і показати на сторінці items[0].additional_classification[0].scheme | ||
| 376 | - [return] ${additional_classification_id.split(' - ')[0]} | ||
| 377 | - | ||
| 378 | -отримати інформацію про items[0].additionalClassifications[0].description | ||
| 379 | - ${additional_classification_description}= отримати текст із поля і показати на сторінці items[0].additional_classification[0].scheme | ||
| 380 | - ${additional_classification_description}= Convert To Lowercase ${additional_classification_description} | ||
| 381 | - ${additional_classification_description}= Get Substring ${additional_classification_description}= 0 -2 | ||
| 382 | - [return] ${additional_classification_description.split(' - ')[1]} | ||
| 383 | - | ||
| 384 | -##item | ||
| 385 | -отримати інформацію про items[0].unit.name | ||
| 386 | - ${unit_name}= отримати текст із поля і показати на сторінці items[0].unit.name | ||
| 387 | - Run Keyword And Return If '${unit_name}' == 'килограммы' Convert To String кілограм | ||
| 388 | - [return] ${unit_name} | ||
| 389 | - | ||
| 390 | -отримати інформацію про items[0].unit.code | ||
| 391 | - Fail Не реалізований функціонал | ||
| 392 | - ${unit_code}= отримати текст із поля і показати на сторінці items[0].unit.code | ||
| 393 | - [return] ${unit_code} | ||
| 394 | - | ||
| 395 | -отримати інформацію про items[0].quantity | ||
| 396 | - ${quantity}= отримати текст із поля і показати на сторінці items[0].quantity | ||
| 397 | - ${quantity}= Convert To Number ${quantity} | ||
| 398 | - [return] ${quantity} | ||
| 399 | - | ||
| 400 | -додати предмети закупівлі | ||
| 401 | - [Arguments] @{ARGUMENTS} | ||
| 402 | - [Documentation] | ||
| 403 | - ... ${ARGUMENTS[0]} = username | ||
| 404 | - ... ${ARGUMENTS[1]} = ${TENDER_UAID} | ||
| 405 | - ... ${ARGUMENTS[2]} = 3 | ||
| 406 | - ${period_interval}= Get Broker Property By Username ${ARGUMENTS[0]} period_interval | ||
| 407 | - ${ADDITIONAL_DATA}= prepare_test_tender_data ${period_interval} multi | ||
| 408 | - ${items}= Get From Dictionary ${ADDITIONAL_DATA.data} items | ||
| 409 | - Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ||
| 410 | - Wait Until Page Contains Element ${locator.edit_tender} 10 | ||
| 411 | - Click Element ${locator.edit_tender} | ||
| 412 | - Wait Until Page Contains Element ${locator.edit.add_item} 10 | ||
| 413 | - Input text ${locator.edit.description} description | ||
| 414 | - Run keyword if '${TEST NAME}' == 'Можливість додати позицію закупівлі в тендер' додати позицію | ||
| 415 | - Run keyword if '${TEST NAME}' != 'Можливість додати позицію закупівлі в тендер' забрати позицію | ||
| 416 | - Wait Until Page Contains Element ${locator.save} 10 | ||
| 417 | - Click Element ${locator.save} | ||
| 418 | - Wait Until Page Contains Element ${locator.description} 20 | ||
| 419 | - | ||
| 420 | -додати позицію | ||
| 421 | -### Не видно контролів додати пропозицію в хромі, потрібно скролити, скрол не працює. Обхід: додати лише 1 пропозицію + редагувати description для скролу. | ||
| 422 | - Click Element ${locator.edit.add_item} | ||
| 423 | - Додати придмет ${items[1]} 1 | ||
| 424 | - | ||
| 425 | -забрати позицію | ||
| 426 | - Click Element xpath=//a[@title="Добавить лот"]/preceding-sibling::a | ||
| 427 | - | ||
| 428 | -Задати питання | ||
| 429 | - [Arguments] @{ARGUMENTS} | ||
| 430 | - [Documentation] | ||
| 431 | - ... ${ARGUMENTS[0]} = username | ||
| 432 | - ... ${ARGUMENTS[1]} = ${TENDER_UAID} | ||
| 433 | - ... ${ARGUMENTS[2]} = question_data | ||
| 434 | - ${title}= Get From Dictionary ${ARGUMENTS[2].data} title | ||
| 435 | - ${description}= Get From Dictionary ${ARGUMENTS[2].data} description | ||
| 436 | - Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ||
| 437 | - newtend.Пошук тендера по ідентифікатору ${ARGUMENTS[0]} ${ARGUMENTS[1]} | ||
| 438 | - Click Element xpath=//a[contains(text(), "Уточнения")] | ||
| 439 | - Wait Until Page Contains Element xpath=//button[@class="btn btn-lg btn-default question-btn ng-binding ng-scope"] 20 | ||
| 440 | - Click Element xpath=//button[@class="btn btn-lg btn-default question-btn ng-binding ng-scope"] | ||
| 441 | - Wait Until Page Contains Element xpath=//input[@ng-model="title"] 10 | ||
| 442 | - Input text xpath=//input[@ng-model="title"] ${title} | ||
| 443 | - Input text xpath=//textarea[@ng-model="message"] ${description} | ||
| 444 | - Click Element xpath=//div[@ng-click="sendQuestion()"] | ||
| 445 | - Wait Until Page Contains ${description} 20 | ||
| 446 | - | ||
| 447 | -обновити сторінку з тендером | ||
| 448 | - [Arguments] @{ARGUMENTS} | ||
| 449 | - [Documentation] | ||
| 450 | - ... ${ARGUMENTS[0]} = username | ||
| 451 | - ... ${ARGUMENTS[1]} = ${TENDER_UAID} | ||
| 452 | - Selenium2Library.Switch Browser ${ARGUMENTS[0]} | ||
| 453 | - Reload Page | ||
| 454 | - Wait Until Page Contains ${ARGUMENTS[1]} 20 | ||
| 455 | - | ||
| 456 | -отримати інформацію про QUESTIONS[0].title | ||
| 457 | - Wait Until Page Contains Element xpath=//span[contains(text(), "Уточнения")] 20 | ||
| 458 | - Click Element xpath=//span[contains(text(), "Уточнения")] | ||
| 459 | - Wait Until Page Contains Вы не можете задавать вопросы 20 | ||
| 460 | - ${resp}= отримати текст із поля і показати на сторінці QUESTIONS[0].title | ||
| 461 | - [return] ${resp} | ||
| 462 | - | ||
| 463 | -отримати інформацію про QUESTIONS[0].description | ||
| 464 | - ${resp}= отримати текст із поля і показати на сторінці QUESTIONS[0].description | ||
| 465 | - [return] ${resp} | ||
| 466 | - | ||
| 467 | -отримати інформацію про QUESTIONS[0].date | ||
| 468 | - ${resp}= отримати текст із поля і показати на сторінці QUESTIONS[0].date | ||
| 469 | - ${resp}= Change_day_to_month ${resp} | ||
| 470 | - [return] ${resp} | ||
| 471 | - | ||
| 472 | -Change_day_to_month | ||
| 473 | - [Arguments] @{ARGUMENTS} | ||
| 474 | - [Documentation] | ||
| 475 | - ... ${ARGUMENTS[0]} == date | ||
| 476 | - ${day}= Get Substring ${ARGUMENTS[0]} 0 2 | ||
| 477 | - ${month}= Get Substring ${ARGUMENTS[0]} 3 6 | ||
| 478 | - ${rest}= Get Substring ${ARGUMENTS[0]} 5 | ||
| 479 | - ${return_value}= Convert To String ${month}${day}${rest} | ||
| 480 | - [return] ${return_value} |
| 1 | -from datetime import datetime | ||
| 2 | -from iso8601 import parse_date | ||
| 3 | -from op_robot_tests.tests_files.service_keywords import get_now | ||
| 4 | -from calendar import monthrange | ||
| 5 | - | ||
| 6 | - | ||
| 7 | -def newtend_date_picker_index(isodate): | ||
| 8 | - now = get_now() | ||
| 9 | - date_str = '01' + str(now.month) + str(now.year) | ||
| 10 | - first_day_of_month = datetime.strptime(date_str, "%d%m%Y") | ||
| 11 | - mod = first_day_of_month.isoweekday() - 2 | ||
| 12 | - iso_dt = parse_date(isodate) | ||
| 13 | - # last_day_of_month = monthrange(now.year, now.month)[1] | ||
| 14 | - # LOGGER.log_message(Message("last_day_of_month: {}".format(last_day_of_month), "INFO")) | ||
| 15 | - if now.day > iso_dt.day: | ||
| 16 | - mod = monthrange(now.year, now.month)[1] + mod | ||
| 17 | - return mod + iso_dt.day | ||
| 18 | - | ||
| 19 | - | ||
| 20 | -def update_data_for_newtend(tender_data): | ||
| 21 | - tender_data.data.procuringEntity['name'] = u"openprocurement" | ||
| 22 | - return tender_data |
Please
register
or
login
to post a comment