File tree 3 files changed +34
-23
lines changed
3 files changed +34
-23
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const config: PlaywrightTestConfig = {
31
31
jira: {
32
32
url: ' https://your-jira-url' ,
33
33
type: ' cloud' ,
34
+ apiVersion: ' 1.0' ,
34
35
},
35
36
cloud: {
36
37
client_id: ' ' ,
@@ -61,6 +62,7 @@ const config: PlaywrightTestConfig = {
61
62
jira: {
62
63
url: ' https://your-jira-url' ,
63
64
type: ' server' ,
65
+ apiVersion: ' 1.0' ,
64
66
},
65
67
server: {
66
68
token: ' YOUR_SERVER_TOKEN' ,
@@ -101,6 +103,7 @@ const config: PlaywrightTestConfig = {
101
103
jira: {
102
104
url: ' https://your-jira-url' ,
103
105
type: ' server' ,
106
+ apiVersion: ' 1.0' ,
104
107
},
105
108
cloud: {
106
109
client_id: ' ' ,
@@ -140,6 +143,7 @@ const config: PlaywrightTestConfig = {
140
143
jira: {
141
144
url: ' https://your-jira-url' ,
142
145
type: ' server' ,
146
+ apiVersion: ' 1.0' ,
143
147
},
144
148
cloud: {
145
149
client_id: ' ' ,
@@ -241,6 +245,7 @@ const config: PlaywrightTestConfig = {
241
245
jira: {
242
246
url: ' https://your-jira-url' ,
243
247
type: ' server' ,
248
+ apiVersion: ' 1.0' ,
244
249
},
245
250
server: {
246
251
token: ' YOUR_SERVER_TOKEN' ,
Original file line number Diff line number Diff line change 1
- import { AxiosProxyConfig } from " axios" ;
1
+ import { AxiosProxyConfig } from ' axios' ;
2
2
3
3
export interface XrayOptions {
4
- jira : {
5
- url : string ,
6
- type : string
7
- } ,
8
- cloud ?: {
9
- client_id ?: string ;
10
- client_secret ?: string ;
11
- } ,
12
- server ?: {
13
- token : string
14
- }
15
- projectKey : string ;
16
- testPlan : string ;
17
- testExecution ?: string ;
18
- revision ?: string ;
19
- description ?: string ;
20
- testEnvironments ?: string [ ] ;
21
- version ?: string ;
22
- debug : boolean ;
23
- proxy ?: AxiosProxyConfig ;
24
- }
4
+ jira : {
5
+ url : string ;
6
+ type : string ;
7
+ apiVersion : string ;
8
+ } ;
9
+ cloud ?: {
10
+ client_id ?: string ;
11
+ client_secret ?: string ;
12
+ } ;
13
+ server ?: {
14
+ token : string ;
15
+ } ;
16
+ projectKey : string ;
17
+ testPlan : string ;
18
+ testExecution ?: string ;
19
+ revision ?: string ;
20
+ description ?: string ;
21
+ testEnvironments ?: string [ ] ;
22
+ version ?: string ;
23
+ debug : boolean ;
24
+ proxy ?: AxiosProxyConfig ;
25
+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export class XrayService {
18
18
private readonly password : string ;
19
19
private readonly token : string ;
20
20
private readonly type : string ;
21
+ private readonly apiVersion : string ;
21
22
private readonly requestUrl : string ;
22
23
private readonly options : XrayOptions ;
23
24
private axios : Axios ;
@@ -41,6 +42,10 @@ export class XrayService {
41
42
if ( ! options . jira . type ) throw new Error ( '"jira.type" option is missed. Please, provide it in the config' ) ;
42
43
this . type = options . jira . type ;
43
44
45
+ // Set Jira API apiVersion
46
+ if ( ! options . jira . apiVersion ) throw new Error ( '"jira.apiVersion" option is missed. Please, provide it in the config' ) ;
47
+ this . apiVersion = options . jira . apiVersion ;
48
+
44
49
// Init axios instance
45
50
this . axios = axios ;
46
51
@@ -95,7 +100,7 @@ export class XrayService {
95
100
this . token = options . server ?. token ;
96
101
97
102
// Set Request URL
98
- this . requestUrl = this . xray + 'rest/raven/1.0' ;
103
+ this . requestUrl = this . xray + this . apiVersion !== '1.0' ? `rest/raven/ ${ this . apiVersion } /api` : 'rest/raven/1.0' ;
99
104
100
105
//Create Axios Instance with Auth
101
106
this . axios = axios . create ( {
You can’t perform that action at this time.
0 commit comments