fix(功能用例): 修改功能用例部分bug

This commit is contained in:
xinxin.wu 2024-04-22 12:35:34 +08:00 committed by 刘瑞斌
parent cdbe4af91b
commit 1688ae8d99
11 changed files with 88 additions and 31 deletions

View File

@ -86,7 +86,7 @@
</div> </div>
<MsButton v-else @click="handleNameClick(item)"> <MsButton v-else @click="handleNameClick(item)">
<a-tooltip :content="item.resourceName" :mouse-enter-delay="300"> <a-tooltip :content="item.resourceName" :mouse-enter-delay="300">
<div class="one-line-text"> <div class="one-line-text max-w-[300px]">
{{ item.resourceName }} {{ item.resourceName }}
</div> </div>
</a-tooltip> </a-tooltip>
@ -112,13 +112,15 @@
</a-tooltip> </a-tooltip>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<div class="text-[var(--color-text-2)]">{{ item.content.split(':')[0] }}</div> <div class="one-line-text max-w-[300px] text-[var(--color-text-2)]"
>{{ item.content.split(':')[0] }}</div
>
<div v-if="item.operation.includes('DELETE')" class="text-[var(--color-text-1)]"> <div v-if="item.operation.includes('DELETE')" class="text-[var(--color-text-1)]">
{{ item.resourceName }} {{ item.resourceName }}
</div> </div>
<MsButton v-else @click="handleNameClick(item)"> <MsButton v-else @click="handleNameClick(item)">
<a-tooltip :content="item.resourceName" :mouse-enter-delay="300"> <a-tooltip :content="item.resourceName" :mouse-enter-delay="300">
<div class="one-line-text"> <div class="one-line-text max-w-[300px]">
{{ item.resourceName }} {{ item.resourceName }}
</div> </div>
</a-tooltip> </a-tooltip>

View File

@ -97,13 +97,15 @@
</div> </div>
<!-- 平铺 --> <!-- 平铺 -->
<a-spin v-if="props.mode === 'tiled'" class="w-full" :loading="loading"> <a-spin v-if="props.mode === 'tiled'" class="w-full" :loading="loading">
<TiledDisplay <Suspense>
:menu-list="responseCompositionTabList" <TiledDisplay
:request-result="activeStepDetailCopy?.content" :menu-list="responseCompositionTabList"
:console="props.console" :request-result="activeStepDetailCopy?.content"
:is-definition="props.isDefinition" :console="props.console"
:report-id="props.reportId" :is-definition="props.isDefinition"
/> :report-id="props.reportId"
/>
</Suspense>
</a-spin> </a-spin>
<!-- 响应内容tab --> <!-- 响应内容tab -->
<div v-else class="h-[calc(100%-8px)]"> <div v-else class="h-[calc(100%-8px)]">

View File

@ -73,7 +73,11 @@
<template #content> <template #content>
<div class="arco-table-filters-content"> <div class="arco-table-filters-content">
<div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]"> <div class="ml-[6px] flex items-center justify-start px-[6px] py-[2px]">
<a-checkbox-group v-model:model-value="triggerModeListFilters" direction="vertical" size="small"> <a-checkbox-group
v-model:model-value="triggerModeListFiltersMaps[showType]"
direction="vertical"
size="small"
>
<a-checkbox v-for="(key, value) of TriggerModeLabel" :key="key" :value="value"> <a-checkbox v-for="(key, value) of TriggerModeLabel" :key="key" :value="value">
<div class="font-medium">{{ t(key) }}</div> <div class="font-medium">{{ t(key) }}</div>
</a-checkbox> </a-checkbox>
@ -347,6 +351,15 @@
INDEPENDENT: independentListFilters.value, INDEPENDENT: independentListFilters.value,
INTEGRATED: integratedListFilters.value, INTEGRATED: integratedListFilters.value,
}); });
const allTriggerModeFilters = ref<string[]>([]);
const independentTriggerModeFilters = ref<string[]>([]);
const integratedTriggerModeFilters = ref<string[]>([]);
const triggerModeListFiltersMaps = ref<Record<string, string[]>>({
All: allTriggerModeFilters.value,
INDEPENDENT: independentTriggerModeFilters.value,
INTEGRATED: integratedTriggerModeFilters.value,
});
// //
const allIntegratedFilters = ref<string[]>([]); const allIntegratedFilters = ref<string[]>([]);
const independentIntegratedFilters = ref<string[]>([]); const independentIntegratedFilters = ref<string[]>([]);
@ -392,7 +405,7 @@
filter: { filter: {
status: statusListFiltersMap.value[showType.value], status: statusListFiltersMap.value[showType.value],
integrated: integratedFilters.value, integrated: integratedFilters.value,
triggerMode: triggerModeListFilters.value, triggerMode: triggerModeListFiltersMaps.value[showType.value],
}, },
}); });
loadList(); loadList();
@ -560,7 +573,7 @@
function showDetail() { function showDetail() {
if ((route.query.reportId || route.query.id) && route.query.type) { if ((route.query.reportId || route.query.id) && route.query.type) {
activeDetailId.value = route.query.reportId as string; activeDetailId.value = (route.query.reportId as string) || (route.query.id as string);
activeReportIndex.value = 0; activeReportIndex.value = 0;
if (route.query.type === 'API_SCENARIO') { if (route.query.type === 'API_SCENARIO') {
showDetailDrawer.value = true; showDetailDrawer.value = true;

View File

@ -165,17 +165,19 @@
</div> </div>
<!-- 折叠展开内容 --> <!-- 折叠展开内容 -->
<div v-if="showResContent(step)" class="foldContent mt-4 pl-2"> <div v-if="showResContent(step)" class="foldContent mt-4 pl-2">
<StepDetailContent <Suspense>
:mode="props.activeType" <StepDetailContent
:step-item="step" :mode="props.activeType"
:console="props.console" :step-item="step"
:is-definition="true" :console="props.console"
:environment-name="props.environmentName" :is-definition="true"
:show-type="props.showType" :environment-name="props.environmentName"
:is-response-model="true" :show-type="props.showType"
:report-id="props?.reportId" :is-response-model="true"
:steps="steps" :report-id="props?.reportId"
/> :steps="steps"
/>
</Suspense>
</div> </div>
</div> </div>
</template> </template>

View File

@ -88,6 +88,19 @@
v-model:assertion-config="scenario.scenarioConfig.assertionConfig" v-model:assertion-config="scenario.scenarioConfig.assertionConfig"
@change="scenario.unSaved = true" @change="scenario.unSaved = true"
/> />
<template #title>
<div class="flex items-center">
<div> {{ t('apiScenario.assertion') }}</div>
<a-badge
v-if="scenario.scenarioConfig.assertionConfig.assertions.length"
class="-mb-[2px] ml-2"
:class="activeKey === ScenarioDetailComposition.ASSERTION ? 'active-badge' : ''"
:max-count="99"
:text="assertCount"
>
</a-badge>
</div>
</template>
</a-tab-pane> </a-tab-pane>
<a-tab-pane <a-tab-pane
:key="ScenarioDetailComposition.EXECUTE_HISTORY" :key="ScenarioDetailComposition.EXECUTE_HISTORY"
@ -221,6 +234,12 @@
} }
} }
const assertCount = computed(() => {
return scenario.value.scenarioConfig.assertionConfig.assertions.length > 99
? '99+'
: `${scenario.value.scenarioConfig.assertionConfig.assertions.length}` || '';
});
const activeKey = ref<ScenarioDetailComposition>(ScenarioDetailComposition.STEP); const activeKey = ref<ScenarioDetailComposition>(ScenarioDetailComposition.STEP);
// tabisChangePreform // tabisChangePreform
@ -354,4 +373,10 @@
.ms-scroll-bar(); .ms-scroll-bar();
} }
} }
:deep(.active-badge) {
.arco-badge-text,
.arco-badge-number {
background-color: rgb(var(--primary-5));
}
}
</style> </style>

View File

@ -202,7 +202,7 @@
const associatedIds = ref<string[]>([]); const associatedIds = ref<string[]>([]);
const currentSelectCase = ref<keyof typeof CaseLinkEnum>('FUNCTIONAL'); const currentSelectCase = ref<keyof typeof CaseLinkEnum>('API');
const modulesTreeParams = ref<TableQueryParams>({}); const modulesTreeParams = ref<TableQueryParams>({});
@ -236,8 +236,12 @@
const caseTypeOptions = ref<{ label: string; value: string }[]>([ const caseTypeOptions = ref<{ label: string; value: string }[]>([
{ {
label: 'menu.caseManagement.featureCase', value: 'API',
value: 'FUNCTIONAL', label: t('caseManagement.featureCase.apiCase'),
},
{
value: 'SCENARIO',
label: t('caseManagement.featureCase.sceneCase'),
}, },
]); ]);

View File

@ -357,7 +357,7 @@
}; };
} }
return { return {
height: 'calc(100vh - 294px)', height: 'calc(100vh - 280px)',
threshold: 200, threshold: 200,
fixedSize: true, fixedSize: true,
buffer: 15, buffer: 15,

View File

@ -36,7 +36,7 @@
:data="caseTree" :data="caseTree"
:keyword="groupKeyword" :keyword="groupKeyword"
:expand-all="isExpandAll" :expand-all="isExpandAll"
:empty-text="t('caseManagement.featureCase.caseEmptyRecycle')" :empty-text="t('common.noData')"
draggable draggable
:virtual-list-props="virtualListProps" :virtual-list-props="virtualListProps"
block-node block-node

View File

@ -21,7 +21,11 @@
:key="item[props.valueKey || 'value']" :key="item[props.valueKey || 'value']"
:value="item[props.valueKey || 'value']" :value="item[props.valueKey || 'value']"
> >
<a-tooltip :content="item[props.labelKey || 'text']" :mouse-enter-delay="300"> <a-tooltip
:content="item[props.labelKey || 'text']"
:mouse-enter-delay="300"
:disabled="!item[props.labelKey || 'text']"
>
<div class="one-line-text"> <div class="one-line-text">
<slot name="item" :item="item" :index="index"></slot> <slot name="item" :item="item" :index="index"></slot>
</div> </div>

View File

@ -79,7 +79,7 @@
</div> </div>
<div class="flex-1"> <div class="flex-1">
<a-divider class="!my-0 !mb-0" /> <a-divider class="!my-0 !mb-0" />
<div class="case mt-2"> <div class="case">
<div <div
class="flex items-center px-[20px]" class="flex items-center px-[20px]"
:class="getActiveClass('recycle')" :class="getActiveClass('recycle')"

View File

@ -95,6 +95,7 @@
v-model:status-filters="triggerModeFiltersMap[props.moduleType]" v-model:status-filters="triggerModeFiltersMap[props.moduleType]"
:title="(columnConfig.title as string)" :title="(columnConfig.title as string)"
:list="triggerModeList" :list="triggerModeList"
label-key="label"
@search="initData()" @search="initData()"
> >
<template #item="{ item }"> <template #item="{ item }">
@ -333,6 +334,10 @@
dataIndex: 'triggerMode', dataIndex: 'triggerMode',
slotName: 'triggerMode', slotName: 'triggerMode',
titleSlotName: 'triggerModeFilter', titleSlotName: 'triggerModeFilter',
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
showInTable: true, showInTable: true,
width: 150, width: 150,
showDrag: true, showDrag: true,