码迷,mamicode.com
首页 > Web开发 > 详细

UI测试后生成测试报告,利用shell脚本上传svn

时间:2018-05-18 16:19:02      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:file   就删除   pre   span   文件名   run   报告   bin   ash   

ui测试后生成测试报告,把报告保存在某一个固定路径

shell脚本把这个报告上传

#!/bin/bash -ile
#svn下载文件
#svn checkout http://svn.xxx.com/svn/xxxx/trunk/UI/report --username xxx --password dsdfsdf;
svn checkout http://svn.xxx.com.cn/svn/xxxx/trunk/UI/report 
cd report
pwd
#是否存在report 文件,如果存在就删除,这样svn上就不会保存很多文件,只保存一个文件
files=$(ls report*.html 2> /dev/null | wc -l)
if [ $files != "0" ] ;then
    #存在文件就删除
    echo "文件存在"
    svn delete report*.html
    svn commit -m "delete report"
else 
    echo "文件不存在"
fi

#获取报告文件存放id
flag=`cat /Users/pub_pawf_autotest/autoconf/flag.txt`
echo $flag
#生成报告文件的路径
reportPath="/Users/pub_pawf_autotest/autoconf/report/report"$flag".html"
#生成的报告文件名
addReportPath=report"$flag".html
echo $reportPath
#如果生成的报告文件存在,就上传svn 判断文件是否存在
if [ -f $reportPath ] ; then 
    echo "报告文件存在"$reportPath
    cp $reportPath .
    svn add $addReportPath
    svn commit -m "add  report"$addFilePath
else
    echo "报告文件不存在"$reportPath
fi

cd .. 
rm -rf report
#重新下载下上传报告的svn文件
svn checkout http://svn.xxx.com/svn/xxx/trunk/UI/report

 

UI测试后生成测试报告,利用shell脚本上传svn

标签:file   就删除   pre   span   文件名   run   报告   bin   ash   

原文地址:https://www.cnblogs.com/testway/p/9056627.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!