@@ -3,7 +3,6 @@ import { Test } from '../../src/app/shared/models/test';
3
3
import { Step , StepToTest } from '../../src/app/shared/models/steps' ;
4
4
import { TestRun } from '../../src/app/shared/models/testRun' ;
5
5
import { Milestone } from '../../src/app/shared/models/milestone' ;
6
- import { sendPost , sendGet , sendDelete } from '../utils/aqualityTrackingAPI.util' ;
7
6
import { TestResult } from '../../src/app/shared/models/test-result' ;
8
7
import { BaseAPI } from './base.api' ;
9
8
import { Issue } from '../../src/app/shared/models/issue' ;
@@ -24,74 +23,74 @@ export class EditorAPI extends BaseAPI {
24
23
25
24
public async createSuite ( suite : TestSuite ) : Promise < TestSuite > {
26
25
suite . project_id = this . project . id ;
27
- return sendPost ( Endpoints . suite , undefined , suite , this . token , this . project . id ) ;
26
+ return this . sendPost ( Endpoints . suite , undefined , suite ) ;
28
27
}
29
28
30
29
public async createTest ( test : Test ) : Promise < Test > {
31
30
test . project_id = this . project . id ;
32
- return sendPost ( Endpoints . test , undefined , test , this . token , this . project . id ) ;
31
+ return this . sendPost ( Endpoints . test , undefined , test ) ;
33
32
}
34
33
35
34
public async createStep ( step : Step ) : Promise < Step > {
36
35
step . project_id = this . project . id ;
37
- return sendPost ( Endpoints . steps , undefined , step , this . token , this . project . id ) ;
36
+ return this . sendPost ( Endpoints . steps , undefined , step ) ;
38
37
}
39
38
40
39
public async createTestRun ( testrun : TestRun ) {
41
40
testrun . project_id = this . project . id ;
42
- return sendPost ( Endpoints . testrun , undefined , testrun , this . token , this . project . id ) ;
41
+ return this . sendPost ( Endpoints . testrun , undefined , testrun ) ;
43
42
}
44
43
45
44
public async createMilestone ( milestone : Milestone ) {
46
45
milestone . project_id = this . project . id ;
47
- return sendPost ( Endpoints . milestone , undefined , milestone , this . token , this . project . id ) ;
46
+ return this . sendPost ( Endpoints . milestone , undefined , milestone ) ;
48
47
}
49
48
50
49
public async createResult ( testResult : TestResult ) : Promise < TestResult > {
51
50
testResult . project_id = this . project . id ;
52
- return sendPost ( Endpoints . testresult , undefined , testResult , this . token , this . project . id ) ;
51
+ return this . sendPost ( Endpoints . testresult , undefined , testResult ) ;
53
52
}
54
53
55
54
public async addStepToTest ( stepToTest : StepToTest ) : Promise < Step > {
56
55
stepToTest . project_id = this . project . id ;
57
- return sendPost ( Endpoints . testSteps , undefined , stepToTest , this . token , this . project . id ) ;
56
+ return this . sendPost ( Endpoints . testSteps , undefined , stepToTest ) ;
58
57
}
59
58
60
59
public async addTestToSuite ( testId : number , suiteId : number ) {
61
- return sendPost ( Endpoints . testToSuite , { testId, suiteId, project_id : this . project . id } , { } , this . token , this . project . id ) ;
60
+ return this . sendPost ( Endpoints . testToSuite , { testId, suiteId, project_id : this . project . id } , { } ) ;
62
61
}
63
62
64
63
public async getSuites ( testSuite : TestSuite ) : Promise < TestSuite [ ] > {
65
64
testSuite . project_id = this . project . id ;
66
- return sendGet ( Endpoints . suite , testSuite , this . token , this . project . id ) ;
65
+ return this . sendGet ( Endpoints . suite , testSuite ) ;
67
66
}
68
67
69
68
public async getTests ( test : Test ) : Promise < Test [ ] > {
70
- return sendGet ( Endpoints . test , test , this . token , this . project . id ) ;
69
+ return this . sendGet ( Endpoints . test , test ) ;
71
70
}
72
71
73
72
public async getResults ( testResult : TestResult ) : Promise < TestResult [ ] > {
74
73
testResult . project_id = this . project . id ;
75
- return sendGet ( Endpoints . testresult , testResult , this . token , this . project . id ) ;
74
+ return this . sendGet ( Endpoints . testresult , testResult ) ;
76
75
}
77
76
78
77
public async getTestRuns ( testrun : TestRun ) : Promise < TestRun [ ] > {
79
- return sendGet ( Endpoints . testrun , testrun , this . token , this . project . id ) ;
78
+ return this . sendGet ( Endpoints . testrun , testrun ) ;
80
79
}
81
80
82
81
public async getMilestones ( milestone : Milestone ) : Promise < Milestone [ ] > {
83
82
milestone . project_id = this . project . id ;
84
- return sendGet ( Endpoints . milestone , milestone , this . token , this . project . id ) ;
83
+ return this . sendGet ( Endpoints . milestone , milestone ) ;
85
84
}
86
85
87
86
public async removeTestRun ( testRunId : number ) {
88
- return sendDelete ( Endpoints . testrun , { id : testRunId , project_id : this . project . id } , null , this . token , this . project . id ) ;
87
+ return this . sendDelete ( Endpoints . testrun , { id : testRunId , project_id : this . project . id } , null ) ;
89
88
}
90
89
91
90
public async createIssue ( issue : Issue ) : Promise < Issue > {
92
91
issue . project_id = this . project . id ;
93
92
issue . creator_id = 1 ;
94
- return sendPost ( Endpoints . issue , undefined , issue , this . token , this . project . id ) ;
93
+ return this . sendPost ( Endpoints . issue , undefined , issue ) ;
95
94
}
96
95
97
96
public async addSuiteToMilestone ( milestoneName : string , suiteName : string ) {
0 commit comments