@eclipse-che/che-e2e 7.73.0 → 7.74.0-dev-41d1364

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 (222) hide show
  1. package/.eslintignore +10 -0
  2. package/.eslintrc.js +183 -0
  3. package/.prettierignore +10 -0
  4. package/.prettierrc.json +10 -0
  5. package/README.md +47 -47
  6. package/configs/inversify.config.ts +14 -10
  7. package/configs/inversify.types.ts +29 -29
  8. package/configs/mocharc.ts +21 -24
  9. package/constants/API_TEST_CONSTANTS.ts +67 -0
  10. package/constants/BASE_TEST_CONSTANTS.ts +80 -0
  11. package/constants/CHROME_DRIVER_CONSTANTS.ts +54 -0
  12. package/constants/FACTORY_TEST_CONSTANTS.ts +61 -0
  13. package/constants/MONACO_CONSTANTS.ts +25 -0
  14. package/constants/OAUTH_CONSTANTS.ts +67 -0
  15. package/constants/PLUGIN_TEST_CONSTANTS.ts +15 -0
  16. package/constants/REPORTER_CONSTANTS.ts +53 -0
  17. package/constants/TIMEOUT_CONSTANTS.ts +131 -0
  18. package/dist/configs/inversify.config.js +14 -8
  19. package/dist/configs/inversify.config.js.map +1 -1
  20. package/dist/configs/inversify.types.js +2 -2
  21. package/dist/configs/inversify.types.js.map +1 -1
  22. package/dist/configs/mocharc.js +13 -16
  23. package/dist/configs/mocharc.js.map +1 -1
  24. package/dist/constants/{APITestConstants.js → API_TEST_CONSTANTS.js} +13 -13
  25. package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
  26. package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +17 -16
  27. package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
  28. package/dist/constants/{ChromeDriverConstants.js → CHROME_DRIVER_CONSTANTS.js} +14 -14
  29. package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
  30. package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +15 -14
  31. package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
  32. package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +8 -8
  33. package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
  34. package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +15 -15
  35. package/dist/constants/OAUTH_CONSTANTS.js.map +1 -0
  36. package/dist/constants/{PluginsTestConstants.js → PLUGIN_TEST_CONSTANTS.js} +7 -7
  37. package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -0
  38. package/dist/constants/{ReporterConstants.js → REPORTER_CONSTANTS.js} +13 -13
  39. package/dist/constants/REPORTER_CONSTANTS.js.map +1 -0
  40. package/dist/constants/{TimeoutConstants.js → TIMEOUT_CONSTANTS.js} +24 -24
  41. package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -0
  42. package/dist/driver/ChromeDriver.js +12 -16
  43. package/dist/driver/ChromeDriver.js.map +1 -1
  44. package/dist/index.js +9 -9
  45. package/dist/index.js.map +1 -1
  46. package/dist/pageobjects/dashboard/CreateWorkspace.js +18 -18
  47. package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
  48. package/dist/pageobjects/dashboard/Dashboard.js +27 -27
  49. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  50. package/dist/pageobjects/dashboard/Workspaces.js +42 -42
  51. package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
  52. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +44 -33
  53. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
  54. package/dist/pageobjects/git-providers/OauthPage.js +37 -35
  55. package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
  56. package/dist/pageobjects/ide/CheCodeLocatorLoader.js +10 -10
  57. package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
  58. package/dist/pageobjects/login/interfaces/ICheLoginPage.js +2 -2
  59. package/dist/pageobjects/login/interfaces/IOcpLoginPage.js +2 -2
  60. package/dist/pageobjects/login/kubernetes/DexLoginPage.js +10 -10
  61. package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
  62. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +6 -6
  63. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
  64. package/dist/pageobjects/login/openshift/OcpLoginPage.js +23 -23
  65. package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
  66. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +7 -7
  67. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
  68. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +7 -7
  69. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
  70. package/dist/pageobjects/login/openshift/RedHatLoginPage.js +11 -11
  71. package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
  72. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +10 -10
  73. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
  74. package/dist/pageobjects/openshift/OcpApplicationPage.js +7 -7
  75. package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
  76. package/dist/pageobjects/openshift/OcpImportFromGitPage.js +9 -9
  77. package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
  78. package/dist/pageobjects/openshift/OcpMainPage.js +15 -15
  79. package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
  80. package/dist/specs/MochaHooks.js +27 -24
  81. package/dist/specs/MochaHooks.js.map +1 -1
  82. package/dist/specs/SmokeTest.spec.js +17 -13
  83. package/dist/specs/SmokeTest.spec.js.map +1 -1
  84. package/dist/specs/api/ContainerOverridesAPI.spec.js +10 -1
  85. package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
  86. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +31 -18
  87. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
  88. package/dist/specs/api/EmptyWorkspaceAPI.spec.js +18 -12
  89. package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
  90. package/dist/specs/api/PodOverridesAPI.spec.js +12 -2
  91. package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
  92. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +12 -8
  93. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
  94. package/dist/specs/dashboard-samples/Quarkus.spec.js +13 -9
  95. package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
  96. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +47 -43
  97. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
  98. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +17 -10
  99. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
  100. package/dist/specs/factory/Factory.spec.js +28 -26
  101. package/dist/specs/factory/Factory.spec.js.map +1 -1
  102. package/dist/specs/factory/NoSetupRepoFactory.spec.js +41 -36
  103. package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
  104. package/dist/specs/factory/RefusedOAuthFactory.spec.js +37 -35
  105. package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
  106. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +18 -5
  107. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
  108. package/dist/tests-library/LoginTests.js +7 -7
  109. package/dist/tests-library/LoginTests.js.map +1 -1
  110. package/dist/tests-library/ProjectAndFileTests.js +9 -7
  111. package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
  112. package/dist/tests-library/WorkspaceHandlingTests.js +61 -78
  113. package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
  114. package/dist/utils/BrowserTabsUtil.js +29 -24
  115. package/dist/utils/BrowserTabsUtil.js.map +1 -1
  116. package/dist/utils/CheReporter.js +44 -44
  117. package/dist/utils/CheReporter.js.map +1 -1
  118. package/dist/utils/DevWorkspaceConfigurationHelper.js +19 -10
  119. package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
  120. package/dist/utils/DevfilesRegistryHelper.js +25 -19
  121. package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
  122. package/dist/utils/DriverHelper.js +126 -128
  123. package/dist/utils/DriverHelper.js.map +1 -1
  124. package/dist/utils/KubernetesCommandLineToolsExecutor.js +53 -46
  125. package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
  126. package/dist/utils/Logger.js +62 -39
  127. package/dist/utils/Logger.js.map +1 -1
  128. package/dist/utils/ScreenCatcher.js +18 -12
  129. package/dist/utils/ScreenCatcher.js.map +1 -1
  130. package/dist/utils/ShellExecutor.js +9 -0
  131. package/dist/utils/ShellExecutor.js.map +1 -1
  132. package/dist/utils/StringUtil.js +17 -9
  133. package/dist/utils/StringUtil.js.map +1 -1
  134. package/dist/utils/request-handlers/CheApiRequestHandler.js +36 -34
  135. package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
  136. package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +10 -6
  137. package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
  138. package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js +2 -2
  139. package/dist/utils/workspace/ApiUrlResolver.js +5 -5
  140. package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
  141. package/dist/utils/workspace/ITestWorkspaceUtil.js +2 -2
  142. package/dist/utils/workspace/TestWorkspaceUtil.js +36 -30
  143. package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
  144. package/dist/utils/workspace/WorkspaceStatus.js +2 -2
  145. package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
  146. package/driver/ChromeDriver.ts +45 -51
  147. package/driver/IDriver.ts +3 -3
  148. package/index.ts +9 -9
  149. package/package.json +59 -49
  150. package/pageobjects/dashboard/CreateWorkspace.ts +65 -56
  151. package/pageobjects/dashboard/Dashboard.ts +101 -100
  152. package/pageobjects/dashboard/Workspaces.ts +197 -166
  153. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +151 -127
  154. package/pageobjects/git-providers/OauthPage.ts +177 -166
  155. package/pageobjects/ide/CheCodeLocatorLoader.ts +49 -46
  156. package/pageobjects/login/interfaces/ICheLoginPage.ts +3 -3
  157. package/pageobjects/login/interfaces/IOcpLoginPage.ts +3 -3
  158. package/pageobjects/login/kubernetes/DexLoginPage.ts +32 -31
  159. package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +16 -15
  160. package/pageobjects/login/openshift/OcpLoginPage.ts +62 -55
  161. package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +30 -25
  162. package/pageobjects/login/openshift/OcpUserLoginPage.ts +16 -19
  163. package/pageobjects/login/openshift/RedHatLoginPage.ts +49 -44
  164. package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +39 -35
  165. package/pageobjects/openshift/OcpApplicationPage.ts +21 -20
  166. package/pageobjects/openshift/OcpImportFromGitPage.ts +70 -68
  167. package/pageobjects/openshift/OcpMainPage.ts +69 -68
  168. package/resources/pod-overrides-airgap.yaml +37 -0
  169. package/specs/MochaHooks.ts +59 -50
  170. package/specs/SmokeTest.spec.ts +43 -36
  171. package/specs/api/ContainerOverridesAPI.spec.ts +33 -26
  172. package/specs/api/DevfileAcceptanceTestAPI.spec.ts +107 -94
  173. package/specs/api/EmptyWorkspaceAPI.spec.ts +62 -57
  174. package/specs/api/PodOverridesAPI.spec.ts +42 -32
  175. package/specs/dashboard-samples/EmptyWorkspace.spec.ts +31 -27
  176. package/specs/dashboard-samples/Quarkus.spec.ts +34 -30
  177. package/specs/dashboard-samples/RecommendedExtensions.spec.ts +192 -170
  178. package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +62 -55
  179. package/specs/factory/Factory.spec.ts +178 -166
  180. package/specs/factory/NoSetupRepoFactory.spec.ts +227 -210
  181. package/specs/factory/RefusedOAuthFactory.spec.ts +219 -203
  182. package/specs/miscellaneous/PredefinedNamespace.spec.ts +64 -50
  183. package/tests-library/LoginTests.ts +34 -32
  184. package/tests-library/ProjectAndFileTests.ts +21 -18
  185. package/tests-library/WorkspaceHandlingTests.ts +98 -108
  186. package/tsconfig.json +15 -15
  187. package/utils/BrowserTabsUtil.ts +104 -98
  188. package/utils/CheReporter.ts +142 -148
  189. package/utils/DevWorkspaceConfigurationHelper.ts +70 -61
  190. package/utils/DevfilesRegistryHelper.ts +67 -58
  191. package/utils/DriverHelper.ts +726 -701
  192. package/utils/KubernetesCommandLineToolsExecutor.ts +196 -172
  193. package/utils/Logger.ts +104 -75
  194. package/utils/ScreenCatcher.ts +59 -48
  195. package/utils/ShellExecutor.ts +19 -11
  196. package/utils/StringUtil.ts +40 -32
  197. package/utils/request-handlers/CheApiRequestHandler.ts +92 -87
  198. package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +32 -21
  199. package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +3 -3
  200. package/utils/workspace/ApiUrlResolver.ts +31 -26
  201. package/utils/workspace/ITestWorkspaceUtil.ts +31 -31
  202. package/utils/workspace/TestWorkspaceUtil.ts +153 -142
  203. package/utils/workspace/WorkspaceStatus.ts +5 -5
  204. package/constants/APITestConstants.ts +0 -56
  205. package/constants/BaseTestConstants.ts +0 -65
  206. package/constants/ChromeDriverConstants.ts +0 -46
  207. package/constants/FactoryTestConstants.ts +0 -51
  208. package/constants/MonacoConstants.ts +0 -22
  209. package/constants/OAuthConstants.ts +0 -57
  210. package/constants/PluginsTestConstants.ts +0 -15
  211. package/constants/ReporterConstants.ts +0 -45
  212. package/constants/TimeoutConstants.ts +0 -113
  213. package/dist/constants/APITestConstants.js.map +0 -1
  214. package/dist/constants/BaseTestConstants.js.map +0 -1
  215. package/dist/constants/ChromeDriverConstants.js.map +0 -1
  216. package/dist/constants/FactoryTestConstants.js.map +0 -1
  217. package/dist/constants/MonacoConstants.js.map +0 -1
  218. package/dist/constants/OAuthConstants.js.map +0 -1
  219. package/dist/constants/PluginsTestConstants.js.map +0 -1
  220. package/dist/constants/ReporterConstants.js.map +0 -1
  221. package/dist/constants/TimeoutConstants.js.map +0 -1
  222. package/tslint.json +0 -126
@@ -1,5 +1,5 @@
1
- /*********************************************************************
2
- * Copyright (c) 2019 Red Hat, Inc.
1
+ /** *******************************************************************
2
+ * copyright (c) 2019 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
@@ -16,7 +16,7 @@ import { CLASSES } from '../../configs/inversify.types';
16
16
  import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
17
17
  import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
18
18
  import { Logger } from '../../utils/Logger';
19
- import { BaseTestConstants } from '../../constants/BaseTestConstants';
19
+ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
20
20
  import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
21
21
 
22
22
  const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
@@ -27,40 +27,44 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti
27
27
  const stackName: string = 'Java 11 with Quarkus';
28
28
  const projectName: string = 'quarkus-quickstarts';
29
29
 
30
- suite(`The ${stackName} userstory`, async function (): Promise<void> {
31
- let projectSection: ViewSection;
30
+ suite(`The ${stackName} userstory`, function (): void {
31
+ let projectSection: ViewSection;
32
32
 
33
- loginTests.loginIntoChe();
33
+ loginTests.loginIntoChe();
34
34
 
35
- workspaceHandlingTests.createAndOpenWorkspace(stackName);
35
+ test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> {
36
+ await workspaceHandlingTests.createAndOpenWorkspace(stackName);
37
+ });
36
38
 
37
- workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
39
+ test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
40
+ await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
41
+ });
38
42
 
39
- test('Register running workspace', async () => {
40
- registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
41
- });
43
+ test('Register running workspace', function (): void {
44
+ registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
45
+ });
42
46
 
43
- test('Wait workspace readiness', async function (): Promise<void> {
44
- await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
45
- });
47
+ test('Wait workspace readiness', async function (): Promise<void> {
48
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
49
+ });
46
50
 
47
- test('Check a project folder has been created', async function (): Promise<void> {
48
- projectSection = await new SideBarView().getContent().getSection(projectName);
49
- Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
50
- });
51
+ test('Check a project folder has been created', async function (): Promise<void> {
52
+ projectSection = await new SideBarView().getContent().getSection(projectName);
53
+ Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
54
+ });
51
55
 
52
- test('Check the project files was imported', async function (): Promise<void> {
53
- await projectSection.findItem(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
54
- Logger.debug(`projectSection.findItem: find ${BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME}`);
55
- });
56
+ test('Check the project files was imported', async function (): Promise<void> {
57
+ await projectSection.findItem(BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
58
+ Logger.debug(`projectSection.findItem: find ${BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME}`);
59
+ });
56
60
 
57
- test('Stop the workspace', async function (): Promise<void> {
58
- await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
59
- await browserTabsUtil.closeAllTabsExceptCurrent();
60
- });
61
+ test('Stop the workspace', async function (): Promise<void> {
62
+ await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
63
+ await browserTabsUtil.closeAllTabsExceptCurrent();
64
+ });
61
65
 
62
- test('Delete the workspace', async function (): Promise<void> {
63
- await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
64
- });
65
- loginTests.logoutFromChe();
66
+ test('Delete the workspace', async function (): Promise<void> {
67
+ await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
68
+ });
69
+ loginTests.logoutFromChe();
66
70
  });
@@ -1,5 +1,5 @@
1
- /*********************************************************************
2
- * Copyright (c) 2019-2023 Red Hat, Inc.
1
+ /** *******************************************************************
2
+ * copyright (c) 2019-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
@@ -9,18 +9,18 @@
9
9
  **********************************************************************/
10
10
 
11
11
  import {
12
- ActivityBar,
13
- ContextMenu,
14
- ContextMenuItem,
15
- EditorView,
16
- ExtensionsViewItem,
17
- ExtensionsViewSection,
18
- Locators,
19
- ModalDialog,
20
- SideBarView,
21
- TextEditor,
22
- ViewItem,
23
- ViewSection
12
+ ActivityBar,
13
+ ContextMenu,
14
+ ContextMenuItem,
15
+ EditorView,
16
+ ExtensionsViewItem,
17
+ ExtensionsViewSection,
18
+ Locators,
19
+ ModalDialog,
20
+ SideBarView,
21
+ TextEditor,
22
+ ViewItem,
23
+ ViewSection
24
24
  } from 'monaco-page-objects';
25
25
  import { registerRunningWorkspace } from '../MochaHooks';
26
26
  import { LoginTests } from '../../tests-library/LoginTests';
@@ -32,10 +32,10 @@ import { Logger } from '../../utils/Logger';
32
32
  import { DriverHelper } from '../../utils/DriverHelper';
33
33
  import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
34
34
  import { expect } from 'chai';
35
- import { TimeoutConstants } from '../../constants/TimeoutConstants';
35
+ import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
36
36
  import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
37
- import { PluginsTestConstants } from '../../constants/PluginsTestConstants';
38
- import { BaseTestConstants } from '../../constants/BaseTestConstants';
37
+ import { PLUGIN_TEST_CONSTANTS } from '../../constants/PLUGIN_TEST_CONSTANTS';
38
+ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
39
39
 
40
40
  const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
41
41
  const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
@@ -43,159 +43,181 @@ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
43
43
  const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
44
44
 
45
45
  const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
46
- const samples: string[] = PluginsTestConstants.TS_SAMPLE_LIST.split(',');
46
+ const samples: string[] = PLUGIN_TEST_CONSTANTS.TS_SAMPLE_LIST.split(',');
47
47
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
48
48
 
49
- suite(`Check if recommended extensions installed for ${samples}`, async function (): Promise<void> {
50
- let projectSection: ViewSection;
51
- let extensionsView: SideBarView | undefined;
52
- let extensionSection: ExtensionsViewSection;
53
-
54
- const extensionsListFileName: string = 'extensions.json';
55
- let recommendedExtensions: any = {
56
- recommendations: []
57
- };
58
-
59
- loginTests.loginIntoChe();
60
-
61
- for (const sample of samples) {
62
- workspaceHandlingTests.createAndOpenWorkspace(sample);
63
- workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
64
-
65
- test('Registering the running workspace', async function (): Promise<void> {
66
- registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
67
- });
68
-
69
- test('Wait workspace readiness', async function (): Promise<void> {
70
- await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
71
- });
72
-
73
- test('Wait until the project will be imported and accept it as trusted one', async function (): Promise<void> {
74
- [projectSection] = await new SideBarView().getContent().getSections();
75
- const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
76
- Logger.debug(`projectSection.findItem: find ${label}`);
77
- const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
78
- expect(isFileImported).not.eqls(undefined);
79
- try {
80
- const buttonYesITrustTheAuthors: string = `Yes, I trust the authors`;
81
- await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.button, TimeoutConstants.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT);
82
- const trustedProjectDialog: ModalDialog = new ModalDialog();
83
- Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
84
- await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
85
- } catch (e) {
86
- Logger.debug(`Welcome modal dialog was not shown: ${e}`);
87
- }
88
- });
89
-
90
- test(`Get recommended extensions list from ${extensionsListFileName}`, async function (): Promise<void> {
91
- Logger.debug(`projectSection.findItem(item))?.select(): expand .vscode folder and open extensions.json.`);
92
- await (await projectSection.findItem('.vscode'))?.select();
93
- // time to expand project tree
94
- await driverHelper.wait(TimeoutConstants.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT);
95
- await (await projectSection.findItem(extensionsListFileName))?.select();
96
- Logger.debug(`EditorView().openEditor(${extensionsListFileName})`);
97
- const editor: TextEditor = await new EditorView().openEditor(extensionsListFileName) as TextEditor;
98
- await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
99
- Logger.debug(`editor.getText(): get recommended extensions as text from editor, delete comments and parse to object.`);
100
- recommendedExtensions = JSON.parse((await editor.getText()).replace(/\/\*[\s\S]*?\*\/|(?<=[^:])\/\/.*|^\/\/.*/g, '').trim());
101
- Logger.debug(`recommendedExtensions.recommendations: Get recommendations clear names using map().`);
102
- recommendedExtensions.recommendations = recommendedExtensions.recommendations.map((r: { split: (arg: string) => [any, any]; }) => {
103
- const [publisher, name] = r.split('.');
104
- return {publisher, name};
105
- });
106
- Logger.info(`Recommended extension for this workspace:\n${JSON.stringify(recommendedExtensions.recommendations)}.`);
107
- });
108
-
109
- test(`Open "Extensions" view section`, async function (): Promise<void> {
110
- Logger.debug(`ActivityBar().getViewControl('Extensions'))?.openView(): open Extensions view.`);
111
- extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
112
- });
113
-
114
- test(`Let extensions complete installation`, async function (): Promise<void> {
115
- Logger.info(`Time for extensions installation TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT=${TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT}`);
116
- await driverHelper.wait(TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT);
117
- });
118
-
119
- test(`Check if extensions are installed and enabled`, async function (): Promise<void> {
120
- this.retries(10);
121
- Logger.debug(`ActivityBar().getViewControl('Extensions'))?.openView(): open Extensions view.`);
122
- extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
123
-
124
- Logger.debug(`extensionsView?.getContent().getSections(): get current section.`);
125
- [extensionSection] = await extensionsView?.getContent().getSections() as ExtensionsViewSection[];
126
- await driverHelper.waitAllPresence(webCheCodeLocators.ExtensionsViewSection.itemTitle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
127
-
128
- for (const extension of recommendedExtensions.recommendations) {
129
- Logger.info(`Check if ${JSON.stringify(extension)} are installed.`);
130
-
131
- Logger.debug(`extensionSection.findItem(${extension.name}).`);
132
- await extensionSection.findItem(extension.name);
133
-
134
- // check if extension require reload the page
135
- if (await driverHelper.isVisible((webCheCodeLocators.ExtensionsViewSection as any).requireReloadButton)) {
136
- Logger.debug(`Extension require reload the editor. Refreshing the page..`);
137
- await browserTabsUtil.refreshPage();
138
- await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
139
- Logger.debug(`ActivityBar().getViewControl('Extensions'))?.openView(): open Extensions view.`);
140
- extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
141
- Logger.debug(`extensionsView?.getContent().getSections(): get current section.`);
142
- [extensionSection] = await extensionsView?.getContent().getSections() as ExtensionsViewSection[];
143
- await driverHelper.waitAllPresence(webCheCodeLocators.ExtensionsViewSection.itemTitle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
144
- Logger.debug(`extensionSection.findItem(${extension.name}).`);
145
- await extensionSection.findItem(extension.name);
146
- }
147
-
148
- Logger.debug(`extensionsView?.getContent().getSections(): switch to marketplace section.`);
149
- const [marketplaceSection]: ExtensionsViewSection[] = await extensionsView?.getContent().getSections() as ExtensionsViewSection[];
150
- await driverHelper.waitVisibility(webCheCodeLocators.ExtensionsViewSection.items, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
151
-
152
- Logger.debug(`marketplaceSection.getVisibleItems(): get all found items.`);
153
- const allFinedItems: ExtensionsViewItem[] = await marketplaceSection.getVisibleItems();
154
-
155
- let itemWithRightNameAndPublisher: ExtensionsViewItem | undefined;
156
- for (const item of allFinedItems) {
157
- Logger.debug(`Try to find extension published by ${extension.publisher}.`);
158
- if (await item.getAuthor() === extension.publisher) {
159
- itemWithRightNameAndPublisher = item;
160
- Logger.debug(`Extension was found: ${await itemWithRightNameAndPublisher?.getTitle()}`);
161
- break;
162
- }
163
- if (itemWithRightNameAndPublisher === undefined) {
164
- Logger.error(`Extension with publisher as ${extension.publisher} was not found.`);
165
- }
166
- }
167
-
168
- Logger.debug(`itemWithRightNameAndPublisher?.isInstalled()`);
169
- const isInstalled: boolean = await itemWithRightNameAndPublisher?.isInstalled() as boolean;
170
-
171
- Logger.debug(`itemWithRightNameAndPublisher?.isInstalled(): ${isInstalled}.`);
172
- expect(isInstalled).eqls(true);
173
-
174
- Logger.debug(`itemWithRightNameAndPublisher.manage(): get context menu.`);
175
- const extensionManageMenu: ContextMenu = await (itemWithRightNameAndPublisher as ExtensionsViewItem).manage();
176
-
177
- Logger.debug(`extensionManageMenu.getItems(): get menu items.`);
178
- const extensionMenuItems: ContextMenuItem[] = await extensionManageMenu.getItems();
179
- let extensionMenuItemLabels: string = '';
180
- for (const item of extensionMenuItems) {
181
- Logger.trace(`extensionMenuItems -> item.getLabel(): get menu items names.`);
182
- extensionMenuItemLabels += (await item.getLabel()) + ' ';
183
- }
184
-
185
- Logger.debug(`extensionMenuItemLabels: ${extensionMenuItemLabels}.`);
186
- expect(extensionMenuItemLabels).contains('Disable').and.not.contains('Enable');
187
- }
188
- });
189
-
190
- test('Stop the workspace', async function (): Promise<void> {
191
- await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
192
- await browserTabsUtil.closeAllTabsExceptCurrent();
193
- });
194
-
195
- test('Delete the workspace', async function (): Promise<void> {
196
- await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
197
- });
198
- }
199
-
200
- loginTests.logoutFromChe();
49
+ suite(`Check if recommended extensions installed for ${samples}`, function (): void {
50
+ let projectSection: ViewSection;
51
+ let extensionsView: SideBarView | undefined;
52
+ let extensionSection: ExtensionsViewSection;
53
+
54
+ const extensionsListFileName: string = 'extensions.json';
55
+ let recommendedExtensions: any = {
56
+ recommendations: []
57
+ };
58
+
59
+ loginTests.loginIntoChe();
60
+
61
+ for (const sample of samples) {
62
+ test(`Create and open new workspace, stack:${sample}`, async function (): Promise<void> {
63
+ await workspaceHandlingTests.createAndOpenWorkspace(sample);
64
+ });
65
+ test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
66
+ await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
67
+ });
68
+
69
+ test('Registering the running workspace', function (): void {
70
+ registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
71
+ });
72
+
73
+ test('Wait workspace readiness', async function (): Promise<void> {
74
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
75
+ });
76
+
77
+ test('Wait until the project will be imported and accept it as trusted one', async function (): Promise<void> {
78
+ [projectSection] = await new SideBarView().getContent().getSections();
79
+ const label: string = BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
80
+ Logger.debug(`projectSection.findItem: find ${label}`);
81
+ const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
82
+ expect(isFileImported).not.eqls(undefined);
83
+ try {
84
+ const buttonYesITrustTheAuthors: string = 'Yes, I trust the authors';
85
+ await driverHelper.waitVisibility(
86
+ webCheCodeLocators.WelcomeContent.button,
87
+ TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
88
+ );
89
+ const trustedProjectDialog: ModalDialog = new ModalDialog();
90
+ Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
91
+ await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
92
+ } catch (e) {
93
+ Logger.debug(`Welcome modal dialog was not shown: ${e}`);
94
+ }
95
+ });
96
+
97
+ test(`Get recommended extensions list from ${extensionsListFileName}`, async function (): Promise<void> {
98
+ Logger.debug('projectSection.findItem(item))?.select(): expand .vscode folder and open extensions.json.');
99
+ await (await projectSection.findItem('.vscode'))?.select();
100
+ // time to expand project tree
101
+ await driverHelper.wait(TIMEOUT_CONSTANTS.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT);
102
+ await (await projectSection.findItem(extensionsListFileName))?.select();
103
+ Logger.debug(`EditorView().openEditor(${extensionsListFileName})`);
104
+ const editor: TextEditor = (await new EditorView().openEditor(extensionsListFileName)) as TextEditor;
105
+ await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
106
+ Logger.debug('editor.getText(): get recommended extensions as text from editor, delete comments and parse to object.');
107
+ recommendedExtensions = JSON.parse((await editor.getText()).replace(/\/\*[\s\S]*?\*\/|(?<=[^:])\/\/.*|^\/\/.*/g, '').trim());
108
+ Logger.debug('recommendedExtensions.recommendations: Get recommendations clear names using map().');
109
+ recommendedExtensions.recommendations = recommendedExtensions.recommendations.map(
110
+ (r: { split: (arg: string) => [any, any] }): { name: any; publisher: any } => {
111
+ const [publisher, name] = r.split('.');
112
+ return { publisher, name };
113
+ }
114
+ );
115
+ Logger.info(`Recommended extension for this workspace:\n${JSON.stringify(recommendedExtensions.recommendations)}.`);
116
+ });
117
+
118
+ test('Open "Extensions" view section', async function (): Promise<void> {
119
+ Logger.debug('ActivityBar().getViewControl("Extensions"))?.openView(): open Extensions view.');
120
+ extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
121
+ });
122
+
123
+ test('Let extensions complete installation', async function (): Promise<void> {
124
+ Logger.info(
125
+ `Time for extensions installation TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT=${TIMEOUT_CONSTANTS.TS_COMMON_PLUGIN_TEST_TIMEOUT}`
126
+ );
127
+ await driverHelper.wait(TIMEOUT_CONSTANTS.TS_COMMON_PLUGIN_TEST_TIMEOUT);
128
+ });
129
+
130
+ test('Check if extensions are installed and enabled', async function (): Promise<void> {
131
+ this.retries(10);
132
+ Logger.debug('ActivityBar().getViewControl("Extensions"))?.openView(): open Extensions view.');
133
+ extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
134
+
135
+ Logger.debug('extensionsView?.getContent().getSections(): get current section.');
136
+ [extensionSection] = (await extensionsView?.getContent().getSections()) as ExtensionsViewSection[];
137
+ await driverHelper.waitAllPresence(
138
+ webCheCodeLocators.ExtensionsViewSection.itemTitle,
139
+ TIMEOUT_CONSTANTS.TS_EDITOR_TAB_INTERACTION_TIMEOUT
140
+ );
141
+
142
+ for (const extension of recommendedExtensions.recommendations) {
143
+ Logger.info(`Check if ${JSON.stringify(extension)} are installed.`);
144
+
145
+ Logger.debug(`extensionSection.findItem(${extension.name}).`);
146
+ await extensionSection.findItem(extension.name);
147
+
148
+ // check if extension require reload the page
149
+ if (await driverHelper.isVisible((webCheCodeLocators.ExtensionsViewSection as any).requireReloadButton)) {
150
+ Logger.debug('Extension require reload the editor. Refreshing the page..');
151
+ await browserTabsUtil.refreshPage();
152
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
153
+ Logger.debug('ActivityBar().getViewControl("Extensions"))?.openView(): open Extensions view.');
154
+ extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
155
+ Logger.debug('extensionsView?.getContent().getSections(): get current section.');
156
+ [extensionSection] = (await extensionsView?.getContent().getSections()) as ExtensionsViewSection[];
157
+ await driverHelper.waitAllPresence(
158
+ webCheCodeLocators.ExtensionsViewSection.itemTitle,
159
+ TIMEOUT_CONSTANTS.TS_EDITOR_TAB_INTERACTION_TIMEOUT
160
+ );
161
+ Logger.debug(`extensionSection.findItem(${extension.name}).`);
162
+ await extensionSection.findItem(extension.name);
163
+ }
164
+
165
+ Logger.debug('extensionsView?.getContent().getSections(): switch to marketplace section.');
166
+ const [marketplaceSection]: ExtensionsViewSection[] = (await extensionsView
167
+ ?.getContent()
168
+ .getSections()) as ExtensionsViewSection[];
169
+ await driverHelper.waitVisibility(
170
+ webCheCodeLocators.ExtensionsViewSection.items,
171
+ TIMEOUT_CONSTANTS.TS_EDITOR_TAB_INTERACTION_TIMEOUT
172
+ );
173
+
174
+ Logger.debug('marketplaceSection.getVisibleItems(): get all found items.');
175
+ const allFinedItems: ExtensionsViewItem[] = await marketplaceSection.getVisibleItems();
176
+
177
+ let itemWithRightNameAndPublisher: ExtensionsViewItem | undefined;
178
+ for (const item of allFinedItems) {
179
+ Logger.debug(`Try to find extension published by ${extension.publisher}.`);
180
+ if ((await item.getAuthor()) === extension.publisher) {
181
+ itemWithRightNameAndPublisher = item;
182
+ Logger.debug(`Extension was found: ${await itemWithRightNameAndPublisher?.getTitle()}`);
183
+ break;
184
+ }
185
+ if (itemWithRightNameAndPublisher === undefined) {
186
+ Logger.error(`Extension with publisher as ${extension.publisher} was not found.`);
187
+ }
188
+ }
189
+
190
+ Logger.debug('itemWithRightNameAndPublisher?.isInstalled()');
191
+ const isInstalled: boolean = (await itemWithRightNameAndPublisher?.isInstalled()) as boolean;
192
+
193
+ Logger.debug(`itemWithRightNameAndPublisher?.isInstalled(): ${isInstalled}.`);
194
+ expect(isInstalled).eqls(true);
195
+
196
+ Logger.debug('itemWithRightNameAndPublisher.manage(): get context menu.');
197
+ const extensionManageMenu: ContextMenu = await (itemWithRightNameAndPublisher as ExtensionsViewItem).manage();
198
+
199
+ Logger.debug('extensionManageMenu.getItems(): get menu items.');
200
+ const extensionMenuItems: ContextMenuItem[] = await extensionManageMenu.getItems();
201
+ let extensionMenuItemLabels: string = '';
202
+ for (const item of extensionMenuItems) {
203
+ Logger.trace('extensionMenuItems -> item.getLabel(): get menu items names.');
204
+ extensionMenuItemLabels += (await item.getLabel()) + ' ';
205
+ }
206
+
207
+ Logger.debug(`extensionMenuItemLabels: ${extensionMenuItemLabels}.`);
208
+ expect(extensionMenuItemLabels).contains('Disable').and.not.contains('Enable');
209
+ }
210
+ });
211
+
212
+ test('Stop the workspace', async function (): Promise<void> {
213
+ await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
214
+ await browserTabsUtil.closeAllTabsExceptCurrent();
215
+ });
216
+
217
+ test('Delete the workspace', async function (): Promise<void> {
218
+ await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
219
+ });
220
+ }
221
+
222
+ loginTests.logoutFromChe();
201
223
  });