Commit aba0d7de51b5285061e0c004f3d3164892ecdde6

Authored by Playtenders
1 parent 0742df90

getAgreementDataByAgreementUaId

... ... @@ -22,6 +22,8 @@ Resource playtender_agree
22 22 set window position @{browser_default_position}
23 23 set site language by code ${broker_language_code}
24 24 login to site ${USERS.users['${broker_username}']}
  25 + Set Global Variable ${need_save_agreement} ${TRUE}
  26 +
25 27
26 28 Підготувати дані для оголошення тендера
27 29 [Arguments] ${username} ${tender_data} ${role_name}
... ... @@ -1261,6 +1263,8 @@ Resource playtender_agree
1261 1263 go to ${broker_baseurl}/agreement/?query%5B%5D=${agreement_uaid}
1262 1264 capture page screenshot
1263 1265 input to search form and wait results ${agreement_search_form_query_input_locator} ${agreement_uaid} ${agreement_search_form_result_locator_tpl}
  1266 + Run Keyword If ${need_save_agreement} Перший пошук угоди ${username} ${agreement_uaid}
  1267 +
1264 1268
1265 1269 Отримати доступ до угоди
1266 1270 [Arguments] ${username} ${agreement_uaid}
... ...
... ... @@ -135,7 +135,23 @@ active agreement contract
135 135 run keyword and ignore error Load Sign
136 136 capture page screenshot
137 137 run keyword if '${mode}' == 'open_framework' close current visible alert
138   - capture page screenshot
  138 + capture pgage screenshot
139 139 submit form and check result ${qualification_form_submit_btn_locator} ${contract_agreement_active_submit_success_msg} ${None}
140 140 capture page screenshot
141 141
  142 +Перший пошук угоди
  143 + [Arguments] ${username} ${agreement_uaid}
  144 +
  145 + Set Variable ${need_save_agreement} ${False}
  146 +
  147 + Log ${username}
  148 + ${data}= getAgreementDataByAgreementUaId ${API_HOST_URL}/api/${API_VERSION} ${agreement_uaid}
  149 + ${data}= op_robot_tests.tests_files.service_keywords.Munchify ${data}
  150 +
  151 + Log ${data}
  152 +
  153 + Set To Dictionary ${USERS.users['${username}']} agreement_data=${data}
  154 + log ${USERS.users['${username}'].agreement_data}
  155 +
  156 +
  157 +
... ...
... ... @@ -608,3 +608,24 @@ def getTenderDataByTenderAgreementContractUaId(apiBaseUrl, tenderUaId):
608 608 tenderDataResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders/" + tenderId + "/agreements/" + tenderDataAgreementId + "/contracts", data={})
609 609 tenderDataJson = tenderDataResponse['json']['data'][0]
610 610 return tenderDataJson
  611 +
  612 +def getAgreementDataByAgreementUaId(apiBaseUrl, tenderUaId):
  613 + requestData = {"opt_fields": "tenderID", "descending": "1", "mode": "_all_"}
  614 + updatesResponse = doGetRequest(apiBaseUrl.strip("/") + "/agreements", data=requestData)
  615 + if "json" not in updatesResponse:
  616 + print('json key not found')
  617 + return {}
  618 + tenderId = None
  619 + print("lastAgreement:")
  620 + print(updatesResponse['json']['data'])
  621 + for item in updatesResponse['json']['data']:
  622 + if tenderUaId == item['tenderID']:
  623 + tenderId = item['id']
  624 + break
  625 + if tenderId is None:
  626 + return {}
  627 + tenderDataResponse = doGetRequest(apiBaseUrl.strip("/") + "/agreements/" + tenderId, data={})
  628 + tenderDataJson = tenderDataResponse['json']
  629 + return tenderDataJson
  630 +
  631 +
... ...
Please register or login to post a comment