精准测试系列《四》

前期分享的文章:精准测试系列《三》分享了如何通过测试管理平台进行发布分支,今天分享的内容是在发布完成后我们要触发代码覆盖率的统计的逻辑,分享的大致思路还是从前端页面发起请求,然后后端接收到请求继续处理这样的逻辑来分享的。

Step1:前端页面的按钮

 <button class='btn btn-warning' id='getStatist' align='center' onclick='getStatist($(this))'>统计覆盖率</button>
 
 点击后调用ajax 请求:
 function getStatist(td) {
         var tr=td.parent().parent()
         console.log(tr);
         var tdlist=tr.find("td");
         console.log(tdlist);
         var id=$(tdlist[0]).find('input').val()
        console.log(id);
        if(id.length != 0) {
            var mymessage = confirm("确定现在开始统计吗?")
            if (mymessage == true) {
                $.ajax({
                    url:'/jacoco_statist/'+id,
                    type: 'GET',
                    dataType: 'json',
                    timeout: 1000,
                    cache: false,
                    beforeSend: function () {
                        $("#mainbody").html('<div align="center">统计执行中...</div>');

                    }, //加载执行方法
                    error: function () {
                        alert('数据加载失败!!!');
                    },  //错误执行方法
                    success: function () {
                        var time=3;
                        setInterval(function () {
                            if(time==0){
                                location.href="/jacoco_index/1"
                            }else{
                                $("
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Wu_Candy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值