Implemented test run editor's test case selection
This commit is contained in:
@@ -97,7 +97,7 @@ async function updateRun(updateTestRun: RunType) {
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Error updating project:", error);
|
||||
console.error("Error updating run:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -118,9 +118,53 @@ async function deleteRun(runId: number) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error deleting project:", error);
|
||||
console.error("Error deleting run:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export { fetchRun, fetchRuns, createRun, updateRun, deleteRun };
|
||||
async function createRunCase(runId: string, caseId: number) {
|
||||
const fetchOptions = {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
};
|
||||
|
||||
const url = `${apiServer}/runcases?runId=${runId}&caseId=${caseId}`;
|
||||
|
||||
try {
|
||||
const response = await fetch(url, fetchOptions);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Error creating new runcase:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteRunCase(runId: string, caseId: number) {
|
||||
const fetchOptions = {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
};
|
||||
|
||||
const url = `${apiServer}/runcases?runId=${runId}&caseId=${caseId}`;
|
||||
|
||||
try {
|
||||
const response = await fetch(url, fetchOptions);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error deleting runcase:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export { fetchRun, fetchRuns, createRun, updateRun, deleteRun, createRunCase, deleteRunCase };
|
||||
|
||||
Reference in New Issue
Block a user