修改logo
cd /usr/local/Cellar/allure/2.13.7/libexec/config,在allure.yml配置文件中增加- custom-logo-plugin
plugins: - junit-xml-plugin - xunit-xml-plugin - trx-plugin - behaviors-plugin - packages-plugin - screen-diff-plugin - xctest-plugin - jira-plugin - xray-plugin - custom-logo-plugin
cd /usr/local/Cellar/allure/2.13.7/libexec/plugins/custom-logo-plugin/static
vi styles.css
.side-nav__brand { background: url('logo.png') no-repeat left center !important; margin-left: 15px; height: 55px; background-size: contain !important; } .side-nav__brand-text { display: none; }
保存,运行测试脚本,查看报告
2. 修改内容标题
在生成的index.html中增加js代码
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <script> jQuery.fn.wait = function (selector, func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } function showTime(){ var myDate = new Date; var year = myDate.getFullYear(); //获取当前年 var mon = myDate.getMonth() + 1; //获取当前月 var date = myDate.getDate(); //获取当前日 var h = myDate.getHours();//获取当前小时数(0-23) var m = myDate.getMinutes();//获取当前分钟数(0-59) var s = myDate.getSeconds();//获取当前秒 var time = year + '/' + mon + '/' + date + ' ' + h + ':' + m + ':' + s console.log(time) $('#content > div > div.app__content > div > div:nth-child(1) > div:nth-child(1) > div.widget__body > div > div > div:nth-child(1) > h2').html('自动化测试 ' + time); } $('#content > div > div.app__content > div > div:nth-child(1) > div:nth-child(1) > div.widget__body > div > div > div:nth-child(1) > h2').wait('#content > div > div.app__content > div > div:nth-child(1) > div:nth-child(1) > div.widget__body > div > div > div:nth-child(1) > h2', function(){showTime();}) </script>