@eclipse-che/che-e2e 7.76.0-next-6068ce8 → 7.76.0-next-a90153c

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 (106) hide show
  1. package/CODE_STYLE.md +1 -1
  2. package/configs/inversify.config.ts +1 -7
  3. package/configs/mocharc.ts +7 -3
  4. package/configs/sh-scripts/runFunctionalTests.sh +104 -0
  5. package/constants/API_TEST_CONSTANTS.ts +5 -2
  6. package/constants/BASE_TEST_CONSTANTS.ts +25 -7
  7. package/constants/MOCHA_CONSTANTS.ts +9 -2
  8. package/dist/configs/inversify.config.js +0 -5
  9. package/dist/configs/inversify.config.js.map +1 -1
  10. package/dist/configs/mocharc.js +14 -11
  11. package/dist/configs/mocharc.js.map +1 -1
  12. package/dist/constants/API_TEST_CONSTANTS.js +3 -2
  13. package/dist/constants/API_TEST_CONSTANTS.js.map +1 -1
  14. package/dist/constants/BASE_TEST_CONSTANTS.js +12 -0
  15. package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -1
  16. package/dist/constants/MOCHA_CONSTANTS.js +7 -4
  17. package/dist/constants/MOCHA_CONSTANTS.js.map +1 -1
  18. package/dist/specs/MochaHooks.js +10 -0
  19. package/dist/specs/MochaHooks.js.map +1 -1
  20. package/dist/specs/api/ContainerOverridesAPI.spec.js +2 -1
  21. package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
  22. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +9 -7
  23. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
  24. package/dist/specs/api/EmptyWorkspaceAPI.spec.js +2 -2
  25. package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
  26. package/dist/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.js +97 -0
  27. package/dist/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.js.map +1 -0
  28. package/dist/specs/api/PodOverridesAPI.spec.js +1 -1
  29. package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
  30. package/dist/specs/dashboard-samples/Documentation.spec.js +1 -1
  31. package/dist/specs/dashboard-samples/Documentation.spec.js.map +1 -1
  32. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +2 -1
  33. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
  34. package/dist/specs/dashboard-samples/Quarkus.spec.js +1 -1
  35. package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
  36. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +2 -1
  37. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
  38. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +1 -1
  39. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
  40. package/dist/specs/factory/Factory.spec.js +1 -1
  41. package/dist/specs/factory/Factory.spec.js.map +1 -1
  42. package/dist/specs/factory/NoSetupRepoFactory.spec.js +1 -1
  43. package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
  44. package/dist/specs/factory/RefusedOAuthFactory.spec.js +1 -1
  45. package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
  46. package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js +1 -1
  47. package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js.map +1 -1
  48. package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js +3 -2
  49. package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js.map +1 -1
  50. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +2 -1
  51. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
  52. package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js +6 -1
  53. package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js.map +1 -1
  54. package/dist/specs/web-terminal/WebTerminalTest.spec.js +2 -1
  55. package/dist/specs/web-terminal/WebTerminalTest.spec.js.map +1 -1
  56. package/dist/suites/disconnected-ocp/APITest.suite.js +14 -0
  57. package/dist/suites/disconnected-ocp/APITest.suite.js.map +1 -0
  58. package/dist/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.js +13 -0
  59. package/dist/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.js.map +1 -0
  60. package/dist/suites/disconnected-ocp/UITest.suite.js +19 -0
  61. package/dist/suites/disconnected-ocp/UITest.suite.js.map +1 -0
  62. package/dist/suites/online-ocp/APITest.suite.js +15 -0
  63. package/dist/suites/online-ocp/APITest.suite.js.map +1 -0
  64. package/dist/suites/online-ocp/DynamicallyGeneratingAPITest.suite.js +13 -0
  65. package/dist/suites/online-ocp/DynamicallyGeneratingAPITest.suite.js.map +1 -0
  66. package/dist/suites/online-ocp/UITest.suite.js +22 -0
  67. package/dist/suites/online-ocp/UITest.suite.js.map +1 -0
  68. package/dist/tests-library/LoginTests.js +2 -0
  69. package/dist/tests-library/LoginTests.js.map +1 -1
  70. package/dist/utils/DevWorkspaceConfigurationHelper.js +43 -2
  71. package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
  72. package/dist/utils/DevfilesRegistryHelper.js +22 -8
  73. package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
  74. package/dist/utils/KubernetesCommandLineToolsExecutor.js +6 -6
  75. package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
  76. package/package.json +3 -1
  77. package/specs/MochaHooks.ts +11 -0
  78. package/specs/api/ContainerOverridesAPI.spec.ts +2 -1
  79. package/specs/api/DevfileAcceptanceTestAPI.spec.ts +10 -8
  80. package/specs/api/EmptyWorkspaceAPI.spec.ts +2 -2
  81. package/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.ts +130 -0
  82. package/specs/api/PodOverridesAPI.spec.ts +1 -1
  83. package/specs/dashboard-samples/Documentation.spec.ts +1 -1
  84. package/specs/dashboard-samples/EmptyWorkspace.spec.ts +2 -1
  85. package/specs/dashboard-samples/Quarkus.spec.ts +1 -1
  86. package/specs/dashboard-samples/RecommendedExtensions.spec.ts +2 -1
  87. package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +1 -1
  88. package/specs/factory/Factory.spec.ts +1 -1
  89. package/specs/factory/NoSetupRepoFactory.spec.ts +1 -1
  90. package/specs/factory/RefusedOAuthFactory.spec.ts +1 -1
  91. package/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.ts +1 -1
  92. package/specs/miscellaneous/KubedockPodmanTest.spec.ts +63 -59
  93. package/specs/miscellaneous/PredefinedNamespace.spec.ts +2 -1
  94. package/specs/miscellaneous/WorkspaceWithParent.spec.ts +9 -2
  95. package/specs/web-terminal/WebTerminalTest.spec.ts +2 -1
  96. package/suites/disconnected-ocp/APITest.suite.ts +11 -0
  97. package/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.ts +10 -0
  98. package/suites/disconnected-ocp/UITest.suite.ts +16 -0
  99. package/suites/online-ocp/APITest.suite.ts +12 -0
  100. package/suites/online-ocp/DynamicallyGeneratingAPITest.suite.ts +10 -0
  101. package/suites/online-ocp/UITest.suite.ts +19 -0
  102. package/tests-library/LoginTests.ts +2 -0
  103. package/utils/DevWorkspaceConfigurationHelper.ts +33 -3
  104. package/utils/DevfilesRegistryHelper.ts +28 -9
  105. package/utils/IKubernetesCommandLineToolsExecutor.ts +1 -1
  106. package/utils/KubernetesCommandLineToolsExecutor.ts +6 -6
@@ -12,13 +12,17 @@ import { Logger } from './Logger';
12
12
  import YAML from 'yaml';
13
13
  import { API_TEST_CONSTANTS, SUPPORTED_DEVFILE_REGISTRIES } from '../constants/API_TEST_CONSTANTS';
14
14
  import { injectable } from 'inversify';
15
+ import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';
15
16
 
16
17
  @injectable()
17
18
  export class DevfilesRegistryHelper {
18
- async getInbuiltDevfilesRegistryContent(): Promise<AxiosResponse> {
19
+ async getInbuiltDevfilesRegistryContent(sampleNamePatterns?: string[]): Promise<any[]> {
19
20
  Logger.trace();
20
21
 
21
- return await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.INBUILT_APPLICATION_DEVFILE_REGISTRY_URL());
22
+ return this.filterSamples(
23
+ sampleNamePatterns,
24
+ await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.INBUILT_APPLICATION_DEVFILE_REGISTRY_URL())
25
+ );
22
26
  }
23
27
 
24
28
  async getGitHubCheDevfileRegistryContent(): Promise<AxiosResponse> {
@@ -27,13 +31,13 @@ export class DevfilesRegistryHelper {
27
31
  return await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL);
28
32
  }
29
33
 
30
- async collectPathsToDevfilesFromRegistry(): Promise<object[]> {
34
+ async collectPathsToDevfilesFromRegistry(isInbuilt: boolean = true, sampleNamePatterns?: string[]): Promise<object[]> {
31
35
  Logger.debug();
32
36
 
33
37
  const devfileSamples: object[] = [];
34
38
  const sampleNames: string[] = [];
35
- switch (API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()) {
36
- case SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL:
39
+ switch (isInbuilt) {
40
+ case false:
37
41
  {
38
42
  const content: any[any] = await this.getGitHubCheDevfileRegistryContent();
39
43
  content.forEach((e: any): void => {
@@ -55,14 +59,17 @@ export class DevfilesRegistryHelper {
55
59
  Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
56
60
  }
57
61
  break;
58
- case SUPPORTED_DEVFILE_REGISTRIES.INBUILT_APPLICATION_DEVFILE_REGISTRY_URL():
62
+ case true:
59
63
  {
60
- const content: any[any] = await this.getInbuiltDevfilesRegistryContent();
61
-
64
+ const content: any[any] = await this.getInbuiltDevfilesRegistryContent(sampleNamePatterns);
62
65
  for (const sample of content) {
66
+ const linkToDevWorkspaceYaml: any =
67
+ BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL +
68
+ '/devfile-registry' +
69
+ sample.links.devWorkspaces['che-incubator/che-code/latest'];
63
70
  devfileSamples.push({
64
71
  name: sample.displayName,
65
- link: sample.links.v2
72
+ devWorkspaceConfigurationString: await this.getContent(linkToDevWorkspaceYaml)
66
73
  });
67
74
  }
68
75
  Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
@@ -76,6 +83,18 @@ export class DevfilesRegistryHelper {
76
83
  return devfileSamples;
77
84
  }
78
85
 
86
+ async getEditorContent(entry: string): Promise<any> {
87
+ return await this.getContent(`${BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL}/${entry}`);
88
+ }
89
+
90
+ private filterSamples(sampleNamePatterns: string[] | undefined, content: any): Promise<any[]> {
91
+ if (sampleNamePatterns) {
92
+ const commonSampleNamePattern: RegExp = new RegExp(sampleNamePatterns.join('|'), 'i');
93
+ content = content.filter((e: any): boolean => commonSampleNamePattern.test(e.displayName));
94
+ }
95
+ return content;
96
+ }
97
+
79
98
  private async getContent(url: string, headers?: object): Promise<AxiosResponse> {
80
99
  Logger.trace(`${url}`);
81
100
 
@@ -20,7 +20,7 @@ export interface IKubernetesCommandLineToolsExecutor {
20
20
 
21
21
  applyAndWaitDevWorkspace(yamlConfiguration: string): ShellString;
22
22
 
23
- executeCommand(commandToExecute: string, container: string): ShellString;
23
+ execInContainerCommand(commandToExecute: string, container: string): ShellString;
24
24
 
25
25
  applyYamlConfigurationAsStringOutput(yamlConfiguration: string): ShellString;
26
26
 
@@ -114,7 +114,7 @@ export class KubernetesCommandLineToolsExecutor implements IKubernetesCommandLin
114
114
  return this.waitDevWorkspace();
115
115
  }
116
116
 
117
- executeCommand(commandToExecute: string, container: string = KubernetesCommandLineToolsExecutor.container): ShellString {
117
+ execInContainerCommand(commandToExecute: string, container: string = KubernetesCommandLineToolsExecutor.container): ShellString {
118
118
  Logger.debug(`${this.kubernetesCommandLineTool}`);
119
119
 
120
120
  return this.shellExecutor.executeCommand(
@@ -217,22 +217,22 @@ export class ContainerTerminal extends KubernetesCommandLineToolsExecutor {
217
217
  }
218
218
 
219
219
  ls(path: string = ''): ShellString {
220
- return this.shellExecutor.executeCommand('ls ' + path);
220
+ return this.execInContainerCommand('ls ' + path);
221
221
  }
222
222
 
223
223
  pwd(): ShellString {
224
- return this.shellExecutor.executeCommand('pwd');
224
+ return this.execInContainerCommand('pwd');
225
225
  }
226
226
 
227
227
  cd(path: string): ShellString {
228
- return this.shellExecutor.executeCommand('cd ' + path);
228
+ return this.execInContainerCommand('cd ' + path);
229
229
  }
230
230
 
231
231
  gitClone(repository: string): ShellString {
232
- return this.shellExecutor.executeCommand('git clone ' + repository);
232
+ return this.execInContainerCommand('git clone ' + repository);
233
233
  }
234
234
 
235
235
  removeFolder(path: string): ShellString {
236
- return this.shellExecutor.executeCommand('rm -rf ' + path);
236
+ return this.execInContainerCommand('rm -rf ' + path);
237
237
  }
238
238
  }