提交 日志接口关键字

This commit is contained in:
lyf
2021-03-25 09:37:02 +08:00
parent 7eeceed5c7
commit e987c67721
4 changed files with 488 additions and 300 deletions

View File

@@ -1,50 +1,52 @@
*** Settings ***
Library Collections
Library RequestsLibrary
Resource ../../03-Variable/BifangApiVariable.txt
*** Keywords ***
Post-Request
[Arguments] ${url} ${data}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port} headers=${header}
${remoteResponse} Post Request api ${url} data=${data} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
Get-Request
[Arguments] ${url}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port} headers=${header}
${remoteResponse} Get Request api ${url} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
Delete-Request
[Arguments] ${url} ${data}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port} headers=${header}
${remoteResponse} Delete Request api ${url} data=${data} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
UpFilePostRequest
[Arguments] ${url} ${data} ${files} ${fileDesc}
${header} Set To Dictionary ${fileDesc} Authorization=${token}
Create Session api http://${host}:${port} 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} 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}
*** Settings ***
Library Collections
Library json
Library RequestsLibrary
Resource ../../03-Variable/BifangApiVariable.txt
*** Keywords ***
Post-Request
[Arguments] ${url} ${data}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port} headers=${header}
#${data1} json.dumps ${data}
${remoteResponse} Post Request api ${url} data=${data} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
Get-Request
[Arguments] ${url}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port} headers=${header}
${remoteResponse} Get Request api ${url} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
Delete-Request
[Arguments] ${url} ${data}
${header} Create Dictionary Content-Type=application/json Authorization=${token}
Create Session api http://${host}:${port} headers=${header}
${remoteResponse} Delete Request api ${url} data=${data} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200
[Return] ${response}
UpFilePostRequest
[Arguments] ${url} ${data} ${files} ${fileDesc}
${header} Set To Dictionary ${fileDesc} Authorization=${token}
Create Session api http://${host}:${port} 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} 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}