@eclipse-che/che-e2e 7.50.0-dev-25a3c8c → 7.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/driver/CheReporter.js +3 -2
  2. package/dist/driver/CheReporter.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/inversify.config.js +1 -1
  6. package/dist/inversify.config.js.map +1 -1
  7. package/dist/inversify.types.js +2 -3
  8. package/dist/inversify.types.js.map +1 -1
  9. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +2 -4
  10. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
  11. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js +2 -4
  12. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js.map +1 -1
  13. package/dist/pageobjects/ide/ProjectTree.js +12 -6
  14. package/dist/pageobjects/ide/ProjectTree.js.map +1 -1
  15. package/dist/tests/devfiles/CSlashCPlusPlus.spec.js +3 -4
  16. package/dist/tests/devfiles/CSlashCPlusPlus.spec.js.map +1 -1
  17. package/dist/tests/devfiles/DevfileSmoke.spec.js +4 -5
  18. package/dist/tests/devfiles/DevfileSmoke.spec.js.map +1 -1
  19. package/dist/tests/devfiles/DotNetCore.spec.js +3 -4
  20. package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
  21. package/dist/tests/devfiles/Go.spec.js +3 -4
  22. package/dist/tests/devfiles/Go.spec.js.map +1 -1
  23. package/dist/tests/devfiles/JavaMaven.spec.js +3 -4
  24. package/dist/tests/devfiles/JavaMaven.spec.js.map +1 -1
  25. package/dist/tests/devfiles/JavaSpringBoot.spec.js +3 -4
  26. package/dist/tests/devfiles/JavaSpringBoot.spec.js.map +1 -1
  27. package/dist/tests/devfiles/JavaVertx.spec.js +3 -4
  28. package/dist/tests/devfiles/JavaVertx.spec.js.map +1 -1
  29. package/dist/tests/devfiles/NodeJS.spec.js +3 -4
  30. package/dist/tests/devfiles/NodeJS.spec.js.map +1 -1
  31. package/dist/tests/devfiles/PHPSimple.spec.js +3 -4
  32. package/dist/tests/devfiles/PHPSimple.spec.js.map +1 -1
  33. package/dist/tests/devfiles/Python.spec.js +3 -4
  34. package/dist/tests/devfiles/Python.spec.js.map +1 -1
  35. package/dist/tests/devfiles/PythonDjango.spec.js +3 -4
  36. package/dist/tests/devfiles/PythonDjango.spec.js.map +1 -1
  37. package/dist/tests/devfiles/Quarkus.spec.js +3 -4
  38. package/dist/tests/devfiles/Quarkus.spec.js.map +1 -1
  39. package/dist/tests/devfiles/Scala.spec.js +3 -4
  40. package/dist/tests/devfiles/Scala.spec.js.map +1 -1
  41. package/dist/tests/e2e/FactoryUrl.spec.js +5 -10
  42. package/dist/tests/e2e/FactoryUrl.spec.js.map +1 -1
  43. package/dist/tests/e2e/GitPublishBranch.spec.js +3 -1
  44. package/dist/tests/e2e/GitPublishBranch.spec.js.map +1 -1
  45. package/dist/tests/e2e/GitSelfSignCert.spec.js +8 -1
  46. package/dist/tests/e2e/GitSelfSignCert.spec.js.map +1 -1
  47. package/dist/tests/e2e/GitSsh.spec.js +5 -2
  48. package/dist/tests/e2e/GitSsh.spec.js.map +1 -1
  49. package/dist/tests/e2e/OpenshiftConnector.spec.js +3 -1
  50. package/dist/tests/e2e/OpenshiftConnector.spec.js.map +1 -1
  51. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +3 -7
  52. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
  53. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +3 -7
  54. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
  55. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +3 -7
  56. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
  57. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +2 -0
  58. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -1
  59. package/dist/tests/e2e_happy_path/HappyPath.spec.js +13 -8
  60. package/dist/tests/e2e_happy_path/HappyPath.spec.js.map +1 -1
  61. package/dist/tests/intelij/IntelijOpenWorkspace.spec.js +2 -6
  62. package/dist/tests/intelij/IntelijOpenWorkspace.spec.js.map +1 -1
  63. package/dist/tests/load_test/LoadTest.spec.js +3 -6
  64. package/dist/tests/load_test/LoadTest.spec.js.map +1 -1
  65. package/dist/tests/login/LinkCheAndOcpUsers.spec.js +2 -2
  66. package/dist/tests/login/LinkCheAndOcpUsers.spec.js.map +1 -1
  67. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +4 -9
  68. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -1
  69. package/dist/tests/plugins/InstallPluginUsingUI.spec.js +4 -10
  70. package/dist/tests/plugins/InstallPluginUsingUI.spec.js.map +1 -1
  71. package/dist/tests/plugins/JavaPlugin.spec.js +4 -8
  72. package/dist/tests/plugins/JavaPlugin.spec.js.map +1 -1
  73. package/dist/tests/plugins/PhpPlugin.spec.js +12 -10
  74. package/dist/tests/plugins/PhpPlugin.spec.js.map +1 -1
  75. package/dist/tests/plugins/PythonPlugin.spec.js +4 -8
  76. package/dist/tests/plugins/PythonPlugin.spec.js.map +1 -1
  77. package/dist/tests/plugins/TypescriptPlugin.spec.js +4 -8
  78. package/dist/tests/plugins/TypescriptPlugin.spec.js.map +1 -1
  79. package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js +3 -10
  80. package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js.map +1 -1
  81. package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js +3 -10
  82. package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js.map +1 -1
  83. package/dist/tests/plugins/VscodeValePlugin.spec.js +3 -10
  84. package/dist/tests/plugins/VscodeValePlugin.spec.js.map +1 -1
  85. package/dist/tests/plugins/VscodeXmlPlugin.spec.js +15 -1
  86. package/dist/tests/plugins/VscodeXmlPlugin.spec.js.map +1 -1
  87. package/dist/tests/plugins/VscodeYamlPlugin.spec.js +4 -8
  88. package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +1 -1
  89. package/dist/testsLibrary/CodeExecutionTests.js +14 -2
  90. package/dist/testsLibrary/CodeExecutionTests.js.map +1 -1
  91. package/dist/testsLibrary/WorkspaceHandlingTests.js +75 -10
  92. package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
  93. package/dist/utils/requestHandlers/CheApiRequestHandler.js.map +1 -1
  94. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js +17 -2
  95. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
  96. package/dist/utils/workspace/ApiUrlResolver.js +41 -9
  97. package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
  98. package/dist/utils/workspace/{IApiUrlResolver.js → ITestWorkspaceUtil.js} +1 -1
  99. package/dist/utils/workspace/ITestWorkspaceUtil.js.map +1 -0
  100. package/dist/utils/workspace/TestWorkspaceUtil.js +29 -31
  101. package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
  102. package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
  103. package/driver/CheReporter.ts +4 -4
  104. package/index.ts +1 -1
  105. package/inversify.config.ts +4 -3
  106. package/inversify.types.ts +2 -3
  107. package/package.json +1 -1
  108. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +3 -3
  109. package/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.ts +4 -4
  110. package/pageobjects/ide/ProjectTree.ts +13 -8
  111. package/tests/devfiles/CSlashCPlusPlus.spec.ts +3 -6
  112. package/tests/devfiles/DevfileSmoke.spec.ts +4 -7
  113. package/tests/devfiles/DotNetCore.spec.ts +3 -6
  114. package/tests/devfiles/Go.spec.ts +3 -4
  115. package/tests/devfiles/JavaMaven.spec.ts +3 -6
  116. package/tests/devfiles/JavaSpringBoot.spec.ts +3 -6
  117. package/tests/devfiles/JavaVertx.spec.ts +3 -6
  118. package/tests/devfiles/NodeJS.spec.ts +3 -6
  119. package/tests/devfiles/PHPSimple.spec.ts +3 -6
  120. package/tests/devfiles/Python.spec.ts +3 -6
  121. package/tests/devfiles/PythonDjango.spec.ts +3 -6
  122. package/tests/devfiles/Quarkus.spec.ts +3 -6
  123. package/tests/devfiles/Scala.spec.ts +3 -7
  124. package/tests/e2e/FactoryUrl.spec.ts +7 -11
  125. package/tests/e2e/GitPublishBranch.spec.ts +5 -3
  126. package/tests/e2e/GitSelfSignCert.spec.ts +68 -65
  127. package/tests/e2e/GitSsh.spec.ts +6 -3
  128. package/tests/e2e/OpenshiftConnector.spec.ts +4 -2
  129. package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +2 -5
  130. package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +2 -5
  131. package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +2 -5
  132. package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +2 -0
  133. package/tests/e2e_happy_path/HappyPath.spec.ts +13 -8
  134. package/tests/intelij/IntelijOpenWorkspace.spec.ts +2 -4
  135. package/tests/load_test/LoadTest.spec.ts +4 -4
  136. package/tests/login/LinkCheAndOcpUsers.spec.ts +4 -3
  137. package/tests/plugins/GitHubPullRequestPlugin.spec.ts +4 -7
  138. package/tests/plugins/InstallPluginUsingUI.spec.ts +4 -9
  139. package/tests/plugins/JavaPlugin.spec.ts +4 -6
  140. package/tests/plugins/PhpPlugin.spec.ts +3 -9
  141. package/tests/plugins/PythonPlugin.spec.ts +4 -6
  142. package/tests/plugins/TypescriptPlugin.spec.ts +4 -6
  143. package/tests/plugins/VscodeKubernetesPlugin.spec.ts +3 -9
  144. package/tests/plugins/VscodeShellcheckPlugin.spec.ts +3 -9
  145. package/tests/plugins/VscodeValePlugin.spec.ts +3 -9
  146. package/tests/plugins/VscodeXmlPlugin.spec.ts +17 -1
  147. package/tests/plugins/VscodeYamlPlugin.spec.ts +4 -7
  148. package/testsLibrary/CodeExecutionTests.ts +9 -1
  149. package/testsLibrary/WorkspaceHandlingTests.ts +72 -9
  150. package/utils/requestHandlers/CheApiRequestHandler.ts +1 -1
  151. package/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +17 -2
  152. package/utils/workspace/ApiUrlResolver.ts +34 -11
  153. package/utils/workspace/ITestWorkspaceUtil.ts +98 -0
  154. package/utils/workspace/TestWorkspaceUtil.ts +34 -34
  155. package/utils/workspace/WorkspaceStatus.ts +1 -1
  156. package/dist/utils/workspace/IApiUrlResolver.js.map +0 -1
  157. package/utils/workspace/IApiUrlResolver.ts +0 -15
@@ -8,38 +8,38 @@
8
8
  * SPDX-License-Identifier: EPL-2.0
9
9
  **********************************************************************/
10
10
 
11
+ import 'reflect-metadata';
11
12
  import { che } from '@eclipse-che/api';
12
13
  import { TestConstants } from '../../TestConstants';
13
14
  import { injectable, inject } from 'inversify';
14
15
  import { DriverHelper } from '../DriverHelper';
15
- import { ApiUrlResolver } from './ApiUrlResolver';
16
- import 'reflect-metadata';
17
16
  import { WorkspaceStatus } from './WorkspaceStatus';
18
17
  import { error } from 'selenium-webdriver';
19
18
  import { CheApiRequestHandler } from '../requestHandlers/CheApiRequestHandler';
20
19
  import { CLASSES } from '../../inversify.types';
21
20
  import { Logger } from '../Logger';
22
21
  import axios from 'axios';
22
+ import { ITestWorkspaceUtil } from './ITestWorkspaceUtil';
23
+ import { ApiUrlResolver } from './ApiUrlResolver';
23
24
 
24
25
  @injectable()
25
- export class TestWorkspaceUtil {
26
-
27
- static readonly WORKSPACE_API_URL: string = 'dashboard/api/namespace';
26
+ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
28
27
  readonly attempts: number = TestConstants.TS_SELENIUM_WORKSPACE_STATUS_ATTEMPTS;
29
28
  readonly polling: number = TestConstants.TS_SELENIUM_WORKSPACE_STATUS_POLLING;
29
+
30
30
  constructor(
31
31
  @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
32
32
  @inject(CLASSES.CheApiRequestHandler) private readonly processRequestHandler: CheApiRequestHandler,
33
33
  @inject(CLASSES.ApiUrlResolver) private readonly apiUrlResolver: ApiUrlResolver
34
34
  ) { }
35
35
 
36
- public async waitWorkspaceStatus(namespace: string, workspaceName: string, expectedWorkspaceStatus: WorkspaceStatus) {
36
+ public async waitWorkspaceStatus(workspaceName: string, expectedWorkspaceStatus: WorkspaceStatus) {
37
37
  Logger.debug('TestWorkspaceUtil.waitWorkspaceStatus');
38
38
 
39
39
  let workspaceStatus: string = '';
40
40
  let expectedStatus: boolean = false;
41
41
  for (let i = 0; i < this.attempts; i++) {
42
- const response = await this.processRequestHandler.get(this.apiUrlResolver.getWorkspaceApiUrl(namespace, workspaceName));
42
+ const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName));
43
43
 
44
44
  if (response.status !== 200) {
45
45
  throw new Error(`Can not get status of a workspace. Code: ${response.status} Data: ${response.data}`);
@@ -61,10 +61,10 @@ export class TestWorkspaceUtil {
61
61
  }
62
62
  }
63
63
 
64
- public async stopWorkspaceByName(namespace: string, workspaceName: string) {
64
+ public async stopWorkspaceByName(workspaceName: string) {
65
65
  Logger.debug('TestWorkspaceUtil.stopWorkspaceByName');
66
66
 
67
- const stopWorkspaceApiUrl: string = this.apiUrlResolver.getWorkspaceApiUrl(namespace, workspaceName);
67
+ const stopWorkspaceApiUrl: string = await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName);
68
68
  let stopWorkspaceResponse;
69
69
 
70
70
  try {
@@ -78,14 +78,14 @@ export class TestWorkspaceUtil {
78
78
  throw new Error(`Cannot stop workspace. Code: ${stopWorkspaceResponse.status} Data: ${stopWorkspaceResponse.data}`);
79
79
  }
80
80
 
81
- await this.waitWorkspaceStatus(namespace, workspaceName, WorkspaceStatus.STOPPED);
81
+ await this.waitWorkspaceStatus(workspaceName, WorkspaceStatus.STOPPED);
82
82
  }
83
83
 
84
84
  // delete a worksapce without stopping phase (similar with force deleting)
85
- public async deleteWorkspaceByName(namespace: string, workspaceName: string) {
85
+ public async deleteWorkspaceByName(workspaceName: string) {
86
86
  Logger.debug(`TestWorkspaceUtil.deleteWorkspaceByName ${workspaceName}` );
87
87
 
88
- const deleteWorkspaceApiUrl: string = this.apiUrlResolver.getWorkspaceApiUrl(namespace, workspaceName);
88
+ const deleteWorkspaceApiUrl: string = await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName);
89
89
  let deleteWorkspaceResponse;
90
90
  let deleteWorkspaceStatus: boolean = false;
91
91
  try {
@@ -121,31 +121,31 @@ export class TestWorkspaceUtil {
121
121
  }
122
122
 
123
123
  // stop workspace before deleting with checking stopping phase
124
- public async stopAndDeleteWorkspaceByName(namespace: string, workspaceName: string) {
124
+ public async stopAndDeleteWorkspaceByName(workspaceName: string) {
125
125
  Logger.debug('TestWorkspaceUtil.stopAndDeleteWorkspaceByName');
126
126
 
127
- await this.stopWorkspaceByName(namespace, workspaceName);
128
- await this.deleteWorkspaceByName(namespace, workspaceName);
127
+ await this.stopWorkspaceByName(workspaceName);
128
+ await this.deleteWorkspaceByName(workspaceName);
129
129
  }
130
130
 
131
131
  // stop all run workspaces in the namespace
132
132
  public async stopAllRunningWorkspaces(namespace: string) {
133
133
  Logger.debug('TestWorkspaceUtil.stopAllRunProjects');
134
- let response = await this.processRequestHandler.get(this.apiUrlResolver.getWorkspacesApiUrl(namespace));
134
+ let response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
135
135
  for (let i = 0; i < response.data.items.length; i++) {
136
136
  Logger.info('The project is being stopped: ' + response.data.items[i].metadata.name);
137
- await this.stopWorkspaceByName(namespace, response.data.items[i].metadata.name);
137
+ await this.stopWorkspaceByName(response.data.items[i].metadata.name);
138
138
  }
139
139
  }
140
140
 
141
141
  // stop all run workspaces, check statused and remove the workspaces
142
142
  public async stopAndDeleteAllRunningWorkspaces(namespace: string) {
143
143
  Logger.debug('TestWorkspaceUtil.stopAndDeleteAllRunProjects');
144
- let response = await this.processRequestHandler.get(this.apiUrlResolver.getWorkspacesApiUrl(namespace));
144
+ let response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
145
145
  await this.stopAllRunningWorkspaces(namespace);
146
146
  for (let i = 0; i < response.data.items.length; i++) {
147
147
  Logger.info('The project is being deleted: ' + response.data.items[i].metadata.name);
148
- await this.deleteWorkspaceByName(namespace, response.data.items[i].metadata.name);
148
+ await this.deleteWorkspaceByName(response.data.items[i].metadata.name);
149
149
  }
150
150
  }
151
151
 
@@ -153,11 +153,11 @@ export class TestWorkspaceUtil {
153
153
  // similar with 'force' deleting
154
154
  public async deleteAllWorkspaces(namespace: string) {
155
155
  Logger.debug('TestWorkspaceUtil.deleteAllRunProjects');
156
- let response = await this.processRequestHandler.get(this.apiUrlResolver.getWorkspacesApiUrl(namespace));
156
+ let response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
157
157
 
158
158
  for (let i = 0; i < response.data.items.length; i++) {
159
159
  Logger.info('The project is being deleted .......: ' + response.data.items[i].metadata.name);
160
- await this.deleteWorkspaceByName(namespace, response.data.items[i].metadata.name);
160
+ await this.deleteWorkspaceByName(response.data.items[i].metadata.name);
161
161
  }
162
162
  }
163
163
 
@@ -167,7 +167,7 @@ export class TestWorkspaceUtil {
167
167
  public async waitPluginAdding(namespace: string, workspaceName: string, pluginName: string) {
168
168
  Logger.debug('TestWorkspaceUtil.waitPluginAdding');
169
169
 
170
- const workspaceStatusApiUrl: string = `${TestWorkspaceUtil.WORKSPACE_API_URL}/${namespace}:${workspaceName}`;
170
+ const workspaceStatusApiUrl: string = `${await this.apiUrlResolver.getWorkspacesApiUrl()}/${namespace}:${workspaceName}`;
171
171
  const attempts: number = TestConstants.TS_SELENIUM_PLUGIN_PRECENCE_ATTEMPTS;
172
172
  const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
173
173
 
@@ -200,7 +200,7 @@ export class TestWorkspaceUtil {
200
200
  public async getListOfWorkspaceId(): Promise<string[]> {
201
201
  Logger.debug('TestWorkspaceUtil.getListOfWorkspaceId');
202
202
 
203
- const getAllWorkspacesResponse = await this.processRequestHandler.get(TestWorkspaceUtil.WORKSPACE_API_URL);
203
+ const getAllWorkspacesResponse = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
204
204
 
205
205
  interface IMyObj {
206
206
  id: string;
@@ -224,7 +224,7 @@ export class TestWorkspaceUtil {
224
224
  public async getIdOfRunningWorkspace(wsName: string): Promise<string> {
225
225
  Logger.debug('TestWorkspaceUtil.getIdOfRunningWorkspace');
226
226
 
227
- const getWorkspacesByNameResponse = await this.processRequestHandler.get(`${TestWorkspaceUtil.WORKSPACE_API_URL}/:${wsName}`);
227
+ const getWorkspacesByNameResponse = await this.processRequestHandler.get(`${await this.apiUrlResolver.getWorkspacesApiUrl()}/:${wsName}`);
228
228
  return getWorkspacesByNameResponse.data.id;
229
229
 
230
230
  }
@@ -236,7 +236,7 @@ export class TestWorkspaceUtil {
236
236
  Logger.debug('TestWorkspaceUtil.getIdOfRunningWorkspaces');
237
237
 
238
238
  try {
239
- const getAllWorkspacesResponse = await this.processRequestHandler.get(TestWorkspaceUtil.WORKSPACE_API_URL);
239
+ const getAllWorkspacesResponse = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
240
240
 
241
241
  interface IMyObj {
242
242
  id: string;
@@ -254,7 +254,7 @@ export class TestWorkspaceUtil {
254
254
 
255
255
  return idOfRunningWorkspace;
256
256
  } catch (err) {
257
- console.log(`Getting id of running workspaces failed. URL used: ${TestWorkspaceUtil.WORKSPACE_API_URL}`);
257
+ console.log(`Getting id of running workspaces failed. URL used: ${await this.apiUrlResolver.getWorkspacesApiUrl()}`);
258
258
  throw err;
259
259
  }
260
260
  }
@@ -265,7 +265,7 @@ export class TestWorkspaceUtil {
265
265
  public async removeWorkspaceById(id: string) {
266
266
  Logger.debug('TestWorkspaceUtil.removeWorkspaceById');
267
267
 
268
- const workspaceIdUrl: string = `${TestWorkspaceUtil.WORKSPACE_API_URL}/${id}`;
268
+ const workspaceIdUrl: string = `${await this.apiUrlResolver.getWorkspacesApiUrl()}/${id}`;
269
269
  try {
270
270
  const deleteWorkspaceResponse = await this.processRequestHandler.delete(workspaceIdUrl);
271
271
  if (deleteWorkspaceResponse.status !== 204) {
@@ -283,7 +283,7 @@ export class TestWorkspaceUtil {
283
283
  public async stopWorkspaceById(id: string) {
284
284
  Logger.debug('TestWorkspaceUtil.stopWorkspaceById');
285
285
 
286
- const stopWorkspaceApiUrl: string = `${TestWorkspaceUtil.WORKSPACE_API_URL}/${id}`;
286
+ const stopWorkspaceApiUrl: string = `${await this.apiUrlResolver.getWorkspacesApiUrl()}/${id}`;
287
287
  let stopWorkspaceResponse;
288
288
 
289
289
  try {
@@ -338,16 +338,16 @@ export class TestWorkspaceUtil {
338
338
  */
339
339
  public async cleanUpRunningWorkspace(workspaceName: string) {
340
340
  if (workspaceName === undefined || workspaceName.length === 0) {
341
- Logger.warn(`Could nod delete workspace because workspaceName is undefined or empty`);
342
- return;
341
+ Logger.warn(`Could nod delete workspace because workspaceName is undefined or empty`);
342
+ return;
343
343
  }
344
344
 
345
345
  Logger.debug(`TestWorkspaceUtil.cleanUpRunningWorkspace ${workspaceName}`);
346
346
  const workspaceID: string = await this.getIdOfRunningWorkspace(workspaceName);
347
347
 
348
348
  if (workspaceID === undefined || workspaceID.length === 0) {
349
- Logger.error(`Could nod delete workspace with name ${workspaceName} because workspaceID is undefined or empty`);
350
- return;
349
+ Logger.error(`Could nod delete workspace with name ${workspaceName} because workspaceID is undefined or empty`);
350
+ return;
351
351
  }
352
352
 
353
353
  Logger.trace(`TestWorkspaceUtil.cleanUpRunningWorkspace Stopping workspace:${workspaceName} with ID:${workspaceID}`);
@@ -363,7 +363,7 @@ export class TestWorkspaceUtil {
363
363
  Logger.debug('TestWorkspaceUtil.createWsFromDevFile');
364
364
 
365
365
  try {
366
- await this.processRequestHandler.post(TestWorkspaceUtil.WORKSPACE_API_URL + '/devfile', customTemplate);
366
+ await this.processRequestHandler.post(await this.apiUrlResolver.getWorkspacesApiUrl() + '/devfile', customTemplate);
367
367
  } catch (error) {
368
368
  console.error(error);
369
369
  throw error;
@@ -393,7 +393,7 @@ export class TestWorkspaceUtil {
393
393
  Logger.debug('TestWorkspaceUtil.startWorkspace');
394
394
 
395
395
  try {
396
- await this.processRequestHandler.post(`${TestWorkspaceUtil.WORKSPACE_API_URL}/${workspaceId}/runtime`);
396
+ await this.processRequestHandler.post(`${await this.apiUrlResolver.getWorkspacesApiUrl()}/${workspaceId}/runtime`);
397
397
  } catch (error) {
398
398
  console.error(error);
399
399
  throw error;
@@ -8,7 +8,7 @@
8
8
  * SPDX-License-Identifier: EPL-2.0
9
9
  **********************************************************************/
10
10
 
11
- export enum WorkspaceStatus {
11
+ export enum WorkspaceStatus {
12
12
  RUNNING = 'Running',
13
13
  STOPPED = 'Stopped',
14
14
  STARTING = 'Starting'
@@ -1 +0,0 @@
1
- {"version":3,"file":"IApiUrlResolver.js","sourceRoot":"","sources":["../../../utils/workspace/IApiUrlResolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE"}
@@ -1,15 +0,0 @@
1
- /*********************************************************************
2
- * Copyright (c) 2019 Red Hat, Inc.
3
- *
4
- * This program and the accompanying materials are made
5
- * available under the terms of the Eclipse Public License 2.0
6
- * which is available at https://www.eclipse.org/legal/epl-2.0/
7
- *
8
- * SPDX-License-Identifier: EPL-2.0
9
- **********************************************************************/
10
-
11
- export interface IApiUrlResolver {
12
- getWorkspaceApiUrl(namespace: string, workspacename: string): string;
13
- getWorkspacesApiUrl(namespace: string): string;
14
-
15
- }