|
|
|
@ -9,7 +9,10 @@ import {
|
|
|
|
deleteTestCase,
|
|
|
|
deleteTestCase,
|
|
|
|
exportTemplate,
|
|
|
|
exportTemplate,
|
|
|
|
exportTestCases,
|
|
|
|
exportTestCases,
|
|
|
|
importTestCases, startTestCase, sendTestCase
|
|
|
|
importTestCases,
|
|
|
|
|
|
|
|
startTestCase,
|
|
|
|
|
|
|
|
sendTestCase,
|
|
|
|
|
|
|
|
generateTestCase
|
|
|
|
} from '@/api/componentTestCase';
|
|
|
|
} from '@/api/componentTestCase';
|
|
|
|
import TestCaseModal from './testCaseModal';
|
|
|
|
import TestCaseModal from './testCaseModal';
|
|
|
|
import useWebSocket from '@/hooks/useWebSocket';
|
|
|
|
import useWebSocket from '@/hooks/useWebSocket';
|
|
|
|
@ -309,6 +312,17 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId:
|
|
|
|
setEditingTestCase(null);
|
|
|
|
setEditingTestCase(null);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleGenerateTestCases = async () => {
|
|
|
|
|
|
|
|
const res: any = await generateTestCase({ id: design?.baseInfo.id, identifier: instance.identifier });
|
|
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
|
|
Message.success('生成测试用例成功');
|
|
|
|
|
|
|
|
getTestCaseList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
Message.error(res.msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={styles['test-instance']}>
|
|
|
|
<div className={styles['test-instance']}>
|
|
|
|
{/* 隐藏的文件input */}
|
|
|
|
{/* 隐藏的文件input */}
|
|
|
|
@ -334,6 +348,13 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId:
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={styles['tab-center']}>
|
|
|
|
<div className={styles['tab-center']}>
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
|
|
type="outline"
|
|
|
|
|
|
|
|
status="success"
|
|
|
|
|
|
|
|
onClick={handleGenerateTestCases}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
一键生成测试用例
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
type="outline"
|
|
|
|
type="outline"
|
|
|
|
onClick={handleExportTemplate}
|
|
|
|
onClick={handleExportTemplate}
|
|
|
|
@ -346,12 +367,6 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId:
|
|
|
|
>
|
|
|
|
>
|
|
|
|
从模板导入用例
|
|
|
|
从模板导入用例
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
{/*<Button*/}
|
|
|
|
|
|
|
|
{/* type="outline"*/}
|
|
|
|
|
|
|
|
{/* onClick={() => setActiveTab('batch')}*/}
|
|
|
|
|
|
|
|
{/*>*/}
|
|
|
|
|
|
|
|
{/* 一键生成测试用例*/}
|
|
|
|
|
|
|
|
{/*</Button>*/}
|
|
|
|
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
type="outline"
|
|
|
|
type="outline"
|
|
|
|
onClick={handleExportTestCases}
|
|
|
|
onClick={handleExportTestCases}
|
|
|
|
|