@@ -6,6 +6,7 @@ import { Milestone } from '../../src/app/shared/models/milestone';
6
6
import { sendPost , sendGet , sendDelete } from '../utils/aqualityTrackingAPI.util' ;
7
7
import { TestResult } from '../../src/app/shared/models/test-result' ;
8
8
import { BaseAPI } from './base.api' ;
9
+ import { Issue } from '../../src/app/shared/models/issue' ;
9
10
10
11
enum Endpoints {
11
12
suite = '/suite' ,
@@ -15,7 +16,8 @@ enum Endpoints {
15
16
milestone = '/milestone' ,
16
17
testresult = '/testresult' ,
17
18
testSteps = '/test/steps' ,
18
- testToSuite = '/testToSuite'
19
+ testToSuite = '/testToSuite' ,
20
+ issue = '/issues'
19
21
}
20
22
21
23
export class EditorAPI extends BaseAPI {
@@ -69,6 +71,7 @@ export class EditorAPI extends BaseAPI {
69
71
}
70
72
71
73
public async getResults ( testResult : TestResult ) : Promise < TestResult [ ] > {
74
+ testResult . project_id = this . project . id ;
72
75
return sendGet ( Endpoints . testresult , testResult , this . token , this . project . id ) ;
73
76
}
74
77
@@ -85,6 +88,12 @@ export class EditorAPI extends BaseAPI {
85
88
return sendDelete ( Endpoints . testrun , { id : testRunId , project_id : this . project . id } , null , this . token , this . project . id ) ;
86
89
}
87
90
91
+ public async createIssue ( issue : Issue ) : Promise < Issue > {
92
+ issue . project_id = this . project . id ;
93
+ issue . creator_id = 1 ;
94
+ return sendPost ( Endpoints . issue , undefined , issue , this . token , this . project . id ) ;
95
+ }
96
+
88
97
public async addSuiteToMilestone ( milestoneName : string , suiteName : string ) {
89
98
const milestone : Milestone = ( await this . getMilestones ( { name : milestoneName } ) ) [ 0 ] ;
90
99
const suite : TestSuite = ( await this . getSuites ( { name : suiteName } ) ) [ 0 ] ;
0 commit comments