|
|
|
|
@ -9,7 +9,7 @@ import {
|
|
|
|
|
deleteTestCase,
|
|
|
|
|
exportTemplate,
|
|
|
|
|
exportTestCases,
|
|
|
|
|
importTestCases, startTestCase
|
|
|
|
|
importTestCases, startTestCase, sendTestCase
|
|
|
|
|
} from '@/api/componentTestCase';
|
|
|
|
|
import TestCaseModal from './testCaseModal';
|
|
|
|
|
import useWebSocket from '@/hooks/useWebSocket';
|
|
|
|
|
@ -126,6 +126,16 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId:
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleSubmitTestCase = async (testCase: any, operationIdent: string) => {
|
|
|
|
|
const res: any = await sendTestCase(testCase);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
Message.success('测试用例发送成功');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
Message.error(res.msg || '测试用例发送失败');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleAddTestCase = (operationIdent: string) => {
|
|
|
|
|
setSelectedOperationIdent(operationIdent);
|
|
|
|
|
setEditingTestCase(null);
|
|
|
|
|
@ -396,7 +406,12 @@ const TestInstance = ({ instance, parentId, onBack }: { instance: any; parentId:
|
|
|
|
|
>
|
|
|
|
|
<span className={styles['item-text']}>{child.testCaseName}</span>
|
|
|
|
|
<div className={styles['item-actions']}>
|
|
|
|
|
<IconSend />
|
|
|
|
|
<IconSend
|
|
|
|
|
onClick={e => {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
isSocketConnected && handleSubmitTestCase(child, item.operationIdent);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<IconEdit
|
|
|
|
|
onClick={(e) => {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|