1、添加时间工具关键字

2、调整部分错误
This commit is contained in:
dongxiaoyan
2020-06-18 13:46:16 +08:00
parent a3f9d64293
commit fc79ac3782
16 changed files with 262 additions and 210 deletions

View File

@@ -0,0 +1,15 @@
*** Settings ***
Resource ../../03-Variable/BifangApiVariable.txt
Library DateTime
Library String
#Library Collections
#Library RequestsLibrary
*** Keywords ***
GetLast24HoursStartAndEndTime
[Documentation]
... 获取当前时间往前一天的开始结束时间时间格式为YYY-MM-DD H24:mm:ss
${endtime} Get Time
${starttime}= Add Time To Date ${endtime} -1 days
${starttime} Get Substring ${starttime} 0 19
[Return] ${starttime} ${endtime}

View File

@@ -244,7 +244,7 @@ Recommend
Trend
[Arguments] ${url} ${startTime} ${endTime} ${logType} ${policyId}
${header} Create Dictionary Content-Type=application/x-www-form-urlencoded Authorization=${token}
Create Session api http://${host}:${port}/${version} headers=${header}
Create Session api http://${host}:${port} headers=${header}
${remoteResponse} Get Request api ${url}?policyId=${policyId}&logType=${logType}&startTime=${startTime}&endTime=${endTime} headers=${header}
${response} to json ${remoteResponse.content}
Should Be Equal As Strings ${remoteResponse.status_code} 200

View File

@@ -7,7 +7,7 @@ Resource ../tsg_bfapi/ApiRequest.robot
*** Keywords ***
schema
${responsedata} Get-Request log/schema?logType=active_defence_event_log
${responsedata} Get-Request /v1/log/schema?logType=active_defence_event_log
${responsedata1} Get From Dictionary ${responsedata} data
${responsefields} Get From Dictionary ${responsedata1} fields
[Return] ${responsedata}