fix(接口测试): 修复并行控制器相关问题

--bug=1028021 --user=王孝刚 【接口测试】场景-生成报告-并行控制器下的多了断言步骤
https://www.tapd.cn/55049933/s/1397715
This commit is contained in:
wxg0103 2023-07-26 14:41:39 +08:00 committed by fit2-zhao
parent 7f4c7a1a6b
commit 24a49c9b5a
6 changed files with 36 additions and 32 deletions

View File

@ -663,7 +663,8 @@ public class ApiScenarioReportStructureService {
allUnExecute.set(allUnExecute.longValue() + 1);
}
}
if (step.getValue() == null && StringUtils.equals(step.getType(), "GenericController") && StringUtils.equalsIgnoreCase(step.getTotalStatus(), ApiReportStatus.PENDING.name())) {
if (step.getValue() == null && StringUtils.containsAnyIgnoreCase(step.getType(), "GenericController", "IfController", "LoopController", "TransactionController")
&& StringUtils.equalsIgnoreCase(step.getTotalStatus(), ApiReportStatus.PENDING.name())) {
allUnExecute.set(allUnExecute.longValue() + 1);
}
if (CollectionUtils.isNotEmpty(step.getChildren())) {

View File

@ -244,9 +244,6 @@ export default {
filterNodes(node, status) {
if (status === 'ERROR' || status === 'FAKE_ERROR' || status === 'UN_EXECUTE') {
let data = {...node};
/*if (!data.value && (!data.children || data.children.length === 0)) {
return null;
}*/
if (data.children.length > 0) {
let filteredChildren = [];
for (let i = 0; i < data.children.length; i++) {
@ -268,10 +265,8 @@ export default {
if (data.value && data.value.status === 'PENDING' && data.type !== 'IfController') {
return data;
}
if (data.type === 'IfController' && data.totalStatus === 'PENDING') {
return data;
}
if (data.type === 'GenericController' && data.totalStatus === 'PENDING') {
if ((data.type === 'IfController' || data.type === 'GenericController' || data.type === 'LoopController' || data.type === 'TransactionController')
&& data.totalStatus === 'PENDING') {
return data;
}
} else if (status === 'ERROR') {

View File

@ -28,8 +28,7 @@
v-if="
node.type !== 'ConstantTimer' &&
node.type !== 'Assertion' &&
node.children &&
node.children.length > 0
node.children
" />
</div>
</el-col>

View File

@ -73,9 +73,6 @@ export default {
},
methods: {
filterNode(value, data) {
if (!data.value && (!data.children || data.children.length === 0)) {
return false;
}
if (!value) return true;
if (data.value) {
if (value === 'FAKE_ERROR') {
@ -90,6 +87,11 @@ export default {
return data.totalStatus !== 'FAKE_ERROR' && data.value.error > 0;
}
}
if (!data.value) {
if (value === 'PENDING' && data.totalStatus === 'PENDING') {
return true;
}
}
return false;
},
filter(val) {

View File

@ -518,6 +518,7 @@ export default {
},
close() {
let saveVariables = [];
let isContinue = true;
this.variables.forEach((item) => {
item.hidden = undefined;
if (item.name && item.name != '') {
@ -526,10 +527,14 @@ export default {
}
if (item.type === 'CSV' && item.files.length === 0) {
this.$warning(this.$t('api_test.variable') + item.name + ' ' + this.$t('api_test.automation.csv_warning'));
this.visible = true;
isContinue = false;
return;
}
});
if (!isContinue) {
this.visible = true;
return;
}
this.selectVariable = '';
this.searchType = '';
this.selectType = 'CONSTANT';

View File

@ -194,7 +194,9 @@ export function hisDataProcessing(array, request) {
const rmIndex = request.hashTree.findIndex((d) => d.id === item.id && d.resourceId === item.resourceId);
request.hashTree.splice(rmIndex, 1);
});
if (request.type && request.type === 'GenericController') {
return;
}
request.hashTree.push(assertions);
}