提交孙姜月代码

This commit is contained in:
dongxiaoyan
2020-06-19 11:44:46 +08:00
parent 5833f8f4fe
commit e384020305
3 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
*** Settings ***
Test Teardown TeardownDelete ${url} geoNameIds ${geoNameId}
Force Tags tsg_bf_api dict_create #Suite Teardown Delete All Sessions
Library String
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /${version}/geolocation/dict
${geoNameId} ${EMPTY}
*** Test Cases ***
dictcrease-01
${objectedit} Create Dictionary geoNameId=1001
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${settig_proxy_profiles_geolocation_dictcrease} ${objectedit}
log ${objectDict}
${response} CreateRequest_locationId ${url} ${objectDict}
# 查询
${geoNameId} Get From Dictionary ${response} geoNameId
#log ${geoNameId}
#${locationId} Get From Dictionary ${response} locationId
#log ${locationId}
QueryPolicyFile ${url} geoNameId=${geoNameId}
#QueryPolicyFile ${url} locationId=${locationId}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"locationId":1,"addrType":4,"startIp":"221.178.125.0","endIp":"221.178.125.255","geoNameId":"1001","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"shenzhen","timeZone":"Asia/Shanghai"}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
[Teardown] log to console ${\n}
dictcrease-02
${objectedit} Create Dictionary geoNameId=1001
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${settig_proxy_profiles_geolocation_dictcreases} ${objectedit}
log ${objectDict}
${response} CreateRequest_locationId ${url} ${objectDict}
# 查询
${geoNameId} Get From Dictionary ${response} geoNameId
#log ${geoNameId}
#${locationId} Get From Dictionary ${response} locationId
#log ${locationId}
QueryPolicyFile ${url} geoNameId=${geoNameId}
#QueryPolicyFile ${url} locationId=${locationId}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"locationId":1,"addrType":4,"startIp":"221.178.125.0","endIp":"221.178.125.255","geoNameId":"1001","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"shenzhen","timeZone":"Asia/Shanghai"}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
[Teardown] log to console ${\n}

View File

@@ -0,0 +1,48 @@
*** Settings ***
Force Tags tsg_bf_api dict_ditail_search #Test Teardown TeardownDelete ${url} profileIds ${profileId}
Library String
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /${version}/geolocation/dict/detail
${profileId} ${EMPTY}
*** Test Cases ***
dictdetailsearch-01
#${objectedit} Create Dictionary geoNameId=1001
#Comment 打印需要修改的json内容
#log ${objectedit}
#${objectDict} Jsoneditmanu ${settig_proxy_profiles_geolocation_dictdetail} ${objectedit}
#log ${objectDict}
#${response} CreateRequest ${url} ${objectDict}
# 查询
${geoNameId} Set Variable 1001
${locationId} Set Variable 1
QueryPolicyFile ${url} geoNameId=${geoNameId}&locationId=${locationId}
# 修改
#${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","geoNameId":"1001","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"shenzhen","timeZone":"Asia/Shanghai","locationId":1,"addrType":4,"startIp":"221.178.125.0","endIp":"221.178.125.255","isValid":1,"isInitialize":0,"opUser":1,"opUserName":"admin","opTime":"2020-05-12 12:00:00"},{"continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","geoNameId":"1001","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"shenzhen","timeZone":"Asia/Shanghai","locationId":2,"addrType":4,"startIp":"10.5.23.0","endIp":"10.5.23.255","isValid":1,"isInitialize":0,"opUser":1,"opUserName":"admin","opTime":"2020-05-12 12:00:00"},{"continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","geoNameId":"1002","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"guangzhou","timeZone":"Asia/Shanghai","locationId":3,"addrType":4,"startIp":"12.223.22.0","endIp":"12.223.22.255","isValid":1,"isInitialize":0,"opUser":1,"opUserName":"admin","opTime":"2020-05-12 12:00:00"},{"continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","geoNameId":"1002","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"guangzhou","timeZone":"Asia/Shanghai","locationId":4,"addrType":4,"startIp":"26.38.96.0","endIp":"26.38.96.255","isValid":1,"isInitialize":0,"opUser":1,"opUserName":"admin","opTime":"2020-05-12 12:00:00"}]}}
#UpdatePolicyFile2 ${url} ${reqData_edit}
dictdetailsearch-02
# 查询
${provinceAbbr} Set Variable GD
${provinceFull} Set Variable Guangdong
QueryPolicyFile ${url} provinceAbbr=${provinceAbbr}&provinceFull=${provinceFull}
dictdetailsearch-03
# 查询
${countryFull} Set Variable China
${countryAbbr} Set Variable CN
QueryPolicyFile ${url} countryFull=${countryFull}&countryAbbr=${countryAbbr}
dictdetailsearch-04
# 查询
${continentAbbr} Set Variable AS
${continentFull} Set Variable Asia
QueryPolicyFile ${url} continentAbbr=${continentAbbr}&continentFull=${continentFull}
dictdetailsearch-05
# 查询
${countryFull} Set Variable China
${cityFull} Set Variable guangzhou
QueryPolicyFile ${url} countryFull=${countryFull}&lcityFull=${cityFull}

View File

@@ -0,0 +1,45 @@
*** Settings ***
Force Tags tsg_bf_api dict_search #Test Teardown TeardownDelete ${url} profileIds ${profileId}
Library String
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
*** Variables ***
${url} /${version}/geolocation/dict
${profileId} ${EMPTY}
*** Test Cases ***
dictsearch-01
#新增
#${objectedit} Create Dictionary geoNameId=1001
#Comment 打印需要修改的json内容
#log ${objectedit}
#${objectDict} Jsoneditmanu ${settig_proxy_profiles_geolocation_dictsearch} ${objectedit}
#log ${objectDict}
##${response} CreateRequest ${url} ${objectDict}
#${url} ${objectDict}
# 查询
${geoNameId} Set Variable 1001
${countryFull} Set Variable China
QueryPolicyFile ${url} geoNameId=${geoNameId}&countryFull=${countryFull}
# 修改
#log ${geoNameId}
#${reqHeader_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"continentList":[{"continentFull":"Asia","countryList":[{"countryFull":"China","cityList":[{"geoNameId":"1001","continentFull":"Asia","countryFull":"China","cityFull":"shenzhen"},{"geoNameId":"1002","continentFull":"Asia","countryFull":"China","cityFull":"guangzhou"}]}]}]}]}
dictsearch-02
# 查询
${continentAbbr} Set Variable AS
${continentFull} Set Variable Asia
QueryPolicyFile ${url} continentAbbr=${continentAbbr}&continentFull=${continentFull}
dictsearch-03
# 查询
${provinceAbbr} Set Variable GD
${provinceFull} Set Variable Guangdong
QueryPolicyFile ${url} provinceAbbr=${provinceAbbr}&provinceFull=${provinceFull}
dictsearch-04
# 查询
${countryAbbr} Set Variable China
${countryFull} Set Variable China
QueryPolicyFile ${url} provinceAbbr=${countryAbbr}&provinceFull=${countryFull}