123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- *** Settings ***
- Documentation 创建病人
- Library Collections
- Library HttpLibrary.HTTP
- Library RequestsLibrary
- *** Variables ***
- ${uri} /IPatientService
- ${method} CreatePatient
- *** Test Cases ***
- test
- [Tags] inexecution
- ${body} Create Dictionary
- Set To Dictionary ${body} jsonrpc 2.0
- Set To Dictionary ${body} method CreatePatient
- ${params} Create List
- ${param} Create Dictionary
- Set To Dictionary ${param} Token 0126f5d7ef044088b075246c65a410ba
- ${PatientData} Create List
- ${animal} Random Animal
- Append To List ${PatientData} ${animal}
- Set To Dictionary ${param} PatientData ${PatientData}
- ${AssignmentUserCodes} Create List
- Append To List ${AssignmentUserCodes} uc_code01
- Append To List ${AssignmentUserCodes} uc_code02
- Set To Dictionary ${param} AssignmentUserCodes ${AssignmentUserCodes}
- Append To List ${params} ${param}
- Set To Dictionary ${body} params ${params}
- Set To Dictionary ${body} id 1
- Log ${body}
- test2
- [Tags] inexecution
- ${body} Create Dictionary
- Set To Dictionary ${body} jsonrpc 2.0
- Set To Dictionary ${body} method CreatePatient
- ${params} Create List
- ${param} Create Dictionary
- Set To Dictionary ${param} Token 0126f5d7ef044088b075246c65a410ba
- ${PatientData} Create List
- ${animal} Random Patient
- Append To List ${PatientData} ${animal}
- Set To Dictionary ${param} PatientData ${PatientData}
- ${AssignmentUserCodes} Create List
- Append To List ${AssignmentUserCodes} uc_code01
- Append To List ${AssignmentUserCodes} uc_code02
- Set To Dictionary ${param} AssignmentUserCodes ${AssignmentUserCodes}
- Append To List ${params} ${param}
- Set To Dictionary ${body} params ${params}
- Set To Dictionary ${body} id 1
- Log ${body}
- *** Keywords ***
- createPatient_Post
- [Arguments] ${token} ${PatientData} ${assignmentUserCodes}
- ${params} Create List
- ${param} Create Dictionary
- Set To Dictionary ${param} Token ${token}
- ${organizationInfos} Create List
- ${organizationInfo} Create Dictionary
- Set To Dictionary ${organizationInfo} OrganizationName ${organizationName}
- Set To Dictionary ${organizationInfo} ParentCode ${parentCode}
- Set To Dictionary ${organizationInfo} ExtendsData ${extendsData}
- ${patientType11} Convert To Integer ${patientType}
- Set To Dictionary ${organizationInfo} PatientType ${patientType11}
- Append To List ${organizationInfos} ${organizationInfo}
- Set To Dictionary ${param} OrganizationInfos ${organizationInfos}
- Append To List ${params} ${param}
- ${data} common_data ${method} ${params}
- Log ${data}
- Log ---开始断言验证---
- ${response} request_post ${URL} ${uri} ${data}
- Log ${response}
- log ${response.content}
- ${content} Set Variable ${response.content}
- Log ---输出返回内容---:
- Log Json ${content} INFO
- Log ---开始断言验证---
- Should Be True ${response.status_code}==200
- [Return] ${response}
- createPatient_assertClassTrue
- [Arguments] ${token} ${organizationName} ${parentCode} ${extendsData} ${patientType}
- ${content} addOrganizations_Post ${token} ${organizationName} ${parentCode} ${extendsData} ${patientType}
- ${result} Get From Dictionary ${content.json()} result
- Log ${result}
- Should Be True ${result}
- [Return] ${content}
- createPatient_assertException
- [Arguments] ${token} ${organizationName} ${parentCode} ${extendsData} ${patientType} ${error_code} ${error_msg}
- ${content} addOrganizations_Post ${token} ${organizationName} ${parentCode} ${extendsData} ${patientType}
- ${error} Get From Dictionary ${content.json()} error
- ${code} Get From Dictionary ${error} code
- ${message} Get From Dictionary ${error} message
- Should Be Equal As Numbers ${code} ${error_code}
- Should Be String ${message} ${error_msg}
- [Return] ${content}
|