Commit 012a64cf3533c14344a69bb4865ef398694c2c42

Authored by Playtenders
1 parent 52aaebe1

getLastCancellationComplaintDataByTenderUaId+getLastAwardComplaintDataByTenderUa…

…Id+getLastQualificationComplaintDataByTenderUaId
@@ -12,6 +12,9 @@ Resource playtender_claim @@ -12,6 +12,9 @@ Resource playtender_claim
12 12
13 open tender page by uaid ${tender_uaid} 13 open tender page by uaid ${tender_uaid}
14 #fix cat 14 #fix cat
  15 +# log many ${SUITE_NAME}
  16 + log many ${TEST_NAME}
  17 +
15 submit form and check result ${bid_form_refresh_btn_locator} ${bid_form_refresh_success_msg} ${tender_created_checker_element_locator} ${true} 18 submit form and check result ${bid_form_refresh_btn_locator} ${bid_form_refresh_success_msg} ${tender_created_checker_element_locator} ${true}
16 click visible element ${claim_page_open_btn_locator} 19 click visible element ${claim_page_open_btn_locator}
17 capture page screenshot 20 capture page screenshot
@@ -58,8 +61,13 @@ Resource playtender_claim @@ -58,8 +61,13 @@ Resource playtender_claim
58 61
59 # Log ${tender_с} 62 # Log ${tender_с}
60 # bof - fix # 63 # bof - fix #
61 - ${complaint}= getLastComplaintDataByTenderUaId ${API_HOST_URL}/api/${API_VERSION} ${tender_uaid}  
62 -# Log ${complaint} 64 + ${complaint} = Run Keyword If "на скасування" in "${TEST_NAME}" getLastCancellationComplaintDataByTenderUaId ${API_HOST_URL}/api/${API_VERSION} ${tender_uaid}
  65 + ... ELSE IF "переможця" in "${TEST_NAME}" getLastAwardComplaintDataByTenderUaId ${API_HOST_URL}/api/${API_VERSION} ${tender_uaid}
  66 + ... ELSE IF "кваліфікацію" in "${TEST_NAME}" or "прекваліфікацію" in "${TEST_NAME}" getLastQualificationComplaintDataByTenderUaId ${API_HOST_URL}/api/${API_VERSION} ${tender_uaid}
  67 + ... ELSE getLastComplaintDataByTenderUaId ${API_HOST_URL}/api/${API_VERSION} ${tender_uaid}
  68 +## ${complaint}= getLastComplaintDataByTenderUaId ${API_HOST_URL}/api/${API_VERSION} ${tender_uaid}
  69 +# Log ${complaint} getLastAwardComplaintDataByTenderUaId
  70 +# getLastCancellationComplaintDataByTenderUaId
63 # ${complaint}= json_load ${complaint} 71 # ${complaint}= json_load ${complaint}
64 # Log ${complaint} 72 # Log ${complaint}
65 ${complaint}= op_robot_tests.tests_files.service_keywords.Munchify ${complaint} 73 ${complaint}= op_robot_tests.tests_files.service_keywords.Munchify ${complaint}
@@ -515,3 +515,60 @@ def getLastComplaintDataByTenderUaId(apiBaseUrl, tenderUaId): @@ -515,3 +515,60 @@ def getLastComplaintDataByTenderUaId(apiBaseUrl, tenderUaId):
515 tenderDataJson = tenderDataResponse['json']['data'][0] 515 tenderDataJson = tenderDataResponse['json']['data'][0]
516 return tenderDataJson 516 return tenderDataJson
517 517
  518 +def getLastAwardComplaintDataByTenderUaId(apiBaseUrl, tenderUaId):
  519 + requestData = {"opt_fields": "tenderID", "descending": "1", "mode": "_all_"}
  520 + updatesResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders", data=requestData)
  521 + if "json" not in updatesResponse:
  522 + print('json key not found')
  523 + return {}
  524 + tenderId = None
  525 + print("lastTenders:")
  526 + print(updatesResponse['json']['data'])
  527 + for item in updatesResponse['json']['data']:
  528 + if tenderUaId == item['tenderID']:
  529 + tenderId = item['id']
  530 + break
  531 + if tenderId is None:
  532 + return {}
  533 + tenderDataResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders/" + tenderId + "/awards" + "/complaints", data={})
  534 + tenderDataJson = tenderDataResponse['json']['data'][0]
  535 + return tenderDataJson
  536 +
  537 +def getLastCancellationComplaintDataByTenderUaId(apiBaseUrl, tenderUaId):
  538 + requestData = {"opt_fields": "tenderID", "descending": "1", "mode": "_all_"}
  539 + updatesResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders", data=requestData)
  540 + if "json" not in updatesResponse:
  541 + print('json key not found')
  542 + return {}
  543 + tenderId = None
  544 + print("lastTenders:")
  545 + print(updatesResponse['json']['data'])
  546 + for item in updatesResponse['json']['data']:
  547 + if tenderUaId == item['tenderID']:
  548 + tenderId = item['id']
  549 + break
  550 + if tenderId is None:
  551 + return {}
  552 + tenderDataResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders/" + tenderId + "/cancellations" + "/complaints", data={})
  553 + tenderDataJson = tenderDataResponse['json']['data'][0]
  554 + return tenderDataJson
  555 +
  556 +def getLastQualificationComplaintDataByTenderUaId(apiBaseUrl, tenderUaId):
  557 + requestData = {"opt_fields": "tenderID", "descending": "1", "mode": "_all_"}
  558 + updatesResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders", data=requestData)
  559 + if "json" not in updatesResponse:
  560 + print('json key not found')
  561 + return {}
  562 + tenderId = None
  563 + print("lastTenders:")
  564 + print(updatesResponse['json']['data'])
  565 + for item in updatesResponse['json']['data']:
  566 + if tenderUaId == item['tenderID']:
  567 + tenderId = item['id']
  568 + break
  569 + if tenderId is None:
  570 + return {}
  571 + tenderDataResponse = doGetRequest(apiBaseUrl.strip("/") + "/tenders/" + tenderId + "/qualifications" + "/complaints", data={})
  572 + tenderDataJson = tenderDataResponse['json']['data'][0]
  573 + return tenderDataJson
  574 +
Please register or login to post a comment