补充提交
This commit is contained in:
@@ -6,15 +6,16 @@ Library RequestsLibrary
|
||||
|
||||
*** Keywords ***
|
||||
BasePostRequest
|
||||
[Arguments] ${apistr} ${body}
|
||||
[Arguments] ${apistr} ${body}
|
||||
Set Headers {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
&{httpResponse} Post ${apistr} ${body}
|
||||
Output response body
|
||||
&{httpResponse} Post ${apistr} ${body}
|
||||
#Output response body
|
||||
Object response body
|
||||
#Integer $.code 200
|
||||
#Array $.data.policyList
|
||||
${response} Set Variable ${httpResponse.body}
|
||||
[Return] ${response}
|
||||
|
||||
BaseDeleteRequest
|
||||
[Arguments] ${requestUri} ${data}
|
||||
${headers} set variable {"Authorization":"${token}","Content-Type":"application/json"}
|
||||
|
||||
@@ -12,7 +12,7 @@ GetLogCondition
|
||||
Set Headers {"Content-Type":"application/x-www-form-urlencoded","Authorization":"${token}"}
|
||||
&{LogSchemaResponse}= GET /v1/log/schema?logType=${logname}
|
||||
log ${logname}
|
||||
Output Schema response body
|
||||
#Output Schema response body
|
||||
Object response body
|
||||
#Integer $.code 200
|
||||
log ${LogSchemaResponse.body['data']}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
*** Variables ***
|
||||
#ui登陆还是api登陆
|
||||
${loginType} api
|
||||
#执行环境是否Widonws
|
||||
${systemType} Windows
|
||||
#API配置信息
|
||||
${host} 192.168.40.120
|
||||
${port} 8080
|
||||
@@ -13,19 +15,19 @@ ${password} 111111
|
||||
${encodePassword} ${EMPTY}
|
||||
${token} ${EMPTY}
|
||||
#[Documentation] 测试终端IP统一配置
|
||||
${testClentIP} 192.168.50.43
|
||||
${testClentIP} 192.168.50.6
|
||||
#自动化标签
|
||||
${userTagIds} ${EMPTY}
|
||||
${userTagIds} ${EMPTY}
|
||||
#Documentation] 是否添加测试终端IP到策略统一配置,0为不添加测试终端IP,1为添加测试终端IP,默认1
|
||||
${addTestClentIPFlag} 1
|
||||
#执行需要暂停时间
|
||||
#策略下发后到验证需等待时间
|
||||
${policyVerificationSleepSeconds} 20
|
||||
#策略验证后到验证策略日志需等待时间
|
||||
${policyLogVerificationSleepSeconds} 50
|
||||
${path} E:/auto_git/tsg_autotest
|
||||
${curlbatpath} ${path}/05-Other/curl
|
||||
${mailpath} ${path}/05-Other/mail
|
||||
${policyLogVerificationSleepSeconds} 60
|
||||
${path} E:/auto_git/tsg_autotest/05-Other
|
||||
${curlbatpath} ${path}/curl
|
||||
${mailpath} ${path}/mail
|
||||
#全流程分阶段测试参数
|
||||
#[Documentation] 当前测试部分,all为一个终端全网全流程测试,
|
||||
#1为添加策略和对象测试;
|
||||
@@ -38,10 +40,10 @@ ${ipType} ipv4
|
||||
${ipMask} 255.255.255.255
|
||||
${browserType} chrome
|
||||
# Cli自动化测试变量[start]
|
||||
${cliHost} 192.168.40.165
|
||||
${cliUsername} tsgadmin
|
||||
${cliPassword} Cli2019
|
||||
${timeout} 600s
|
||||
${retryInterval} 300s
|
||||
@{ObjectTypes} ip url fqdn keywords subscriberid fqdn_category account http_signature
|
||||
${cliHost} 192.168.40.165
|
||||
${cliUsername} tsgadmin
|
||||
${cliPassword} Cli2019
|
||||
${timeout} 600s
|
||||
${retryInterval} 300s
|
||||
@{ObjectTypes} ip url fqdn keywords subscriberid fqdn_category account http_signature
|
||||
# Cli自动化测试变量[end]
|
||||
|
||||
@@ -1 +1 @@
|
||||
curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' \ http://www.ccb.com/cn/home/indexv3.html \ \ | iconv -f utf-8 -t gbk
|
||||
curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'http://www.baidu.com/' http://www.ccb.com/cn/home/indexv3.html | iconv -f utf-8 -t gbk
|
||||
@@ -1 +1 @@
|
||||
curl --cookie "*_math=czsuv8n9d4p; Hm_lvt_92e8bc890f374994dd570aa15afc99e1=1575187416; Hm_lpvt_92e8bc890f374994dd570aa15afc99e1=1575187416; _uab_collina=157518741578524001717192" --referer 'http://www.baidu.com/' \ http://www.xiaozhu.com //| iconv -f utf-8 -t gbk
|
||||
curl --cookie "*_math=czsuv8n9d4p; Hm_lvt_92e8bc890f374994dd570aa15afc99e1=1575187416; Hm_lpvt_92e8bc890f374994dd570aa15afc99e1=1575187416; _uab_collina=157518741578524001717192" --referer 'http://www.baidu.com/' http://www.xiaozhu.com | iconv -f utf-8 -t gbk
|
||||
@@ -1 +1 @@
|
||||
curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' \ https://www.gamersky.com/news/ \ \ | iconv -f utf-8 -t gbk
|
||||
curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.gamersky.com/news/ | iconv -f utf-8 -t gbk
|
||||
@@ -1 +1 @@
|
||||
curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' \ https://www.twitch.tv/directory \ \ | iconv -f utf-8 -t gbk
|
||||
curl -kv --user-agent "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" --referer 'https://www.baidu.com/' https://www.twitch.tv/directory | iconv -f utf-8 -t gbk
|
||||
24
05-Other/docker.txt
Normal file
24
05-Other/docker.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
1、查看docker镜像
|
||||
docker images
|
||||
2、进入docker镜像
|
||||
docker run -it auto-rf-library:1.0 /bin/bash
|
||||
3、执行自动化项目
|
||||
docker run -it -v /home/autoTest_tsg/:/usr/src/python -w /usr/src/python auto-rf-lib:latest[docker最新镜像] -d /newrepot/ robot tsg_autotest0406[project path]
|
||||
执行添加hosts文件:使用自建服务器作为网页访问:
|
||||
docker run --name autotest.open.node.com --add-host=open.node.com:192.168.100.5 -it -v /home/autoTest_tsg/:/usr/src/python -w /usr/src/python auto-rf-library:1.0 robot -d newreport/ tsg_autotest0406
|
||||
执行不添加hosts文件:
|
||||
docker run -it -v /home/autoTest_tsg/:/usr/src/python -w /usr/src/python auto-rf-library:1.0 robot -d /newrepot/ tsg_autotest0406
|
||||
|
||||
docker start containerid
|
||||
4、单独镜像,根据此目录下id,但是每次执行时不同的镜像id,修复此文件不太实用。修改hosts
|
||||
cd /var/lib/docker/containers/
|
||||
|
||||
5、解决办法:使用cmd命令删除这些文件,我写了一个批处理文件,第一句是切换到临时文件的目录,第二句是循环,将名称未scoped_dir开头的文件夹都删掉
|
||||
|
||||
cd /d C:\Users\A127\AppData\Local\Temp
|
||||
for /f %%i in ('dir /ad /b scoped_dir*') do (rd /s /q %%i)
|
||||
1
|
||||
2
|
||||
然后在robotframework中,使用OperatingSystem中的run命令运行这个批处理文件,如下所示:
|
||||
|
||||
Run Keyword And Ignore Error OperatingSystem.run cleartmp.bat
|
||||
56
05-Other/response_pages_files/404china.html
Normal file
56
05-Other/response_pages_files/404china.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="UTF-8" http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>404-对不起!您访问的页面不存在</title>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.head404{ width:580px; height:234px; margin:50px auto 0 auto; background:url(https://www.daixiaorui.com/Public/images/head404.png) no-repeat; }
|
||||
|
||||
.txtbg404{ width:499px; height:169px; margin:10px auto 0 auto; background:url(https://www.daixiaorui.com/Public/images/txtbg404.png) no-repeat;}
|
||||
|
||||
.txtbg404 .txtbox{ width:390px; position:relative; top:30px; left:60px;color:#eee; font-size:13px;}
|
||||
|
||||
.txtbg404 .txtbox p {margin:5px 0; line-height:18px;}
|
||||
|
||||
.txtbg404 .txtbox .paddingbox { padding-top:15px;}
|
||||
|
||||
.txtbg404 .txtbox p a { color:#eee; text-decoration:none;}
|
||||
|
||||
.txtbg404 .txtbox p a:hover { color:#FC9D1D; text-decoration:underline;}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body bgcolor="#494949">
|
||||
|
||||
<div class="head404"></div>
|
||||
|
||||
<div class="txtbg404">
|
||||
|
||||
<div class="txtbox">
|
||||
|
||||
<p>对不起,您请求的页面不存在、或已被删除、或暂时不可用</p>
|
||||
|
||||
<p class="paddingbox">请点击以下链接继续浏览网页</p>
|
||||
|
||||
<p>》<a style="cursor:pointer" onclick="history.back()">返回上一页面</a></p>
|
||||
|
||||
<p>》<a href="https://www.daixiaorui.com">返回网站首页</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
56
05-Other/response_pages_files/404english.html
Normal file
56
05-Other/response_pages_files/404english.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="UTF-8" http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>404 sorry! The page you visited does not exist</title>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.head404{ width:580px; height:234px; margin:50px auto 0 auto; background:url(https://www.daixiaorui.com/Public/images/head404.png) no-repeat; }
|
||||
|
||||
.txtbg404{ width:499px; height:169px; margin:10px auto 0 auto; background:url(https://www.daixiaorui.com/Public/images/txtbg404.png) no-repeat;}
|
||||
|
||||
.txtbg404 .txtbox{ width:390px; position:relative; top:30px; left:60px;color:#eee; font-size:13px;}
|
||||
|
||||
.txtbg404 .txtbox p {margin:5px 0; line-height:18px;}
|
||||
|
||||
.txtbg404 .txtbox .paddingbox { padding-top:15px;}
|
||||
|
||||
.txtbg404 .txtbox p a { color:#eee; text-decoration:none;}
|
||||
|
||||
.txtbg404 .txtbox p a:hover { color:#FC9D1D; text-decoration:underline;}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body bgcolor="#494949">
|
||||
|
||||
<div class="head404"></div>
|
||||
|
||||
<div class="txtbg404">
|
||||
|
||||
<div class="txtbox">
|
||||
|
||||
<p>Sorry, the page you requested does not exist, has been deleted, or is temporarily unavailable</p>
|
||||
|
||||
<p class="paddingbox">Please click the following link to continue browsing</p>
|
||||
|
||||
<p>》<a style="cursor:pointer" onclick="history.back()">Back to previous page</a></p>
|
||||
|
||||
<p>》<a href="https://www.daixiaorui.com">Back to home page</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
56
05-Other/response_pages_files/404russian.html
Normal file
56
05-Other/response_pages_files/404russian.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="UTF-8" http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title> - 404, простите! страница, к которой вы пришли, не существует </title>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.head404{ width:580px; height:234px; margin:50px auto 0 auto; background:url(https://www.daixiaorui.com/Public/images/head404.png) no-repeat; }
|
||||
|
||||
.txtbg404{ width:499px; height:169px; margin:10px auto 0 auto; background:url(https://www.daixiaorui.com/Public/images/txtbg404.png) no-repeat;}
|
||||
|
||||
.txtbg404 .txtbox{ width:390px; position:relative; top:30px; left:60px;color:#eee; font-size:13px;}
|
||||
|
||||
.txtbg404 .txtbox p {margin:5px 0; line-height:18px;}
|
||||
|
||||
.txtbg404 .txtbox .paddingbox { padding-top:15px;}
|
||||
|
||||
.txtbg404 .txtbox p a { color:#eee; text-decoration:none;}
|
||||
|
||||
.txtbg404 .txtbox p a:hover { color:#FC9D1D; text-decoration:underline;}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body bgcolor="#494949">
|
||||
|
||||
<div class="head404"></div>
|
||||
|
||||
<div class="txtbg404">
|
||||
|
||||
<div class="txtbox">
|
||||
|
||||
<p> Извините, запрошенная страница не существует или была удалена или временно недоступна </p>
|
||||
|
||||
<p class="paddingbox">Продолжайте просматривать страницы</p>
|
||||
|
||||
<p>》<a style="cursor:pointer" onclick="history.back()">вернуться на предыдущую страницу </a></p>
|
||||
|
||||
<p>》<a href="https://www.daixiaorui.com">вернуться на главную страницу сайта </a></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user