functest.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import axios from '@/utils/axios';
  2. import { FUNCTEST_PREFIX } from './prefix';
  3. export const getTestCases = (projectId: number) => axios.get(`${FUNCTEST_PREFIX}?projectId=${projectId}`);
  4. export const createTestCase = (projectId: number, title: string, taskId: number) => axios.post(
  5. `${FUNCTEST_PREFIX}?projectId=${projectId}&title=${title}&taskId=${taskId}`,
  6. );
  7. export const deleteTestCase = (testCaseId: number) => axios.delete(`${FUNCTEST_PREFIX}?testCaseId=${testCaseId}`);
  8. export const updateTestCase = (testCaseId: number, title: string) => axios.put(
  9. `${FUNCTEST_PREFIX}?testCaseId=${testCaseId}&title=${title}`,
  10. );
  11. export const finishTestCase = (testCaseId: number) => axios.put(`${FUNCTEST_PREFIX}/finish?testCaseId=${testCaseId}`);
  12. export const reopenTestCase = (testCaseId: number) => axios.put(`${FUNCTEST_PREFIX}/reopen?testCaseId=${testCaseId}`);
  13. export const getTestCaseSteps = (testCaseId: number) => axios.get(`${FUNCTEST_PREFIX}/steps?testCaseId=${testCaseId}`);
  14. export const createTestCaseStep = (testCaseId: number) => axios.post(`${FUNCTEST_PREFIX}/steps?testCaseId=${testCaseId}`);
  15. export const updateTestCaseStep = (testStepId: number, description: string, expectation: string) => axios.put(
  16. `${FUNCTEST_PREFIX}/steps?testStepId=${testStepId}&description=${description}&expectation=${expectation}`,
  17. );
  18. export const updateTestCaseStepState = (testStepId: number, state: string) => axios.put(
  19. `${FUNCTEST_PREFIX}/steps/state?testStepId=${testStepId}&state=${state}`,
  20. );
  21. export const deleteTestCaseStep = (testStepId: number) => axios.delete(`${FUNCTEST_PREFIX}/steps?testStepId=${testStepId}`);
  22. export const getLatestRecord = (projectId: number) => axios.get(`${FUNCTEST_PREFIX}/record/latest?projectId=${projectId}`);
  23. export const getTreeIdList = (projectId: number) => axios.get(`${FUNCTEST_PREFIX}/taskList?projectId=${projectId}`);