Skip to content

Commit ceb5513

Browse files
committed
自动化回归测试:点击错误由 消除标记 改为 显示前后的结果
1 parent 68c1739 commit ceb5513

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<li v-for="(item, index) in remotes" >
103103
<a href="javascript:void(0)" @click="restore(item)" > {{(item.version > 0 ? 'V' + item.version : 'V*') + ' ' + item.name + ' ' + item.url}}</a>
104104
<div :style="{ background: item.compareColor }" v-show="item.compare != null && item.compare != 0" style="position: absolute;right: 30px;display: inline-block;">
105-
<button v-show="item.compare != null && item.compare > 0" @click="handleTest(false, index, item)" style="position: relative;color: red">{{ item.error }}</button>
105+
<button v-show="item.compare != null && item.compare > 0" @click="handleTest(false, index, item)" style="position: relative;color: red">{{ item.error + (item.showType == 'before' ? '-前' : '-后') }}</button>
106106
<svg class="icon" style="position: relative;margin-left: 10px" @click="downloadTest(index, item)">
107107
<use xlink:href="svg/icon.svg#export-txt"></use>
108108
</svg>

js/main.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,10 +1413,16 @@
14131413
var tests = App.tests || {}
14141414
item.response = tests[item.id]
14151415
}
1416-
item.compare = 0
1417-
Vue.set(App.remotes, index, item);
14181416

1419-
if (right) {
1417+
if (right != true) {
1418+
var isBefore = item.showType != 'before'
1419+
item.showType = isBefore ? 'before' : 'after'
1420+
Vue.set(App.remotes, index, item);
1421+
1422+
App.view = 'code'
1423+
App.jsoncon = isBefore ? item.response : App.tests[item.id]
1424+
}
1425+
else {
14201426
var baseUrl = App.getBaseUrl()
14211427
vUrl.value = baseUrl + '/put'
14221428

0 commit comments

Comments
 (0)