@eclipse-che/che-e2e 7.74.0-dev-1d09cb7 → 7.74.0-dev-aace77a

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 (229) hide show
  1. package/.eslintignore +10 -0
  2. package/.eslintrc.js +197 -0
  3. package/.prettierignore +10 -0
  4. package/.prettierrc.json +10 -0
  5. package/CODE_STYLE.md +144 -0
  6. package/README.md +47 -47
  7. package/configs/inversify.config.ts +39 -14
  8. package/configs/inversify.types.ts +44 -30
  9. package/configs/mocharc.ts +21 -24
  10. package/constants/API_TEST_CONSTANTS.ts +67 -0
  11. package/constants/BASE_TEST_CONSTANTS.ts +80 -0
  12. package/constants/CHROME_DRIVER_CONSTANTS.ts +42 -0
  13. package/constants/FACTORY_TEST_CONSTANTS.ts +61 -0
  14. package/constants/MONACO_CONSTANTS.ts +25 -0
  15. package/constants/OAUTH_CONSTANTS.ts +67 -0
  16. package/constants/PLUGIN_TEST_CONSTANTS.ts +15 -0
  17. package/constants/REPORTER_CONSTANTS.ts +53 -0
  18. package/constants/TIMEOUT_CONSTANTS.ts +131 -0
  19. package/dist/configs/inversify.config.js +36 -9
  20. package/dist/configs/inversify.config.js.map +1 -1
  21. package/dist/configs/inversify.types.js +19 -5
  22. package/dist/configs/inversify.types.js.map +1 -1
  23. package/dist/configs/mocharc.js +13 -16
  24. package/dist/configs/mocharc.js.map +1 -1
  25. package/dist/constants/{APITestConstants.js → API_TEST_CONSTANTS.js} +12 -12
  26. package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
  27. package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +16 -16
  28. package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
  29. package/dist/constants/CHROME_DRIVER_CONSTANTS.js +36 -0
  30. package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
  31. package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +14 -13
  32. package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
  33. package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +7 -7
  34. package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
  35. package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +14 -14
  36. package/dist/constants/OAUTH_CONSTANTS.js.map +1 -0
  37. package/dist/constants/{PluginsTestConstants.js → PLUGIN_TEST_CONSTANTS.js} +7 -7
  38. package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -0
  39. package/dist/constants/{ReporterConstants.js → REPORTER_CONSTANTS.js} +12 -12
  40. package/dist/constants/REPORTER_CONSTANTS.js.map +1 -0
  41. package/dist/constants/{TimeoutConstants.js → TIMEOUT_CONSTANTS.js} +24 -24
  42. package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -0
  43. package/dist/driver/ChromeDriver.js +12 -22
  44. package/dist/driver/ChromeDriver.js.map +1 -1
  45. package/dist/index.js +18 -12
  46. package/dist/index.js.map +1 -1
  47. package/dist/pageobjects/dashboard/CreateWorkspace.js +15 -15
  48. package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
  49. package/dist/pageobjects/dashboard/Dashboard.js +20 -21
  50. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  51. package/dist/pageobjects/dashboard/Workspaces.js +55 -60
  52. package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
  53. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +58 -48
  54. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
  55. package/dist/pageobjects/git-providers/OauthPage.js +22 -20
  56. package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
  57. package/dist/pageobjects/ide/CheCodeLocatorLoader.js +26 -12
  58. package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
  59. package/dist/pageobjects/login/interfaces/ICheLoginPage.js +2 -2
  60. package/dist/pageobjects/login/interfaces/IOcpLoginPage.js +2 -2
  61. package/dist/pageobjects/login/kubernetes/DexLoginPage.js +14 -14
  62. package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
  63. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +7 -7
  64. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
  65. package/dist/pageobjects/login/openshift/OcpLoginPage.js +24 -28
  66. package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
  67. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +13 -16
  68. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
  69. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +9 -9
  70. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
  71. package/dist/pageobjects/login/openshift/RedHatLoginPage.js +19 -23
  72. package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
  73. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +20 -19
  74. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
  75. package/dist/pageobjects/openshift/OcpApplicationPage.js +11 -11
  76. package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
  77. package/dist/pageobjects/openshift/OcpImportFromGitPage.js +24 -24
  78. package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
  79. package/dist/pageobjects/openshift/OcpMainPage.js +30 -30
  80. package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
  81. package/dist/specs/MochaHooks.js +33 -27
  82. package/dist/specs/MochaHooks.js.map +1 -1
  83. package/dist/specs/SmokeTest.spec.js +17 -17
  84. package/dist/specs/SmokeTest.spec.js.map +1 -1
  85. package/dist/specs/api/ContainerOverridesAPI.spec.js +8 -6
  86. package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
  87. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +27 -24
  88. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
  89. package/dist/specs/api/EmptyWorkspaceAPI.spec.js +17 -17
  90. package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
  91. package/dist/specs/api/PodOverridesAPI.spec.js +10 -8
  92. package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
  93. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +10 -10
  94. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
  95. package/dist/specs/dashboard-samples/Quarkus.spec.js +13 -13
  96. package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
  97. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +52 -52
  98. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
  99. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +23 -19
  100. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
  101. package/dist/specs/factory/Factory.spec.js +38 -41
  102. package/dist/specs/factory/Factory.spec.js.map +1 -1
  103. package/dist/specs/factory/NoSetupRepoFactory.spec.js +52 -50
  104. package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
  105. package/dist/specs/factory/RefusedOAuthFactory.spec.js +49 -51
  106. package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
  107. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +45 -42
  108. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
  109. package/dist/tests-library/LoginTests.js +13 -13
  110. package/dist/tests-library/LoginTests.js.map +1 -1
  111. package/dist/tests-library/ProjectAndFileTests.js +9 -7
  112. package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
  113. package/dist/tests-library/WorkspaceHandlingTests.js +22 -19
  114. package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
  115. package/dist/utils/BrowserTabsUtil.js +21 -21
  116. package/dist/utils/BrowserTabsUtil.js.map +1 -1
  117. package/dist/utils/CheReporter.js +91 -65
  118. package/dist/utils/CheReporter.js.map +1 -1
  119. package/dist/utils/DevWorkspaceConfigurationHelper.js +34 -15
  120. package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
  121. package/dist/utils/DevfilesRegistryHelper.js +34 -18
  122. package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
  123. package/dist/utils/DriverHelper.js +73 -68
  124. package/dist/utils/DriverHelper.js.map +1 -1
  125. package/dist/utils/IContextParams.js +12 -0
  126. package/dist/utils/IContextParams.js.map +1 -0
  127. package/dist/utils/IKubernetesCommandLineToolsExecutor.js +3 -0
  128. package/dist/utils/IKubernetesCommandLineToolsExecutor.js.map +1 -0
  129. package/dist/utils/KubernetesCommandLineToolsExecutor.js +146 -107
  130. package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
  131. package/dist/utils/Logger.js +18 -19
  132. package/dist/utils/Logger.js.map +1 -1
  133. package/dist/utils/ScreenCatcher.js +26 -16
  134. package/dist/utils/ScreenCatcher.js.map +1 -1
  135. package/dist/utils/ShellExecutor.js +29 -9
  136. package/dist/utils/ShellExecutor.js.map +1 -1
  137. package/dist/utils/StringUtil.js +19 -9
  138. package/dist/utils/StringUtil.js.map +1 -1
  139. package/dist/utils/request-handlers/CheApiRequestHandler.js +29 -29
  140. package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
  141. package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +12 -8
  142. package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
  143. package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js +2 -2
  144. package/dist/utils/workspace/ApiUrlResolver.js +5 -5
  145. package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
  146. package/dist/utils/workspace/ITestWorkspaceUtil.js +2 -2
  147. package/dist/utils/workspace/TestWorkspaceUtil.js +25 -23
  148. package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
  149. package/dist/utils/workspace/WorkspaceStatus.js +2 -2
  150. package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
  151. package/driver/ChromeDriver.ts +45 -58
  152. package/driver/IDriver.ts +3 -3
  153. package/index.ts +11 -9
  154. package/package.json +59 -49
  155. package/pageobjects/dashboard/CreateWorkspace.ts +65 -55
  156. package/pageobjects/dashboard/Dashboard.ts +100 -100
  157. package/pageobjects/dashboard/Workspaces.ts +210 -186
  158. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +153 -131
  159. package/pageobjects/git-providers/OauthPage.ts +177 -166
  160. package/pageobjects/ide/CheCodeLocatorLoader.ts +51 -46
  161. package/pageobjects/login/interfaces/ICheLoginPage.ts +3 -3
  162. package/pageobjects/login/interfaces/IOcpLoginPage.ts +3 -3
  163. package/pageobjects/login/kubernetes/DexLoginPage.ts +31 -30
  164. package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +15 -14
  165. package/pageobjects/login/openshift/OcpLoginPage.ts +51 -56
  166. package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +27 -27
  167. package/pageobjects/login/openshift/OcpUserLoginPage.ts +15 -18
  168. package/pageobjects/login/openshift/RedHatLoginPage.ts +49 -46
  169. package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +43 -34
  170. package/pageobjects/openshift/OcpApplicationPage.ts +21 -19
  171. package/pageobjects/openshift/OcpImportFromGitPage.ts +68 -68
  172. package/pageobjects/openshift/OcpMainPage.ts +69 -69
  173. package/specs/MochaHooks.ts +59 -52
  174. package/specs/SmokeTest.spec.ts +47 -45
  175. package/specs/api/ContainerOverridesAPI.spec.ts +39 -26
  176. package/specs/api/DevfileAcceptanceTestAPI.spec.ts +110 -97
  177. package/specs/api/EmptyWorkspaceAPI.spec.ts +67 -58
  178. package/specs/api/PodOverridesAPI.spec.ts +48 -34
  179. package/specs/dashboard-samples/EmptyWorkspace.spec.ts +36 -36
  180. package/specs/dashboard-samples/Quarkus.spec.ts +41 -40
  181. package/specs/dashboard-samples/RecommendedExtensions.spec.ts +202 -183
  182. package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +85 -75
  183. package/specs/factory/Factory.spec.ts +184 -178
  184. package/specs/factory/NoSetupRepoFactory.spec.ts +233 -219
  185. package/specs/factory/RefusedOAuthFactory.spec.ts +223 -211
  186. package/specs/miscellaneous/PredefinedNamespace.spec.ts +70 -64
  187. package/tests-library/LoginTests.ts +34 -32
  188. package/tests-library/ProjectAndFileTests.ts +21 -18
  189. package/tests-library/WorkspaceHandlingTests.ts +98 -89
  190. package/tsconfig.json +15 -15
  191. package/utils/BrowserTabsUtil.ts +78 -74
  192. package/utils/CheReporter.ts +159 -157
  193. package/utils/DevWorkspaceConfigurationHelper.ts +63 -69
  194. package/utils/DevfilesRegistryHelper.ts +71 -57
  195. package/utils/DriverHelper.ts +728 -700
  196. package/utils/IContextParams.ts +26 -0
  197. package/utils/IKubernetesCommandLineToolsExecutor.ts +42 -0
  198. package/utils/KubernetesCommandLineToolsExecutor.ts +231 -183
  199. package/utils/Logger.ts +102 -125
  200. package/utils/ScreenCatcher.ts +57 -46
  201. package/utils/ShellExecutor.ts +23 -12
  202. package/utils/StringUtil.ts +49 -36
  203. package/utils/request-handlers/CheApiRequestHandler.ts +91 -88
  204. package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +32 -21
  205. package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +3 -3
  206. package/utils/workspace/ApiUrlResolver.ts +31 -26
  207. package/utils/workspace/ITestWorkspaceUtil.ts +31 -31
  208. package/utils/workspace/TestWorkspaceUtil.ts +152 -145
  209. package/utils/workspace/WorkspaceStatus.ts +5 -5
  210. package/constants/APITestConstants.ts +0 -57
  211. package/constants/BaseTestConstants.ts +0 -68
  212. package/constants/ChromeDriverConstants.ts +0 -46
  213. package/constants/FactoryTestConstants.ts +0 -51
  214. package/constants/MonacoConstants.ts +0 -22
  215. package/constants/OAuthConstants.ts +0 -57
  216. package/constants/PluginsTestConstants.ts +0 -15
  217. package/constants/ReporterConstants.ts +0 -45
  218. package/constants/TimeoutConstants.ts +0 -113
  219. package/dist/constants/APITestConstants.js.map +0 -1
  220. package/dist/constants/BaseTestConstants.js.map +0 -1
  221. package/dist/constants/ChromeDriverConstants.js +0 -44
  222. package/dist/constants/ChromeDriverConstants.js.map +0 -1
  223. package/dist/constants/FactoryTestConstants.js.map +0 -1
  224. package/dist/constants/MonacoConstants.js.map +0 -1
  225. package/dist/constants/OAuthConstants.js.map +0 -1
  226. package/dist/constants/PluginsTestConstants.js.map +0 -1
  227. package/dist/constants/ReporterConstants.js.map +0 -1
  228. package/dist/constants/TimeoutConstants.js.map +0 -1
  229. package/tslint.json +0 -126
@@ -1,38 +1,51 @@
1
+ /** *******************************************************************
2
+ * copyright (c) 2023 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
+ **********************************************************************/
1
10
  import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
2
11
  import fs from 'fs';
3
12
  import path from 'path';
4
13
  import YAML from 'yaml';
5
14
  import { expect } from 'chai';
6
15
  import { ShellExecutor } from '../../utils/ShellExecutor';
16
+ import { e2eContainer } from '../../configs/inversify.config';
17
+ import { CLASSES } from '../../configs/inversify.types';
7
18
 
8
- suite(`Test defining container overrides via attribute.`, async function(): Promise<void> {
9
- const pathToSampleFile: string = path.resolve('resources/container-overrides.yaml');
10
- const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
11
- const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);
19
+ suite('Test defining container overrides via attribute.', function (): void {
20
+ const pathToSampleFile: string = path.resolve('resources/container-overrides.yaml');
21
+ const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
22
+ const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
23
+ CLASSES.KubernetesCommandLineToolsExecutor
24
+ );
25
+ kubernetesCommandLineToolsExecutor.workspaceName = workspaceName;
26
+ const shellExecutor: ShellExecutor = e2eContainer.get(CLASSES.ShellExecutor);
12
27
 
13
- suiteSetup('Login into OC client', function(): void {
14
- kubernetesCommandLineToolsExecutor.loginToOcp();
15
- });
28
+ suiteSetup('Login into OC client', function (): void {
29
+ kubernetesCommandLineToolsExecutor.loginToOcp();
30
+ });
16
31
 
17
- suiteTeardown('Delete DevWorkspace', function(): void {
18
- kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
19
- });
32
+ suiteTeardown('Delete DevWorkspace', function (): void {
33
+ kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
34
+ });
20
35
 
21
- test('Apply container-overrides sample as DevWorkspace with OC client', function(): void {
22
- kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
23
- ShellExecutor.wait(5);
24
- });
36
+ test('Apply container-overrides sample as DevWorkspace with OC client', function (): void {
37
+ kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
38
+ shellExecutor.wait(5);
39
+ });
25
40
 
26
- test('Check that fields are overridden in the Deployment for DevWorkspace', function(): void {
27
- const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
28
- expect(devWorkspaceFullYamlOutput.spec.template.components[0].attributes['container-overrides']).eqls({
29
- resources: {
30
- limits: {
31
- 'nvidia.com/gpu': '1'
32
- }
33
- }
34
- });
35
- });
41
+ test('Check that fields are overridden in the Deployment for DevWorkspace', function (): void {
42
+ const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
43
+ expect(devWorkspaceFullYamlOutput.spec.template.components[0].attributes['container-overrides']).eqls({
44
+ resources: {
45
+ limits: {
46
+ 'nvidia.com/gpu': '1'
47
+ }
48
+ }
49
+ });
50
+ });
36
51
  });
37
-
38
-
@@ -1,108 +1,121 @@
1
- import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
1
+ /** *******************************************************************
2
+ * copyright (c) 2023 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
+ import { ContainerTerminal, KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
2
11
  import { DevWorkspaceConfigurationHelper } from '../../utils/DevWorkspaceConfigurationHelper';
3
12
  import { ShellString } from 'shelljs';
4
13
  import { expect } from 'chai';
5
14
  import { DevfileContext } from '@eclipse-che/che-devworkspace-generator/lib/api/devfile-context';
6
15
  import { StringUtil } from '../../utils/StringUtil';
7
- // import { DevfilesRegistryHelper } from '../../utils/DevfilesRegistryHelper';
8
16
  import { Logger } from '../../utils/Logger';
17
+ import { e2eContainer } from '../../configs/inversify.config';
18
+ import { CLASSES } from '../../configs/inversify.types';
9
19
 
10
20
  /**
11
- * Dynamically generating tests
21
+ * dynamically generating tests
12
22
  * info: https://mochajs.org/#delayed-root-suite
13
23
  */
14
-
15
- (async function(): Promise<void> {
16
-
17
- // todo: skipped while don`t use to avoid sending useless requests
18
- // const devfilesRegistryHelper: DevfilesRegistryHelper = new DevfilesRegistryHelper();
19
- const devfileSamples: any = [];
20
- // devfileSamples = await devfilesRegistryHelper.collectPathsToDevfilesFromRegistry();
21
-
22
- for (const devfileSample of devfileSamples) {
23
- suite.skip(`Devfile acceptance test suite for ${devfileSample.name}`, async function(): Promise<void> {
24
- this.bail(false);
25
- this.timeout(1500000); // 25 minutes because build of Quarkus sample takes 20+ minutes
26
- let devWorkspaceConfigurationHelper: DevWorkspaceConfigurationHelper;
27
- let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
28
- let containerTerminal: KubernetesCommandLineToolsExecutor.ContainerTerminal;
29
- let devfileContext: DevfileContext;
30
- let devWorkspaceName: string | undefined;
31
- let clonedProjectName: string;
32
- let containerWorkDir: string;
33
- let devfilesBuildCommands: any[] = [];
34
-
35
- test('Get DevWorkspace configuration', async function(): Promise<void> {
36
- devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({
37
- devfileUrl: devfileSample.link
38
- });
39
- devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();
40
- devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
41
-
42
- kubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(devWorkspaceName);
43
- containerTerminal = new KubernetesCommandLineToolsExecutor.ContainerTerminal(kubernetesCommandLineToolsExecutor);
44
- kubernetesCommandLineToolsExecutor.loginToOcp();
45
- });
46
-
47
- test('Collect build commands from the devfile', async function(): Promise<void> {
48
- if (devfileContext.devfile.commands === undefined) {
49
- Logger.info(`Devfile does not contains any commands.`);
50
- } else {
51
- devfileContext.devfile.commands.forEach((command: any) => {
52
- if (command.exec?.group?.kind === 'build') {
53
- Logger.debug(`Build command found: ${command.exec.commandLine}`);
54
- devfilesBuildCommands.push(command);
55
- }
56
- });
57
- }
58
- });
59
-
60
- test('Create DevWorkspace', async function(): Promise<void> {
61
- const devWorkspaceConfigurationYamlString: string = await devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
62
- const applyOutput: ShellString = kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsStringOutput(devWorkspaceConfigurationYamlString);
63
-
64
- expect(applyOutput.stdout)
65
- .contains('devworkspacetemplate')
66
- .and.contains('devworkspace')
67
- .and.contains.oneOf(['created', 'configured']);
68
-
69
- });
70
-
71
- test('Wait until DevWorkspace has status "ready"', async function(): Promise<void> {
72
- expect(kubernetesCommandLineToolsExecutor.waitDevWorkspace().stdout).contains('condition met');
73
- });
74
-
75
- test('Check if project was created', function(): void {
76
- clonedProjectName = StringUtil.getProjectNameFromGitUrl(devfileSample.link);
77
- expect(containerTerminal.ls().stdout).includes(clonedProjectName);
78
- });
79
-
80
- test('Check if project files are imported', function(): void {
81
- containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
82
- expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout).includes(`devfile.yaml`);
83
- });
84
-
85
- test(`Check if build commands returns success`, function(): void {
86
- if (devfilesBuildCommands.length === 0) {
87
- Logger.info(`Devfile does not contains build commands.`);
88
- } else {
89
- devfilesBuildCommands.forEach((command) => {
90
- Logger.info(`command.exec: ${JSON.stringify(command.exec)}`);
91
-
92
- const commandString: string = StringUtil.updateCommandEnvsToShStyle(`cd ${command.exec.workingDir} && ${command.exec.commandLine}`);
93
- Logger.info(`Full build command to be executed: ${commandString}`);
94
-
95
- const output: ShellString = containerTerminal.executeCommand(commandString, command.exec.component);
96
- expect(output.code).eqls(0);
97
- });
98
- }
99
- });
100
-
101
- test('Delete DevWorkspace', async function(): Promise<void> {
102
- kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
103
- });
104
- });
105
- }
106
-
107
- run();
24
+ // todo: skipped while don`t use to avoid sending useless requests
25
+ // eslint-disable-next-line @typescript-eslint/require-await
26
+ void (async function (): Promise<void> {
27
+ // const devfilesRegistryHelper: DevfilesRegistryHelper = e2eContainer.get(CLASSES.DevfilesRegistryHelper);
28
+
29
+ const devfileSamples: any = [];
30
+ // devfileSamples = await devfilesRegistryHelper.collectPathsToDevfilesFromRegistry();
31
+
32
+ for (const devfileSample of devfileSamples) {
33
+ suite.skip(`Devfile acceptance test suite for ${devfileSample.name}`, function (): void {
34
+ this.bail(false);
35
+ this.timeout(1500000); // 25 minutes because build of Quarkus sample takes 20+ minutes
36
+ let devWorkspaceConfigurationHelper: DevWorkspaceConfigurationHelper;
37
+ let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
38
+ let containerTerminal: ContainerTerminal;
39
+ let devfileContext: DevfileContext;
40
+ let devWorkspaceName: string | undefined;
41
+ let clonedProjectName: string;
42
+ let containerWorkDir: string;
43
+ const devfilesBuildCommands: any[] = [];
44
+
45
+ test('Get DevWorkspace configuration', async function (): Promise<void> {
46
+ devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({
47
+ devfileUrl: devfileSample.link
48
+ });
49
+ devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();
50
+ devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
51
+ kubernetesCommandLineToolsExecutor = e2eContainer.get(CLASSES.KubernetesCommandLineToolsExecutor);
52
+ kubernetesCommandLineToolsExecutor.workspaceName = devWorkspaceName;
53
+ containerTerminal = e2eContainer.get(CLASSES.ContainerTerminal);
54
+ kubernetesCommandLineToolsExecutor.loginToOcp();
55
+ });
56
+
57
+ test('Collect build commands from the devfile', function (): void {
58
+ if (devfileContext.devfile.commands === undefined) {
59
+ Logger.info('Devfile does not contains any commands.');
60
+ } else {
61
+ devfileContext.devfile?.commands?.forEach((command: any): void => {
62
+ if (command.exec?.group?.kind === 'build') {
63
+ Logger.debug(`Build command found: ${command.exec.commandLine}`);
64
+ devfilesBuildCommands.push(command);
65
+ }
66
+ });
67
+ }
68
+ });
69
+
70
+ test('Create DevWorkspace', function (): void {
71
+ const devWorkspaceConfigurationYamlString: string =
72
+ devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
73
+ const applyOutput: ShellString =
74
+ kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsStringOutput(devWorkspaceConfigurationYamlString);
75
+
76
+ expect(applyOutput.stdout)
77
+ .contains('devworkspacetemplate')
78
+ .and.contains('devworkspace')
79
+ .and.contains.oneOf(['created', 'configured']);
80
+ });
81
+
82
+ test('Wait until DevWorkspace has status "ready"', function (): void {
83
+ expect(kubernetesCommandLineToolsExecutor.waitDevWorkspace().stdout).contains('condition met');
84
+ });
85
+
86
+ test('Check if project was created', function (): void {
87
+ clonedProjectName = StringUtil.getProjectNameFromGitUrl(devfileSample.link);
88
+ expect(containerTerminal.ls().stdout).includes(clonedProjectName);
89
+ });
90
+
91
+ test('Check if project files are imported', function (): void {
92
+ containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
93
+ expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout).includes('devfile.yaml');
94
+ });
95
+
96
+ test('Check if build commands returns success', function (): void {
97
+ if (devfilesBuildCommands.length === 0) {
98
+ Logger.info('Devfile does not contains build commands.');
99
+ } else {
100
+ devfilesBuildCommands.forEach((command): void => {
101
+ Logger.info(`command.exec: ${JSON.stringify(command.exec)}`);
102
+
103
+ const commandString: string = StringUtil.updateCommandEnvsToShStyle(
104
+ `cd ${command.exec.workingDir} && ${command.exec.commandLine}`
105
+ );
106
+ Logger.info(`Full build command to be executed: ${commandString}`);
107
+
108
+ const output: ShellString = containerTerminal.executeCommand(commandString, command.exec.component);
109
+ expect(output.code).eqls(0);
110
+ });
111
+ }
112
+ });
113
+
114
+ test('Delete DevWorkspace', function (): void {
115
+ kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
116
+ });
117
+ });
118
+ }
119
+
120
+ run();
108
121
  })();
@@ -1,74 +1,83 @@
1
- import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
1
+ /** *******************************************************************
2
+ * copyright (c) 2023 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
+ import { ContainerTerminal, KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
2
11
  import { expect } from 'chai';
3
12
  import { ShellString } from 'shelljs';
4
13
  import { StringUtil } from '../../utils/StringUtil';
5
14
  import { DevWorkspaceConfigurationHelper } from '../../utils/DevWorkspaceConfigurationHelper';
6
15
  import { DevfileContext } from '@eclipse-che/che-devworkspace-generator/lib/api/devfile-context';
7
- import { APITestConstants } from '../../constants/APITestConstants';
8
- import { BaseTestConstants } from '../../constants/BaseTestConstants';
16
+ import { API_TEST_CONSTANTS } from '../../constants/API_TEST_CONSTANTS';
17
+ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
18
+ import { e2eContainer } from '../../configs/inversify.config';
19
+ import { CLASSES } from '../../configs/inversify.types';
9
20
 
10
- suite(`Empty workspace API test`, async function(): Promise<void> {
11
- // works only for root user
12
- const namespace: string = APITestConstants.TS_API_TEST_NAMESPACE;
13
- let clonedProjectName: string;
14
- let containerWorkDir: string;
15
- let devWorkspaceConfigurationHelper: DevWorkspaceConfigurationHelper;
16
- let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
17
- let devfileContext: DevfileContext;
18
- let devWorkspaceName: string | undefined;
19
- let containerTerminal: KubernetesCommandLineToolsExecutor.ContainerTerminal;
21
+ suite('Empty workspace API test', function (): void {
22
+ // works only for root user
23
+ const namespace: string | undefined = API_TEST_CONSTANTS.TS_API_TEST_NAMESPACE;
24
+ let clonedProjectName: string;
25
+ let containerWorkDir: string;
26
+ let devWorkspaceConfigurationHelper: DevWorkspaceConfigurationHelper;
27
+ let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
28
+ let devfileContext: DevfileContext;
29
+ let devWorkspaceName: string | undefined;
30
+ let containerTerminal: ContainerTerminal;
20
31
 
21
- const gitRepository: string = 'https://github.com/crw-qe/web-nodejs-sample';
32
+ const gitRepository: string = 'https://github.com/crw-qe/web-nodejs-sample';
22
33
 
23
- suiteSetup('Create empty workspace with OC client', async function(): Promise<void> {
24
- const workspaceName: string = 'empty-' + Math.floor(Math.random() * 1000);
25
- const devfileContent: string =
26
- 'schemaVersion: 2.2.0\n' +
27
- 'metadata:\n' +
28
- ` name: ${workspaceName}\n`;
34
+ suiteSetup('Create empty workspace with OC client', async function (): Promise<void> {
35
+ const workspaceName: string = 'empty-' + Math.floor(Math.random() * 1000);
36
+ const devfileContent: string = 'schemaVersion: 2.2.0\n' + 'metadata:\n' + ` name: ${workspaceName}\n`;
29
37
 
30
- devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({
31
- devfileContent
32
- });
33
- devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();
34
- devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
35
- kubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(devWorkspaceName, namespace);
36
- containerTerminal = new KubernetesCommandLineToolsExecutor.ContainerTerminal(kubernetesCommandLineToolsExecutor);
37
- });
38
+ devWorkspaceConfigurationHelper = new DevWorkspaceConfigurationHelper({
39
+ devfileContent
40
+ });
41
+ devfileContext = await devWorkspaceConfigurationHelper.generateDevfileContext();
42
+ devWorkspaceName = devfileContext?.devWorkspace?.metadata?.name;
43
+ kubernetesCommandLineToolsExecutor = e2eContainer.get(CLASSES.KubernetesCommandLineToolsExecutor);
44
+ kubernetesCommandLineToolsExecutor.workspaceName = devWorkspaceName;
45
+ kubernetesCommandLineToolsExecutor.namespace = namespace;
46
+ containerTerminal = e2eContainer.get(CLASSES.ContainerTerminal);
47
+ });
38
48
 
39
- test('Create empty workspace', async function(): Promise<void> {
40
- kubernetesCommandLineToolsExecutor.loginToOcp();
41
- const devWorkspaceConfigurationYamlString: string = await devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
42
- const output: ShellString = kubernetesCommandLineToolsExecutor.applyAndWaitDevWorkspace(devWorkspaceConfigurationYamlString);
43
- expect(output.stdout).contains('condition met');
44
- });
49
+ test('Create empty workspace', function (): void {
50
+ kubernetesCommandLineToolsExecutor.loginToOcp();
51
+ const devWorkspaceConfigurationYamlString: string =
52
+ devWorkspaceConfigurationHelper.getDevWorkspaceConfigurationYamlAsString(devfileContext);
53
+ const output: ShellString = kubernetesCommandLineToolsExecutor.applyAndWaitDevWorkspace(devWorkspaceConfigurationYamlString);
54
+ expect(output.stdout).contains('condition met');
55
+ });
45
56
 
46
- suite('Clone public repo without previous setup', function(): void {
57
+ suite('Clone public repo without previous setup', function (): void {
58
+ test('Check if public repo can be cloned', function (): void {
59
+ containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
60
+ const cloneOutput: ShellString = containerTerminal.gitClone(gitRepository);
61
+ expect(cloneOutput.stdout + cloneOutput.stderr).includes('Cloning');
62
+ });
47
63
 
48
- test('Check if public repo can be cloned', function(): void {
49
- containerWorkDir = containerTerminal.pwd().stdout.replace('\n', '');
50
- const cloneOutput: ShellString = containerTerminal.gitClone(gitRepository);
51
- expect(cloneOutput.stdout + cloneOutput.stderr).includes('Cloning');
52
- });
64
+ test('Check if project was created', function (): void {
65
+ clonedProjectName = StringUtil.getProjectNameFromGitUrl(gitRepository);
66
+ expect(containerTerminal.ls().stdout).includes(clonedProjectName);
67
+ });
53
68
 
54
- test('Check if project was created', function(): void {
55
- clonedProjectName = StringUtil.getProjectNameFromGitUrl(gitRepository);
56
- expect(containerTerminal.ls().stdout).includes(clonedProjectName);
57
- });
69
+ test('Check if project files are imported', function (): void {
70
+ expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout).includes(
71
+ BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME
72
+ );
73
+ });
58
74
 
59
- test('Check if project files are imported', function(): void {
60
- expect(containerTerminal.ls(`${containerWorkDir}/${clonedProjectName}`).stdout)
61
- .includes(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
62
- });
75
+ suiteTeardown('Delete cloned project', function (): void {
76
+ containerTerminal.removeFolder(`${clonedProjectName}`);
77
+ });
78
+ });
63
79
 
64
- suiteTeardown('Delete cloned project', function(): void {
65
- containerTerminal.removeFolder(`${clonedProjectName}`);
66
- });
67
- });
68
-
69
- suiteTeardown('Delete workspace', function(): void {
70
- kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
71
- });
80
+ suiteTeardown('Delete workspace', function (): void {
81
+ kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
82
+ });
72
83
  });
73
-
74
-
@@ -1,45 +1,59 @@
1
+ /** *******************************************************************
2
+ * copyright (c) 2023 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
+ **********************************************************************/
1
10
  import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
2
11
  import fs from 'fs';
3
12
  import path from 'path';
4
13
  import YAML from 'yaml';
5
14
  import { expect } from 'chai';
6
15
  import { ShellExecutor } from '../../utils/ShellExecutor';
7
- import { BaseTestConstants } from '../../constants/BaseTestConstants';
16
+ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
17
+ import { e2eContainer } from '../../configs/inversify.config';
18
+ import { CLASSES } from '../../configs/inversify.types';
8
19
 
9
- suite(`Test defining pod overrides via attribute.`, async function(): Promise<void> {
10
- const pathToSampleFile: string = path.resolve(`resources/pod-overrides${BaseTestConstants.IS_CLUSTER_DISCONNECTED() ? '-airgap' : ''}.yaml`);
11
- const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
12
- const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);
20
+ suite('Test defining pod overrides via attribute.', function (): void {
21
+ const pathToSampleFile: string = path.resolve(
22
+ `resources/pod-overrides${BASE_TEST_CONSTANTS.IS_CLUSTER_DISCONNECTED() ? '-airgap' : ''}.yaml`
23
+ );
24
+ const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
25
+ const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
26
+ CLASSES.KubernetesCommandLineToolsExecutor
27
+ );
28
+ kubernetesCommandLineToolsExecutor.workspaceName = workspaceName;
29
+ const shellExecutor: ShellExecutor = e2eContainer.get(CLASSES.ShellExecutor);
30
+ suiteSetup('Login into OC client', function (): void {
31
+ kubernetesCommandLineToolsExecutor.loginToOcp();
32
+ });
13
33
 
14
- suiteSetup('Login into OC client', function(): void {
15
- kubernetesCommandLineToolsExecutor.loginToOcp();
16
- });
34
+ suiteTeardown('Delete DevWorkspace', function (): void {
35
+ kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
36
+ });
17
37
 
18
- suiteTeardown('Delete DevWorkspace', function(): void {
19
- kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
20
- });
38
+ test('Apply pod-overrides sample as DevWorkspace with OC client', function (): void {
39
+ kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
40
+ shellExecutor.wait(5);
41
+ });
21
42
 
22
- test('Apply pod-overrides sample as DevWorkspace with OC client', function(): void {
23
- kubernetesCommandLineToolsExecutor.applyYamlConfigurationAsFile(pathToSampleFile);
24
- ShellExecutor.wait(5);
25
- });
26
-
27
- test('Check that fields are overridden in the Deployment for DevWorkspace', function(): void {
28
- const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
29
- expect(devWorkspaceFullYamlOutput.spec.template.attributes['pod-overrides']).eqls({
30
- metadata: {
31
- annotations: {
32
- 'io.kubernetes.cri-o.userns-mode': 'auto:size=65536;map-to-root=true',
33
- 'io.openshift.userns': 'true',
34
- 'openshift.io/scc': 'container-build'
35
- }
36
- },
37
- spec: {
38
- runtimeClassName: 'kata',
39
- schedulerName: 'stork'
40
- }
41
- });
42
- });
43
+ test('Check that fields are overridden in the Deployment for DevWorkspace', function (): void {
44
+ const devWorkspaceFullYamlOutput: any = YAML.parse(kubernetesCommandLineToolsExecutor.getDevWorkspaceYamlConfiguration());
45
+ expect(devWorkspaceFullYamlOutput.spec.template.attributes['pod-overrides']).eqls({
46
+ metadata: {
47
+ annotations: {
48
+ 'io.kubernetes.cri-o.userns-mode': 'auto:size=65536;map-to-root=true',
49
+ 'io.openshift.userns': 'true',
50
+ 'openshift.io/scc': 'container-build'
51
+ }
52
+ },
53
+ spec: {
54
+ runtimeClassName: 'kata',
55
+ schedulerName: 'stork'
56
+ }
57
+ });
58
+ });
43
59
  });
44
-
45
-
@@ -1,5 +1,5 @@
1
- /*********************************************************************
2
- * Copyright (c) 2020-2023 Red Hat, Inc.
1
+ /** *******************************************************************
2
+ * copyright (c) 2020-2023 Red Hat, Inc.
3
3
  *
4
4
  * This program and the accompanying materials are made
5
5
  * available under the terms of the Eclipse Public License 2.0
@@ -17,49 +17,49 @@ import { LoginTests } from '../../tests-library/LoginTests';
17
17
  import { registerRunningWorkspace } from '../MochaHooks';
18
18
  import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
19
19
 
20
- const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
21
- const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
22
- const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
23
- const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
24
-
25
20
  const stackName: string = 'Empty Workspace';
26
21
 
27
- suite(`${stackName} test`, async function(): Promise<void> {
28
- loginTests.loginIntoChe();
22
+ suite(`${stackName} test`, function (): void {
23
+ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
24
+ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
25
+ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
26
+ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
27
+
28
+ loginTests.loginIntoChe();
29
29
 
30
- test(`Create and open new workspace, stack:${stackName}`, async function(): Promise<void> {
31
- await workspaceHandlingTests.createAndOpenWorkspace(stackName);
32
- });
30
+ test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> {
31
+ await workspaceHandlingTests.createAndOpenWorkspace(stackName);
32
+ });
33
33
 
34
- test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
35
- await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
36
- });
34
+ test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
35
+ await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
36
+ });
37
37
 
38
- test('Register running workspace', async function(): Promise<void> {
39
- registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
40
- });
38
+ test('Register running workspace', function (): void {
39
+ registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
40
+ });
41
41
 
42
- test('Wait workspace readiness', async function(): Promise<void> {
43
- await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
42
+ test('Wait workspace readiness', async function (): Promise<void> {
43
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
44
44
 
45
- const workbench: Workbench = new Workbench();
46
- const activityBar: ActivityBar = workbench.getActivityBar();
47
- const activityBarControls: ViewControl[] = await activityBar.getViewControls();
45
+ const workbench: Workbench = new Workbench();
46
+ const activityBar: ActivityBar = workbench.getActivityBar();
47
+ const activityBarControls: ViewControl[] = await activityBar.getViewControls();
48
48
 
49
- Logger.debug(`Editor sections:`);
50
- for (const control of activityBarControls) {
51
- Logger.debug(`${await control.getTitle()}`);
52
- }
53
- });
49
+ Logger.debug('Editor sections:');
50
+ for (const control of activityBarControls) {
51
+ Logger.debug(`${await control.getTitle()}`);
52
+ }
53
+ });
54
54
 
55
- test('Stop the workspace', async function(): Promise<void> {
56
- await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
57
- await browserTabsUtil.closeAllTabsExceptCurrent();
58
- });
55
+ test('Stop the workspace', async function (): Promise<void> {
56
+ await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
57
+ await browserTabsUtil.closeAllTabsExceptCurrent();
58
+ });
59
59
 
60
- test('Delete the workspace', async function(): Promise<void> {
61
- await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
62
- });
60
+ test('Delete the workspace', async function (): Promise<void> {
61
+ await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
62
+ });
63
63
 
64
- loginTests.logoutFromChe();
64
+ loginTests.logoutFromChe();
65
65
  });