2020-05-06 10:08:06 +08:00
|
|
|
|
*** Settings ***
|
|
|
|
|
|
Resource ../../../02-Keyword/tsg_bfapi/LogStatistics.robot
|
2020-06-18 13:46:16 +08:00
|
|
|
|
Resource ../../../03-Variable/BifangApiVariable.txt
|
2020-05-06 10:08:06 +08:00
|
|
|
|
Library DateTime
|
|
|
|
|
|
|
|
|
|
|
|
*** Test Cases ***
|
|
|
|
|
|
Statistics-Country-00001
|
|
|
|
|
|
#apiName,请求大数据时,用于区分每个接口的sql
|
|
|
|
|
|
${apiName} set variable country
|
2020-06-18 13:46:16 +08:00
|
|
|
|
#请求地址 例如:/${version}/report/domain/recommend
|
|
|
|
|
|
${url} set variable /${version}/report/country/sourceipnum
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#开始时间格式Y-M-D h:i:s
|
2020-05-26 19:54:19 +08:00
|
|
|
|
${startTime} set variable 2020-05-10 15:56:05
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
2020-05-26 19:54:19 +08:00
|
|
|
|
${endTime} set variable 2020-05-25 15:56:35
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#limit int型
|
|
|
|
|
|
${limit} set variable 50
|
|
|
|
|
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}
|
|
|
|
|
|
|
|
|
|
|
|
Statistics-Country-00002
|
|
|
|
|
|
#最近一小时
|
|
|
|
|
|
#apiName,请求大数据时,用于区分每个接口的sql
|
|
|
|
|
|
${apiName} set variable country
|
2020-06-18 13:46:16 +08:00
|
|
|
|
#请求地址 例如:/${version}/report/domain/recommend
|
|
|
|
|
|
${url} set variable /${version}/report/country/sourceipnum
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#开始时间
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${Time} get current date
|
|
|
|
|
|
${endTime}= add time to date ${Time} -00:05:00
|
|
|
|
|
|
#开始时间格式Y-M-D h:i:s
|
|
|
|
|
|
${startTime}= add time to date ${endTime}= -01:00:00
|
|
|
|
|
|
#limit int型
|
|
|
|
|
|
${limit} set variable 50
|
|
|
|
|
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}
|
|
|
|
|
|
|
|
|
|
|
|
Statistics-Country-00003
|
|
|
|
|
|
#最近一天
|
|
|
|
|
|
#apiName,请求大数据时,用于区分每个接口的sql
|
|
|
|
|
|
${apiName} set variable country
|
2020-06-18 13:46:16 +08:00
|
|
|
|
#请求地址 例如:/${version}/report/domain/recommend
|
|
|
|
|
|
${url} set variable /${version}/report/country/sourceipnum
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#开始时间
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${Time} get current date
|
|
|
|
|
|
${endTime}= add time to date ${Time} -00:05:00
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${startTime}= add time to date ${endTime}= -1 days
|
|
|
|
|
|
log ${endTime}
|
|
|
|
|
|
log ${startTime}
|
|
|
|
|
|
#limit int型
|
|
|
|
|
|
${limit} set variable 50
|
|
|
|
|
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}
|
|
|
|
|
|
|
|
|
|
|
|
Statistics-Country-00004
|
|
|
|
|
|
#最近一周
|
|
|
|
|
|
#apiName,请求大数据时,用于区分每个接口的sql
|
|
|
|
|
|
${apiName} set variable country
|
2020-06-18 13:46:16 +08:00
|
|
|
|
#请求地址 例如:/${version}/report/domain/recommend
|
|
|
|
|
|
${url} set variable /${version}/report/country/sourceipnum
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#开始时间
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${Time} get current date
|
|
|
|
|
|
${endTime}= add time to date ${Time} -00:05:00
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${startTime}= add time to date ${endTime}= -7 days
|
|
|
|
|
|
log ${endTime}
|
|
|
|
|
|
log ${startTime}
|
|
|
|
|
|
#limit int型
|
|
|
|
|
|
${limit} set variable 50
|
|
|
|
|
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}
|
|
|
|
|
|
|
|
|
|
|
|
Statistics-Country-00005
|
|
|
|
|
|
#最近一个月(30天)
|
|
|
|
|
|
#apiName,请求大数据时,用于区分每个接口的sql
|
|
|
|
|
|
${apiName} set variable country
|
2020-06-18 13:46:16 +08:00
|
|
|
|
#请求地址 例如:/${version}/report/domain/recommend
|
|
|
|
|
|
${url} set variable /${version}/report/country/sourceipnum
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#开始时间
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${Time} get current date
|
|
|
|
|
|
${endTime}= add time to date ${Time} -00:05:00
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${startTime}= add time to date ${endTime}= -30 days
|
|
|
|
|
|
log ${endTime}
|
|
|
|
|
|
log ${startTime}
|
|
|
|
|
|
#limit int型
|
|
|
|
|
|
${limit} set variable 50
|
|
|
|
|
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}
|
|
|
|
|
|
|
|
|
|
|
|
Statistics-Country-00006
|
|
|
|
|
|
#最近一年(365天)
|
|
|
|
|
|
#apiName,请求大数据时,用于区分每个接口的sql
|
|
|
|
|
|
${apiName} set variable country
|
2020-06-18 13:46:16 +08:00
|
|
|
|
#请求地址 例如:/${version}/report/domain/recommend
|
|
|
|
|
|
${url} set variable /${version}/report/country/sourceipnum
|
2020-05-06 10:08:06 +08:00
|
|
|
|
#开始时间
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${Time} get current date
|
|
|
|
|
|
${endTime}= add time to date ${Time} -00:05:00
|
|
|
|
|
|
#结束时间格式Y-M-D h:i:s
|
|
|
|
|
|
${startTime}= add time to date ${endTime}= -365 days
|
|
|
|
|
|
log ${endTime}
|
|
|
|
|
|
log ${startTime}
|
|
|
|
|
|
#limit int型
|
|
|
|
|
|
${limit} set variable 50
|
|
|
|
|
|
GetApi ${apiName} ${url} startTime=${startTime} endTime=${endTime} limit=${limit}
|