提交优化关键字和report的case

This commit is contained in:
lyf
2020-06-19 10:25:18 +08:00
parent 249ccfaa9c
commit c84f67be11
10 changed files with 909 additions and 934 deletions

View File

@@ -2,62 +2,9 @@
Library Collections
Library RequestsLibrary
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../Common.robot
*** Keywords ***
Post-Request
[Arguments] ${url} ${data}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Post Request api ${url} data=${data} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${response['code']} 200
[Return] ${response}
Get-Request
[Arguments] ${url}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Get Request api ${url} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${response['code']} 200
[Return] ${response}
Delete-Request
[Arguments] ${url} ${data}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Delete Request api ${url} data=${data} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${response['code']} 200
[Return] ${response}
UpFilePostRequest
[Arguments] ${url} ${data} ${files} ${fileDesc}
${header} Set To Dictionary ${fileDesc} Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Post Request api ${url} data=${data} files=${files} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
UpFilePutRequest
[Arguments] ${url} ${data} ${files} ${fileDesc}
${header} Set To Dictionary ${fileDesc} Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Put Request api ${url} params=${data} files=${files} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
Put-Request
[Arguments] ${url} ${data}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
${remoteResponse} Put Request api ${url} data=${data} headers=${header}
${response} to json ${remoteResponse.content}
${rescodeReturn} Set Variable ${response['code']}
log ${rescodeReturn}
Should Be Equal As Strings ${response['code']} 200
TeardownDelete
[Arguments] ${reportId} ${report_url} ${chartId} ${chart_url} ${datasetId} ${dataset_url} ${resultId} ${result_url}
${ids} Create List ${datasetId}
@@ -69,11 +16,11 @@ TeardownDelete
${data3} Create Dictionary jobIds=${ids2}
${data4} Create Dictionary resultIds=${ids3}
Run Keyword If "${reportId}"=="${EMPTY}" log no report to delete
... ELSE Delete-Request ${report_url} ${data3}
... ELSE BaseDeleteRequestOK ${report_url} ${data3}
Run Keyword If "${chartId}"=="${EMPTY}" log no chart to delete
... ELSE Delete-Request ${chart_url} ${data2}
... ELSE BaseDeleteRequestOK ${chart_url} ${data2}
Run Keyword If "${datasetId}"=="${EMPTY}" log no dataset to delete
... ELSE Delete-Request ${dataset_url} ${data1}
... ELSE BaseDeleteRequestOK ${dataset_url} ${data1}
Run Keyword If "${resultId}"=="${EMPTY}" log no dataset to delete
... ELSE Delete-Request ${result_url} ${data4}
... ELSE BaseDeleteRequestOK ${result_url} ${data4}