提交log用例示例和log关键字(Python文件)

This commit is contained in:
lyf
2021-03-26 10:50:43 +08:00
parent e987c67721
commit bf2def3ecd
3 changed files with 212 additions and 61 deletions

View File

@@ -0,0 +1,56 @@
*** Settings ***
Resource ../../../03-Variable/BifangApiVariable.txt
Library ../../../04-CustomLibrary/Custometest/Schema.py
Library DateTime
Library json
Library OperatingSystem
Library Selenium2Library
Library RequestsLibrary
Library Collections
Library String
*** Variables ***
${url} /${version}/report/url/recommend
*** Test Cases ***
LogApiVerifyCase-001
[Documentation] 验证api接口
${logurl} Set Variable http://${host}:${port}/v1/log/list
${logtype} Set Variable security_event_log
${schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logtype}
${EndTime} get current date
${EndTime1} Get Substring ${EndTime} \ -4
${StartTime} add time to date ${EndTime} -01:00:00
${StartTime1} Get Substring ${StartTime} \ -4
logapiverify ${logurl} ${schemaurl} ${token} ${StartTime1} ${EndTime1} ${logtype}
LogApiVerifyCase-002
[Documentation] 验证api接口
${Logurl} Set Variable http://${host}:${port}/v1/log/list
${Logtype} Set Variable security_event_log
${Schemaurl} Set Variable http://${host}:${port}/v1/log/schema?logType=${logtype}
${EndTime} get current date
${EndTime1} Get Substring ${EndTime} \ -4
${StartTime} add time to date ${EndTime} -01:00:00
${StartTime1} Get Substring ${StartTime} \ -4
${filter} Set Variable common_recv_time = 45535
${responsebody} loglistverify ${logurl} ${schemaurl} ${token} ${StartTime1} ${EndTime1} ${logtype} ${filter}
log ${responsebody}