[go: nahoru, domu]

Skip to content

Commit

Permalink
覆盖率:新增触发、获取、显示报告;登录:支持 UI 编辑自定义登录接口信息,点击账号 tab 不显示接口信息;随机与顺序测试:解决切换前后…
Browse files Browse the repository at this point in the history
… Response JSON 导致隐藏父项列表按钮
  • Loading branch information
TommyLemon committed Jan 17, 2024
1 parent f8d8f2a commit 4cd7bd4
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 142 deletions.
2 changes: 1 addition & 1 deletion apijson/CodeUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var CodeUtil = {
*/
parseComment: function (reqStr, tableList, method, database, language, isReq, standardObj, isExtract, isWarning, isAPIJSONRouter) { //怎么都获取不到真正的长度,cols不行,默认20不变,maxLineLength不行,默认undefined不变 , maxLineLength) {
if (StringUtil.isEmpty(reqStr)) {
return;
return '';
}

var reqObj = JSON5.parse(reqStr);
Expand Down
2 changes: 1 addition & 1 deletion apijson/JSONResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ var JSONResponse = {
if (real != null && real.throw != null) {
return {
code: JSONResponse.COMPARE_CODE_CHANGE, //未上传对比标准
msg: '没有校验标准,且 throw 不是 null,而是 ' + real.throw,
msg: '没有校验标准,且 throw ' + real.throw,
path: folder == null ? '' : folder
};
}
Expand Down
3 changes: 3 additions & 0 deletions apijson/StringUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ var StringUtil = {
isCountKey: function (key) {
return StringUtil.isKeyOfCategory(key, 'Count');
},
isPageKey: function (key) {
return StringUtil.isKeyOfCategory(key, 'Page');
},
isTotalKey: function (key) {
return StringUtil.isKeyOfCategory(key, 'Total');
},
Expand Down
52 changes: 25 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@

<a style="color: black; font-weight: bold; margin-right: 0px; padding-right: 0px" class="hint--top save-tool" data-hint="切换显示本地|远程" href="javascript:void(0)" @click="onClickPathRoot()">测试用例:{{ isLocalShow ? '本地历史' : '远程在线' }}</a>
<div v-show="! isLocalShow" v-for="(item, index) in casePaths" style="display: inline-block; padding-left: 0px; margin-left: 0px;" >
<a style="color: gray; padding: 0px; margin: 0px">/</a><a style="color: black; outline: none; border: none; padding: 0px; margin: 0px" href="javascript:void(0)" @click="onClickPath(index, item)">{{ StringUtil.isEmpty(item.groupName) ? (StringUtil.isEmpty(item.groupUrl) ? '-' : item.groupUrl.substring(((casePaths[index-1] || {}).groupUrl || '').length + 1)) : item.groupName }}</a>
<a style="color: gray; padding: 0px; margin: 0px">/</a><a style="color: black; outline: none; border: none; padding: 0px; margin: 0px" href="javascript:void(0)" @click="onClickPath(index, item)">{{ getCaseGroupShowName(index, item) }}</a>
</div>
<a style="color: black; font-weight: bold; padding-left: 0px" class="hint--top save-tool" data-hint="切换显示分组|用例" href="javascript:void(0)" @click="switchCaseShowType()">{{ '(' + (isCaseGroupShow() && ! isLocalShow ? (caseGroups == null ? 0 : caseGroups.length) : '') + (caseShowType == 0 && isCaseGroupShow() && ! isLocalShow ? '|' : '') + (caseShowType == 2 && isCaseGroupShow() ? '' : (testCases == null ? 0 : testCases.length)) + ')' }}</a>
<a style="color: black; font-weight: bold; padding-left: 0px" class="hint--top save-tool" data-hint="切换显示分组|用例" href="javascript:void(0)" @click="switchCaseShowType()">{{ '(' + (isCaseGroupShow() && ! isLocalShow ? (caseGroups == null ? 0 : caseGroups.length) : '') + (caseShowType == 0 && isCaseGroupShow() && ! isLocalShow ? '|' : '') + (caseShowType == 2 && ! isLocalShow && isCaseGroupShow() ? '' : (testCases == null ? 0 : testCases.length)) + ')' }}</a>
<div style="display: inline-flex; flex-grow: 1;"></div>

<a v-show="! isLocalShow" class="hint--top save-tool" data-hint="点击切换" href="javascript:void(0)" @click="enableML(! isMLEnabled)">{{ testProcess }}</a>
Expand All @@ -187,7 +187,7 @@
<li v-for="(item, index) in caseGroups" :id="'docGroup' + index" >
<div style="display: inline-table; width: 100%">
<input v-show="isCaseGroupEditable" style="min-width: 60px; width: 40%; margin-right: 6px" v-model="item.groupName" @keyup="doOnKeyUp(event, 'caseGroup', false, item)" />
<a href="javascript:void(0)" @click="selectCaseGroup(index, item)" :style="{ color: index == currentDocIndex ? 'black' : 'gray' }"> {{(isCaseGroupEditable ? '' : (StringUtil.isEmpty(item.groupName) ? '-' : item.groupName) + ' ') + item.groupUrl}}</a><a style="right: 0px; position: absolute; z-index: 101; width: fit-content; background-color: white">{{' (' + item.count + ') '}}</a>
<a href="javascript:void(0)" @click="selectCaseGroup(index, item)" :style="{ color: index == currentDocIndex ? 'black' : 'gray' }"> {{(isCaseGroupEditable ? '' : (StringUtil.isEmpty(item.groupName) ? '-' : item.groupName) + ' ') + item.groupUrl}}</a><a style="right: 0px; position: absolute; z-index: 100; width: fit-content; background-color: white">{{' (' + item.count + ') '}}</a>
<!-- <div v-show="isStatisticsEnabled" style="position: absolute; right: 36px; top: 8px; display: inline-flex">-->
<!-- <div v-show="(item.totalCount || 0) > 0" style="background: lightgray; padding: 1px; margin-right: 2px; display: inline-block; position: relative" @click="restoreRemote(index, item, null, true)" >-->
<!-- &lt;!&ndash; 只能写成一行来消除间隙,不能换行、空格 &ndash;&gt;-->
Expand All @@ -207,9 +207,9 @@

<div style="bottom: 0px; padding: 4px 10px 4px 10px; position: absolute; background-color: white; z-index: 102">
<button @click="pageDown('caseGroup')"><</button>
<input id="vCaseGroupPage" v-model="caseGroupPage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'caseGroup', true)" />
<input id="vCaseGroupPage" v-model="caseGroupPage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'caseGroup', true)" placeholder="页码" />
<button @click="pageUp('caseGroup')">></button>
<input id="vCaseGroupCount" v-model="caseGroupCount" style="width: 33px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'caseGroup', true)" />
<input id="vCaseGroupCount" v-model="caseGroupCount" style="width: 33px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'caseGroup', true)" placeholder="条数" />
<input id="vCaseGroupSearch" v-model="caseGroupSearch" style="width: 72px; text-align: center" @keyup="doOnKeyUp(event, 'caseGroup', true)" placeholder="搜索|编辑" />
</div>
</div>
Expand Down Expand Up @@ -243,9 +243,9 @@

<div style="bottom: 0px; padding: 4px 23.9px 4px 10px; position: absolute; background-color: white; z-index: 102">
<button @click="pageDown('testCase')"><</button>
<input id="vTestCasePage" v-model="testCasePage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'testCase', true)" />
<input id="vTestCasePage" v-model="testCasePage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'testCase', true)" placeholder="页码" />
<button @click="pageUp('testCase')">></button>
<input id="vTestCaseCount" v-model="testCaseCount" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'testCase', true)" />
<input id="vTestCaseCount" v-model="testCaseCount" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'testCase', true)" placeholder="条数" />
<input id="vTestCaseSearch" v-model="testCaseSearch" style="min-width: 60px; display: inline-flex; flex-grow: 1; text-align: center" @keyup="doOnKeyUp(event, 'testCase', true)" placeholder="搜索" />
</div>
</div>
Expand Down Expand Up @@ -421,14 +421,13 @@
</li>
</ul>

<div v-show="isRandomSubListShow" style="bottom: 0px; padding: 4px 13px 4px 10px; position: absolute; width: 100%; text-align: right; background-color: white; z-index: 100">
<a >搜索</a>
<input id="vRandomSubSearch" v-model="randomSubSearch" style="min-width: 60px; display: inline-flex; text-align: center" @keyup="doOnKeyUp(event, 'randomSub', true)" />
<button @click="pageDown('randomSub')">上一页</button>
<input id="vRandomSubPage" v-model="randomSubPage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'randomSub', true)" />
<button @click="pageUp('randomSub')">下一页</button>
<div v-show="isRandomSubListShow" style="bottom: 0px; padding: 4px 13px 4px 6px; position: absolute; width: 100%; text-align: right; background-color: white; z-index: 100">
<input id="vRandomSubSearch" v-model="randomSubSearch" style="min-width: 60px; display: inline-flex; text-align: center" @keyup="doOnKeyUp(event, 'randomSub', true)" placeholder="搜索" />
<button @click="pageDown('randomSub')">上页 < </button>
<input id="vRandomSubPage" v-model="randomSubPage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'randomSub', true)" placeholder="页码" />
<button @click="pageUp('randomSub')"> > 下页</button>
<a >每页</a>
<input id="vRandomSubCount" v-model="randomSubCount" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'randomSub', true)" />
<input id="vRandomSubCount" v-model="randomSubCount" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'randomSub', true)" placeholder="条数" />
<a ></a>
</div>

Expand Down Expand Up @@ -462,14 +461,13 @@
</li>
</ul>

<div v-show="isRandomListShow" style="bottom: 0px; padding: 4px 13px 4px 10px; position: absolute; width: 100%; text-align: right; background-color: white; z-index: 100">
<a >搜索</a>
<input id="vRandomSearch" v-model="randomSearch" style="min-width: 60px; display: inline-flex; text-align: center" @keyup="doOnKeyUp(event, 'random', true)" />
<button @click="pageDown('random')">上一页</button>
<input id="vRandomPage" v-model="randomPage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'random', true)" />
<button @click="pageUp('random')">下一页</button>
<div v-show="isRandomListShow" style="bottom: 0px; padding: 4px 13px 4px 6px; position: absolute; width: 100%; text-align: right; background-color: white; z-index: 100">
<input id="vRandomSearch" v-model="randomSearch" style="min-width: 60px; display: inline-flex; text-align: center" @keyup="doOnKeyUp(event, 'random', true)" placeholder="搜索" />
<button @click="pageDown('random')">上页 < </button>
<input id="vRandomPage" v-model="randomPage" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'random', true)" placeholder="页码" />
<button @click="pageUp('random')"> > 下页</button>
<a >每页</a>
<input id="vRandomCount" v-model="randomCount" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'random', true)" />
<input id="vRandomCount" v-model="randomCount" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'random', true)" placeholder="条数" />
<a ></a>
</div>

Expand Down Expand Up @@ -700,15 +698,15 @@

<textarea id="vOutput" v-show="view == 'output'"></textarea>

<div class="right-main" id="vHtml" v-show="view == 'html'"></div>
<div class="right-main" id="vMarkdown" v-show="view == 'markdown'"></div>
<div v-show="view == 'markdown'" style="bottom: -6px; text-align: right; position: absolute; width: 100%; padding: 4px 20px 0px 4px; background-color: white;">
<a >搜索</a>
<input id="vSearch" v-model="search" style="min-width: 60px; display: inline-flex; text-align: center" @keyup="doOnKeyUp(event, 'document', true)" />
<button @click="pageDown('document')">上一页</button>
<input id="vPage" v-model="page" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'document', true)" />
<button @click="pageUp('document')">下一页</button>
<input id="vSearch" v-model="search" style="min-width: 60px; display: inline-flex; text-align: center" @keyup="doOnKeyUp(event, 'document', true)" placeholder="搜索" />
<button @click="pageDown('document')">上页 < </button>
<input id="vPage" v-model="page" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'document', true)" placeholder="页码" />
<button @click="pageUp('document')"> > 下页</button>
<a >每页</a>
<input id="vCount" v-model="count" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'document', true)" />
<input id="vCount" v-model="count" style="width: 30px;text-align: center" type="number" @keyup="doOnKeyUp(event, 'document', true)" placeholder="条数" />
<a ></a>
</div>

Expand Down
Loading

0 comments on commit 4cd7bd4

Please sign in to comment.