-
Notifications
You must be signed in to change notification settings - Fork 2
Add Test Suite #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development_2.0.0
Are you sure you want to change the base?
Add Test Suite #48
Changes from 4 commits
0335e05
70fa98e
1b74c42
65d98b4
bd3c7c9
7ca6bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,43 @@ const BaseClient: AxiosInstance = axios.create({ | |
| timeout: 1000, | ||
| }); | ||
|
|
||
| export { AuthClient, BaseClient }; | ||
|
|
||
| async function GetPlans(projectId:any){ | ||
| await AuthClient.get(`/test_plan/${projectId}/`) | ||
| .then(response=>{ | ||
| return response.data | ||
| }) | ||
| .catch(error=>{ | ||
| return error | ||
| }) | ||
| } | ||
|
|
||
| async function CreateNewTestSuite(testSuiteDetails: any, project_id:any){ | ||
| await AuthClient.post(`/test_suites/${project_id}/`) | ||
| .then(response=>{ | ||
| }) | ||
| .catch(error=>{ | ||
| return error | ||
| }) | ||
| } | ||
| async function GetTestSuites(project_id:any){ | ||
|
||
| await AuthClient.get(`/test_suites/${project_id}/`) | ||
| .then(response=>{ | ||
| return response.data | ||
| }) | ||
| .catch(error=>{ | ||
| return error | ||
| }) | ||
| } | ||
|
|
||
| async function SearchSuite(project_id:any,key_word:any){ | ||
|
||
| await AuthClient.get(`/test_suites/${project_id}/search/${key_word}/`) | ||
| .then(response=>{ | ||
| return response.data | ||
| }) | ||
| .catch(error=>{ | ||
| return error | ||
| }) | ||
| } | ||
|
|
||
| export default{ AuthClient, BaseClient,GetPlans, CreateNewTestSuite, GetTestSuites,SearchSuite }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| <template> | ||
| <div class="text-center pa-4"> | ||
| <!-- this is just to be replaced later on with the + button on click , it opens the dialog.. --> | ||
| <v-btn @click="dialog = true"> | ||
| Open Dialog | ||
| </v-btn> | ||
|
|
||
| <v-dialog v-model="dialog" max-width="600px"> | ||
| <v-card > | ||
| <v-card-title>New Test Suite</v-card-title> | ||
| <v-divider></v-divider> | ||
| <br> | ||
| <v-card-subtitle> | ||
| <div> | ||
| <strong>Title</strong> | ||
| <v-text-field v-model="details.title" placeholder="Enter title "></v-text-field> | ||
| </div> | ||
| <div> | ||
| <strong>Test Plan</strong> | ||
| <v-select v-model="details.test_plan" :items="plans" label="Select Plan"></v-select> | ||
| </div> | ||
| </v-card-subtitle> | ||
| <v-divider></v-divider> | ||
| <v-card-actions> | ||
| <v-btn color="info" @click="dialog = false">Close</v-btn> | ||
| <v-btn color="success" @click="createTestSuite">Create</v-btn> | ||
| </v-card-actions> | ||
| </v-card> | ||
| </v-dialog> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import axios from '@/api/axios'; | ||
| import { onMounted } from 'vue'; | ||
|
|
||
|
|
||
| export default{ | ||
| setup(){ | ||
| let dialog=ref(false); | ||
| const details = ref({ | ||
| title: '', | ||
| test_plan: null, | ||
| }); | ||
|
|
||
| const plans = ref([]); | ||
|
|
||
| //from where to get the project id??? | ||
| const fetchPlans = async () => { | ||
| try { | ||
| plans.value = await axios.GetPlans(projectId); | ||
| } catch (error) { | ||
| console.error(error); | ||
| } | ||
| }; | ||
|
|
||
| const createTestSuite=async()=>{ | ||
|
||
| try{ | ||
| await axios.CreateNewTestSuite(details,projectId); | ||
| } catch(error){ | ||
| console.error(error); | ||
| } | ||
| } | ||
|
|
||
| onMounted(() => { | ||
| fetchPlans(); | ||
| }); | ||
|
|
||
| return { | ||
| dialog, | ||
| details, | ||
| plans, | ||
| createTestSuite, | ||
| fetchPlans, | ||
| }; | ||
| } | ||
| } | ||
| </script> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle it with try and catch when you call it