@eclipse-che/che-e2e 7.74.0-dev-1d09cb7 → 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 (221) 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 +13 -9
  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} +12 -12
  25. package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
  26. package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +16 -16
  27. package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
  28. package/dist/constants/{ChromeDriverConstants.js → CHROME_DRIVER_CONSTANTS.js} +13 -13
  29. package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
  30. package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +14 -13
  31. package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
  32. package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +7 -7
  33. package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
  34. package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +14 -14
  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} +12 -12
  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 +11 -11
  47. package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
  48. package/dist/pageobjects/dashboard/Dashboard.js +16 -16
  49. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  50. package/dist/pageobjects/dashboard/Workspaces.js +28 -28
  51. package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
  52. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +36 -25
  53. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
  54. package/dist/pageobjects/git-providers/OauthPage.js +20 -18
  55. package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
  56. package/dist/pageobjects/ide/CheCodeLocatorLoader.js +9 -9
  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 +5 -5
  61. package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
  62. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +5 -5
  63. package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
  64. package/dist/pageobjects/login/openshift/OcpLoginPage.js +13 -13
  65. package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
  66. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +5 -5
  67. package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
  68. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +6 -6
  69. package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
  70. package/dist/pageobjects/login/openshift/RedHatLoginPage.js +5 -5
  71. package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
  72. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +8 -8
  73. package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
  74. package/dist/pageobjects/openshift/OcpApplicationPage.js +5 -5
  75. package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
  76. package/dist/pageobjects/openshift/OcpImportFromGitPage.js +4 -4
  77. package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
  78. package/dist/pageobjects/openshift/OcpMainPage.js +6 -6
  79. package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
  80. package/dist/specs/MochaHooks.js +26 -23
  81. package/dist/specs/MochaHooks.js.map +1 -1
  82. package/dist/specs/SmokeTest.spec.js +11 -11
  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 +26 -15
  87. package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
  88. package/dist/specs/api/EmptyWorkspaceAPI.spec.js +17 -11
  89. package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
  90. package/dist/specs/api/PodOverridesAPI.spec.js +12 -3
  91. package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
  92. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +5 -5
  93. package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
  94. package/dist/specs/dashboard-samples/Quarkus.spec.js +7 -7
  95. package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
  96. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +41 -41
  97. package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
  98. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +14 -9
  99. package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
  100. package/dist/specs/factory/Factory.spec.js +25 -25
  101. package/dist/specs/factory/Factory.spec.js.map +1 -1
  102. package/dist/specs/factory/NoSetupRepoFactory.spec.js +37 -34
  103. package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
  104. package/dist/specs/factory/RefusedOAuthFactory.spec.js +33 -33
  105. package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
  106. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +12 -3
  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 +7 -5
  111. package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
  112. package/dist/tests-library/WorkspaceHandlingTests.js +16 -13
  113. package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
  114. package/dist/utils/BrowserTabsUtil.js +19 -14
  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 +17 -8
  119. package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
  120. package/dist/utils/DevfilesRegistryHelper.js +19 -13
  121. package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
  122. package/dist/utils/DriverHelper.js +64 -66
  123. package/dist/utils/DriverHelper.js.map +1 -1
  124. package/dist/utils/KubernetesCommandLineToolsExecutor.js +28 -24
  125. package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
  126. package/dist/utils/Logger.js +18 -19
  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 +15 -7
  133. package/dist/utils/StringUtil.js.map +1 -1
  134. package/dist/utils/request-handlers/CheApiRequestHandler.js +27 -27
  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 +3 -3
  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 +21 -19
  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 +44 -50
  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 +64 -55
  151. package/pageobjects/dashboard/Dashboard.ts +101 -100
  152. package/pageobjects/dashboard/Workspaces.ts +196 -164
  153. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +150 -125
  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 +31 -30
  159. package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +15 -14
  160. package/pageobjects/login/openshift/OcpLoginPage.ts +61 -54
  161. package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +29 -24
  162. package/pageobjects/login/openshift/OcpUserLoginPage.ts +15 -18
  163. package/pageobjects/login/openshift/RedHatLoginPage.ts +48 -46
  164. package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +38 -34
  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/specs/MochaHooks.ts +59 -50
  169. package/specs/SmokeTest.spec.ts +43 -40
  170. package/specs/api/ContainerOverridesAPI.spec.ts +33 -26
  171. package/specs/api/DevfileAcceptanceTestAPI.spec.ts +106 -95
  172. package/specs/api/EmptyWorkspaceAPI.spec.ts +62 -57
  173. package/specs/api/PodOverridesAPI.spec.ts +42 -33
  174. package/specs/dashboard-samples/EmptyWorkspace.spec.ts +31 -31
  175. package/specs/dashboard-samples/Quarkus.spec.ts +34 -34
  176. package/specs/dashboard-samples/RecommendedExtensions.spec.ts +192 -174
  177. package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +61 -52
  178. package/specs/factory/Factory.spec.ts +178 -168
  179. package/specs/factory/NoSetupRepoFactory.spec.ts +226 -211
  180. package/specs/factory/RefusedOAuthFactory.spec.ts +218 -204
  181. package/specs/miscellaneous/PredefinedNamespace.spec.ts +64 -54
  182. package/tests-library/LoginTests.ts +34 -32
  183. package/tests-library/ProjectAndFileTests.ts +21 -18
  184. package/tests-library/WorkspaceHandlingTests.ts +98 -89
  185. package/tsconfig.json +15 -15
  186. package/utils/BrowserTabsUtil.ts +103 -97
  187. package/utils/CheReporter.ts +141 -145
  188. package/utils/DevWorkspaceConfigurationHelper.ts +70 -61
  189. package/utils/DevfilesRegistryHelper.ts +67 -58
  190. package/utils/DriverHelper.ts +726 -700
  191. package/utils/KubernetesCommandLineToolsExecutor.ts +196 -180
  192. package/utils/Logger.ts +102 -125
  193. package/utils/ScreenCatcher.ts +57 -46
  194. package/utils/ShellExecutor.ts +19 -11
  195. package/utils/StringUtil.ts +40 -32
  196. package/utils/request-handlers/CheApiRequestHandler.ts +91 -88
  197. package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +32 -21
  198. package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +3 -3
  199. package/utils/workspace/ApiUrlResolver.ts +31 -26
  200. package/utils/workspace/ITestWorkspaceUtil.ts +31 -31
  201. package/utils/workspace/TestWorkspaceUtil.ts +152 -145
  202. package/utils/workspace/WorkspaceStatus.ts +5 -5
  203. package/constants/APITestConstants.ts +0 -57
  204. package/constants/BaseTestConstants.ts +0 -68
  205. package/constants/ChromeDriverConstants.ts +0 -46
  206. package/constants/FactoryTestConstants.ts +0 -51
  207. package/constants/MonacoConstants.ts +0 -22
  208. package/constants/OAuthConstants.ts +0 -57
  209. package/constants/PluginsTestConstants.ts +0 -15
  210. package/constants/ReporterConstants.ts +0 -45
  211. package/constants/TimeoutConstants.ts +0 -113
  212. package/dist/constants/APITestConstants.js.map +0 -1
  213. package/dist/constants/BaseTestConstants.js.map +0 -1
  214. package/dist/constants/ChromeDriverConstants.js.map +0 -1
  215. package/dist/constants/FactoryTestConstants.js.map +0 -1
  216. package/dist/constants/MonacoConstants.js.map +0 -1
  217. package/dist/constants/OAuthConstants.js.map +0 -1
  218. package/dist/constants/PluginsTestConstants.js.map +0 -1
  219. package/dist/constants/ReporterConstants.js.map +0 -1
  220. package/dist/constants/TimeoutConstants.js.map +0 -1
  221. package/tslint.json +0 -126
@@ -1,5 +1,5 @@
1
- /*********************************************************************
2
- * Copyright (c) 2021 Red Hat, Inc.
1
+ /** *******************************************************************
2
+ * copyright (c) 2021 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
@@ -11,20 +11,20 @@
11
11
  import 'reflect-metadata';
12
12
  import { e2eContainer } from '../../configs/inversify.config';
13
13
  import {
14
- ActivityBar,
15
- ContextMenu,
16
- EditorView,
17
- error,
18
- InputBox,
19
- Locators,
20
- ModalDialog,
21
- NewScmView,
22
- SideBarView,
23
- SingleScmProvider,
24
- TextEditor,
25
- ViewControl,
26
- ViewItem,
27
- ViewSection
14
+ ActivityBar,
15
+ ContextMenu,
16
+ EditorView,
17
+ error,
18
+ InputBox,
19
+ Locators,
20
+ ModalDialog,
21
+ NewScmView,
22
+ SideBarView,
23
+ SingleScmProvider,
24
+ TextEditor,
25
+ ViewControl,
26
+ ViewItem,
27
+ ViewSection
28
28
  } from 'monaco-page-objects';
29
29
  import { expect } from 'chai';
30
30
  import { registerRunningWorkspace } from '../MochaHooks';
@@ -37,11 +37,11 @@ import { DriverHelper } from '../../utils/DriverHelper';
37
37
  import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
38
38
  import { StringUtil } from '../../utils/StringUtil';
39
39
  import { Logger } from '../../utils/Logger';
40
- import { TimeoutConstants } from '../../constants/TimeoutConstants';
40
+ import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
41
41
  import { LoginTests } from '../../tests-library/LoginTests';
42
- import { OAuthConstants } from '../../constants/OAuthConstants';
43
- import { BaseTestConstants } from '../../constants/BaseTestConstants';
44
- import { FactoryTestConstants, GitProviderType } from '../../constants/FactoryTestConstants';
42
+ import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
43
+ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
44
+ import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
45
45
  import WebDriverError = error.WebDriverError;
46
46
 
47
47
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
@@ -51,212 +51,226 @@ const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocato
51
51
  const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
52
52
  const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
53
53
 
54
- suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access`, async function(): Promise<void> {
55
- const oauthPage: OauthPage = new OauthPage(driverHelper);
54
+ suite(
55
+ `Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access`,
56
+ function (): void {
57
+ const oauthPage: OauthPage = new OauthPage(driverHelper);
56
58
 
57
- let projectSection: ViewSection;
58
- let scmProvider: SingleScmProvider;
59
- let rest: SingleScmProvider[];
60
- let scmContextMenu: ContextMenu;
59
+ let projectSection: ViewSection;
60
+ let scmProvider: SingleScmProvider;
61
+ let scmContextMenu: ContextMenu;
61
62
 
62
- // test specific data
63
- const timeToRefresh: number = 1500;
64
- const changesToCommit: string = (new Date()).getTime().toString();
65
- const fileToChange: string = 'Date.txt';
66
- const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
67
- const refreshButtonLabel: string = 'Refresh';
68
- const pushItemLabel: string = 'Push';
69
- const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
70
- let testRepoProjectName: string;
71
- const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
63
+ // test specific data
64
+ const timeToRefresh: number = 1500;
65
+ const changesToCommit: string = new Date().getTime().toString();
66
+ const fileToChange: string = 'Date.txt';
67
+ const commitChangesButtonLabel: string = `Commit Changes on "${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
68
+ const refreshButtonLabel: string = 'Refresh';
69
+ const pushItemLabel: string = 'Push';
70
+ const label: string = BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
71
+ let testRepoProjectName: string;
72
+ const isPrivateRepo: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
72
73
 
73
- loginTests.loginIntoChe();
74
+ loginTests.loginIntoChe();
74
75
 
75
- test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function(): Promise<void> {
76
- await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
77
- });
76
+ test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
77
+ await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
78
+ });
78
79
 
79
- if (OAuthConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
80
- test(`Authorize with a ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth and deny access`, async function(): Promise<void> {
81
- await oauthPage.login();
82
- await oauthPage.waitOauthPage();
83
- await oauthPage.denyAccess();
84
- });
85
- }
80
+ if (OAUTH_CONSTANTS.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
81
+ test(`Authorize with a ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth and deny access`, async function (): Promise<void> {
82
+ await oauthPage.login();
83
+ await oauthPage.waitOauthPage();
84
+ await oauthPage.denyAccess();
85
+ });
86
+ }
86
87
 
87
- test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
88
- await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
89
- });
88
+ test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
89
+ await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
90
+ });
90
91
 
91
- test('The workspace starts with access deny flag in the url', async function(): Promise<void> {
92
- expect(await driverHelper.getDriver().getCurrentUrl()).contains('&error_code=access_denied');
93
- });
92
+ test('The workspace starts with access deny flag in the url', async function (): Promise<void> {
93
+ expect(await driverHelper.getDriver().getCurrentUrl()).contains('&error_code=access_denied');
94
+ });
94
95
 
95
- test('Registering the running workspace', async function(): Promise<void> {
96
- registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
97
- });
96
+ test('Registering the running workspace', function (): void {
97
+ registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
98
+ });
98
99
 
99
- test('Wait the workspace readiness', async function(): Promise<void> {
100
- await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
101
- });
100
+ test('Wait the workspace readiness', async function (): Promise<void> {
101
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
102
+ });
102
103
 
103
- test('Check if a project folder has been created', async function(): Promise<void> {
104
- testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
105
- Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
106
- projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
107
- });
104
+ test('Check if a project folder has been created', async function (): Promise<void> {
105
+ testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL);
106
+ Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
107
+ projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
108
+ });
108
109
 
109
- test('Accept the project as a trusted one', async function(): Promise<void> {
110
- // click somewhere to trigger "Welcome Content" dialog
111
- try {
112
- await driverHelper.waitAndClick(webCheCodeLocators.Workbench.notificationItem);
113
- } catch (e) {
114
- Logger.info(`Click on ${webCheCodeLocators.Workbench.notificationItem} to get "Welcome Content" dialog ${e as string}`);
115
- }
116
- // "Welcome Content" dialog can be shown before of after dialog with an error for private repo
117
- try {
118
- const buttonYesITrustTheAuthors: string = `Yes, I trust the authors`;
119
- await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.text, TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
120
- const welcomeContentDialog: ModalDialog = new ModalDialog();
121
- Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
122
- await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
123
- await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
124
- } catch (e) {
125
- Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
126
- if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
127
- throw new WebDriverError(e as string);
128
- }
129
- }
130
- });
110
+ test('Accept the project as a trusted one', async function (): Promise<void> {
111
+ // click somewhere to trigger "Welcome Content" dialog
112
+ try {
113
+ await driverHelper.waitAndClick(webCheCodeLocators.Workbench.notificationItem);
114
+ } catch (e) {
115
+ Logger.info(`Click on ${webCheCodeLocators.Workbench.notificationItem} to get "Welcome Content" dialog ${e as string}`);
116
+ }
117
+ // "Welcome Content" dialog can be shown before of after dialog with an error for private repo
118
+ try {
119
+ const buttonYesITrustTheAuthors: string = 'Yes, I trust the authors';
120
+ await driverHelper.waitVisibility(
121
+ webCheCodeLocators.WelcomeContent.text,
122
+ TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM
123
+ );
124
+ const welcomeContentDialog: ModalDialog = new ModalDialog();
125
+ Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
126
+ await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
127
+ await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
128
+ } catch (e) {
129
+ Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
130
+ if (!FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
131
+ throw new WebDriverError(e as string);
132
+ }
133
+ }
134
+ });
131
135
 
132
- if (FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
133
- test('Check that project can not be cloned', async function(): Promise<void> {
134
- await driverHelper.waitVisibility(webCheCodeLocators.Dialog.message);
135
- const workspaceDoesNotExistDialog: ModalDialog = new ModalDialog();
136
- const message: string = await workspaceDoesNotExistDialog.getMessage();
137
- expect(message).contains('space does not exist');
138
- });
136
+ if (FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
137
+ test('Check that project can not be cloned', async function (): Promise<void> {
138
+ await driverHelper.waitVisibility(webCheCodeLocators.Dialog.message);
139
+ const workspaceDoesNotExistDialog: ModalDialog = new ModalDialog();
140
+ const message: string = await workspaceDoesNotExistDialog.getMessage();
141
+ expect(message).contains('space does not exist');
142
+ });
139
143
 
140
- test('Check that project files were not imported', async function(): Promise<void> {
141
- const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
142
- expect(isFileImported).eqls(undefined);
143
- });
144
+ test('Check that project files were not imported', async function (): Promise<void> {
145
+ const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
146
+ expect(isFileImported).eqls(undefined);
147
+ });
148
+ } else {
149
+ test('Check if the project files were imported', async function (): Promise<void> {
150
+ Logger.debug(`projectSection.findItem: find ${label}`);
151
+ const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
152
+ // projectSection.findItem(label) can return undefined but test will goes on
153
+ expect(isFileImported).not.eqls(undefined);
154
+ });
144
155
 
145
- } else {
146
- test('Check if the project files were imported', async function(): Promise<void> {
147
- Logger.debug(`projectSection.findItem: find ${label}`);
148
- const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
149
- // projectSection.findItem(label) can return undefined but test will goes on
150
- expect(isFileImported).not.eqls(undefined);
151
- });
156
+ test('Make changes to the file', async function (): Promise<void> {
157
+ Logger.debug(`projectSection.openItem: "${fileToChange}"`);
158
+ await projectSection.openItem(fileToChange);
159
+ const editor: TextEditor = (await new EditorView().openEditor(fileToChange)) as TextEditor;
160
+ await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
161
+ Logger.debug('editor.clearText');
162
+ await editor.clearText();
163
+ Logger.debug(`editor.typeTextAt: "${changesToCommit}"`);
164
+ await editor.typeTextAt(1, 1, changesToCommit);
165
+ });
152
166
 
153
- test('Make changes to the file', async function(): Promise<void> {
154
- Logger.debug(`projectSection.openItem: "${fileToChange}"`);
155
- await projectSection.openItem(fileToChange);
156
- const editor: TextEditor = await new EditorView().openEditor(fileToChange) as TextEditor;
157
- await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
158
- Logger.debug(`editor.clearText`);
159
- await editor.clearText();
160
- Logger.debug(`editor.typeTextAt: "${changesToCommit}"`);
161
- await editor.typeTextAt(1, 1, changesToCommit);
162
- });
167
+ test('Open a source control manager', async function (): Promise<void> {
168
+ const viewSourceControl: string = 'Source Control';
169
+ const sourceControl: ViewControl = (await new ActivityBar().getViewControl(viewSourceControl)) as ViewControl;
170
+ Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
171
+ await sourceControl.openView();
172
+ const scmView: NewScmView = new NewScmView();
173
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
174
+ let rest: SingleScmProvider[];
175
+ [scmProvider, ...rest] = await scmView.getProviders();
176
+ Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);
177
+ });
163
178
 
164
- test('Open a source control manager', async function(): Promise<void> {
165
- const viewSourceControl: string = `Source Control`;
166
- const sourceControl: ViewControl = await new ActivityBar().getViewControl(viewSourceControl) as ViewControl;
167
- Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
168
- await sourceControl.openView();
169
- const scmView: NewScmView = new NewScmView();
170
- await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
171
- [scmProvider, ...rest] = await scmView.getProviders();
172
- Logger.debug(`scmView.getProviders: "${scmProvider}, ${scmProvider}"`);
173
- });
179
+ test('Check if the changes are displayed in the source control manager', async function (): Promise<void> {
180
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
181
+ await driverHelper.wait(timeToRefresh);
182
+ Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
183
+ await scmProvider.takeAction(refreshButtonLabel);
184
+ // wait while changes counter will be refreshed
185
+ await driverHelper.wait(timeToRefresh);
186
+ const changes: number = await scmProvider.getChangeCount();
187
+ Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
188
+ expect(changes).eql(1);
189
+ });
174
190
 
175
- test('Check if the changes are displayed in the source control manager', async function(): Promise<void> {
176
- await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
177
- await driverHelper.wait(timeToRefresh);
178
- Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
179
- await scmProvider.takeAction(refreshButtonLabel);
180
- // wait while changes counter will be refreshed
181
- await driverHelper.wait(timeToRefresh);
182
- const changes: number = await scmProvider.getChangeCount();
183
- Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
184
- expect(changes).eql(1);
185
- });
191
+ test('Stage the changes', async function (): Promise<void> {
192
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
193
+ Logger.debug('scmProvider.openMoreActions');
194
+ scmContextMenu = await scmProvider.openMoreActions();
195
+ await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.contextView);
196
+ Logger.debug('scmContextMenu.select: "Changes" -> "Stage All Changes"');
197
+ await scmContextMenu.select('Changes', 'Stage All Changes');
198
+ });
186
199
 
187
- test('Stage the changes', async function(): Promise<void> {
188
- await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
189
- Logger.debug(`scmProvider.openMoreActions`);
190
- scmContextMenu = await scmProvider.openMoreActions();
191
- await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.contextView);
192
- Logger.debug(`scmContextMenu.select: "Changes" -> "Stage All Changes"`);
193
- await scmContextMenu.select('Changes', 'Stage All Changes');
194
- });
200
+ test('Commit the changes', async function (): Promise<void> {
201
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
202
+ Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
203
+ await scmProvider.commitChanges('Commit ' + changesToCommit);
204
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
205
+ await driverHelper.wait(timeToRefresh);
206
+ Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
207
+ await scmProvider.takeAction(refreshButtonLabel);
208
+ // wait while changes counter will be refreshed
209
+ await driverHelper.wait(timeToRefresh);
210
+ const changes: number = await scmProvider.getChangeCount();
211
+ Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
212
+ expect(changes).eql(0);
213
+ });
195
214
 
196
- test('Commit the changes', async function(): Promise<void> {
197
- await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
198
- Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
199
- await scmProvider.commitChanges('Commit ' + changesToCommit);
200
- await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
201
- await driverHelper.wait(timeToRefresh);
202
- Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
203
- await scmProvider.takeAction(refreshButtonLabel);
204
- // wait while changes counter will be refreshed
205
- await driverHelper.wait(timeToRefresh);
206
- const changes: number = await scmProvider.getChangeCount();
207
- Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
208
- expect(changes).eql(0);
209
- });
215
+ test('Push the changes', async function (): Promise<void> {
216
+ await driverHelper.waitVisibility(
217
+ webCheCodeLocators.ScmView.actionConstructor(
218
+ `Push 1 commits to origin/${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`
219
+ )
220
+ );
221
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
222
+ Logger.debug('scmProvider.openMoreActions');
223
+ scmContextMenu = await scmProvider.openMoreActions();
224
+ await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.itemConstructor(pushItemLabel));
225
+ Logger.debug(`scmContextMenu.select: "${pushItemLabel}"`);
226
+ await scmContextMenu.select(pushItemLabel);
227
+ });
210
228
 
211
- test('Push the changes', async function(): Promise<void> {
212
- await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
213
- await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
214
- Logger.debug(`scmProvider.openMoreActions`);
215
- scmContextMenu = await scmProvider.openMoreActions();
216
- await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.itemConstructor(pushItemLabel));
217
- Logger.debug(`scmContextMenu.select: "${pushItemLabel}"`);
218
- await scmContextMenu.select(pushItemLabel);
219
- });
220
-
221
- test('Insert git credentials which were asked after push', async function(): Promise<void> {
222
- try {
223
- await driverHelper.waitVisibility(webCheCodeLocators.InputBox.message);
224
- } catch (e) {
225
- Logger.info(`Workspace did not ask credentials before push - ${e};
229
+ test('Insert git credentials which were asked after push', async function (): Promise<void> {
230
+ try {
231
+ await driverHelper.waitVisibility(webCheCodeLocators.InputBox.message);
232
+ } catch (e) {
233
+ Logger.info(`Workspace did not ask credentials before push - ${e};
226
234
  Known issue for github.com - https://issues.redhat.com/browse/CRW-4066, please check if not other git provider. `);
227
- expect(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER).eqls(GitProviderType.GITHUB);
228
- }
229
- const input: InputBox = new InputBox();
230
- await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
231
- await input.confirm();
232
- await driverHelper.wait(timeToRefresh);
233
- await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
234
- await input.confirm();
235
- await driverHelper.wait(timeToRefresh);
236
- });
235
+ expect(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER).eqls(GitProviderType.GITHUB);
236
+ }
237
+ const input: InputBox = new InputBox();
238
+ await input.setText(OAUTH_CONSTANTS.TS_SELENIUM_GIT_PROVIDER_USERNAME);
239
+ await input.confirm();
240
+ await driverHelper.wait(timeToRefresh);
241
+ await input.setText(OAUTH_CONSTANTS.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
242
+ await input.confirm();
243
+ await driverHelper.wait(timeToRefresh);
244
+ });
237
245
 
238
- test('Check if the changes were pushed', async function(): Promise<void> {
239
- try {
240
- Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
241
- await scmProvider.takeAction(refreshButtonLabel);
242
- } catch (e) {
243
- Logger.info('Check you use correct credentials.' +
244
- 'For bitbucket.org ensure you use an app password: https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/;' +
245
- 'For github.com - personal access token instead of password.');
246
- }
247
- const isCommitButtonDisabled: string = await driverHelper.waitAndGetElementAttribute(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel), 'aria-disabled');
248
- expect(isCommitButtonDisabled).eql('true');
249
- });
250
- }
246
+ test('Check if the changes were pushed', async function (): Promise<void> {
247
+ try {
248
+ Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
249
+ await scmProvider.takeAction(refreshButtonLabel);
250
+ } catch (e) {
251
+ Logger.info(
252
+ 'Check you use correct credentials.' +
253
+ 'For bitbucket.org ensure you use an app password: https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/;' +
254
+ 'For github.com - personal access token instead of password.'
255
+ );
256
+ }
257
+ const isCommitButtonDisabled: string = await driverHelper.waitAndGetElementAttribute(
258
+ webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel),
259
+ 'aria-disabled'
260
+ );
261
+ expect(isCommitButtonDisabled).eql('true');
262
+ });
263
+ }
251
264
 
252
- test('Stop the workspace', async function(): Promise<void> {
253
- await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
254
- await browserTabsUtil.closeAllTabsExceptCurrent();
255
- });
265
+ test('Stop the workspace', async function (): Promise<void> {
266
+ await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
267
+ await browserTabsUtil.closeAllTabsExceptCurrent();
268
+ });
256
269
 
257
- test('Delete the workspace', async function(): Promise<void> {
258
- await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
259
- });
270
+ test('Delete the workspace', async function (): Promise<void> {
271
+ await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
272
+ });
260
273
 
261
- loginTests.logoutFromChe();
262
- });
274
+ loginTests.logoutFromChe();
275
+ }
276
+ );
@@ -1,3 +1,12 @@
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 { e2eContainer } from '../../configs/inversify.config';
2
11
  import { assert } from 'chai';
3
12
  import { CLASSES } from '../../configs/inversify.types';
@@ -13,66 +22,67 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
13
22
  const predefinedNamespaceName: string = 'predefined-ns';
14
23
 
15
24
  async function runShellScript(shellCommandToExecution: string): Promise<string> {
16
- const { stdout, stderr } = await exec(shellCommandToExecution);
17
- console.log(stdout);
18
- console.error(stderr);
19
- return stdout;
25
+ const { stdout, stderr } = await exec(shellCommandToExecution);
26
+ console.log(stdout);
27
+ console.error(stderr);
28
+ return stdout;
20
29
  }
21
30
 
22
- suite(`Create predefined workspace and check it `, async function(): Promise<void> {
23
- let workspaceName: string = '';
31
+ suite('Create predefined workspace and check it ', function (): void {
32
+ let workspaceName: string = '';
24
33
 
25
- const setEditRightsForUser: string = `oc adm policy add-role-to-user edit user -n ${predefinedNamespaceName}`;
26
- const getDevWorkspaceFromPredefinedNameSpace: string = `oc get dw -n ${predefinedNamespaceName}`;
27
- const deletePredefinedNamespace: string = `oc delete project ${predefinedNamespaceName}`;
28
- const createPredefinedProjectCommand: string = 'cat <<EOF | oc apply -f - \n' +
29
- 'kind: Namespace\n' +
30
- 'apiVersion: v1\n' +
31
- 'metadata:\n' +
32
- ` name: ${predefinedNamespaceName}\n` +
33
- ' labels:\n' +
34
- ' app.kubernetes.io/part-of: che.eclipse.org\n' +
35
- ' app.kubernetes.io/component: workspaces-namespace\n' +
36
- ' annotations:\n' +
37
- ' che.eclipse.org/username: user\n' +
38
- 'EOF';
39
- // create a predefined namespace for user using shell script and login into user dashboard
40
- suiteSetup(async function(): Promise<void> {
41
- Logger.info('Test prerequisites:');
42
- Logger.info(' (1) there is OCP user with username and user password that have been set in the TS_SELENIUM_OCP_USERNAME and TS_SELENIUM_OCP_PASSWORD variables');
43
- Logger.info(' (2) \'oc\' client installed and logged into test OCP cluster with admin rights.');
34
+ const setEditRightsForUser: string = `oc adm policy add-role-to-user edit user -n ${predefinedNamespaceName}`;
35
+ const getDevWorkspaceFromPredefinedNameSpace: string = `oc get dw -n ${predefinedNamespaceName}`;
36
+ const deletePredefinedNamespace: string = `oc delete project ${predefinedNamespaceName}`;
37
+ const createPredefinedProjectCommand: string =
38
+ 'cat <<EOF | oc apply -f - \n' +
39
+ 'kind: Namespace\n' +
40
+ 'apiVersion: v1\n' +
41
+ 'metadata:\n' +
42
+ ` name: ${predefinedNamespaceName}\n` +
43
+ ' labels:\n' +
44
+ ' app.kubernetes.io/part-of: che.eclipse.org\n' +
45
+ ' app.kubernetes.io/component: workspaces-namespace\n' +
46
+ ' annotations:\n' +
47
+ ' che.eclipse.org/username: user\n' +
48
+ 'EOF';
49
+ // create a predefined namespace for user using shell script and login into user dashboard
50
+ suiteSetup(async function (): Promise<void> {
51
+ Logger.info('Test prerequisites:');
52
+ Logger.info(
53
+ ' (1) there is OCP user with username and user password that have been set in the TS_SELENIUM_OCP_USERNAME and TS_SELENIUM_OCP_PASSWORD variables'
54
+ );
55
+ Logger.info(' (2) "oc" client installed and logged into test OCP cluster with admin rights.');
44
56
 
45
- await runShellScript(createPredefinedProjectCommand);
46
- await runShellScript(setEditRightsForUser);
47
- });
57
+ await runShellScript(createPredefinedProjectCommand);
58
+ await runShellScript(setEditRightsForUser);
59
+ });
48
60
 
49
- suiteTeardown(async (): Promise<void> => {
50
- const workspaceName: string = WorkspaceHandlingTests.getWorkspaceName();
51
- try {
52
- await runShellScript(deletePredefinedNamespace);
53
- } catch (e) {
54
- Logger.error(`Cannot remove the predefined project: ${workspaceName}, please fix it manually: ${e}`);
55
- }
56
- });
61
+ suiteTeardown(async (): Promise<void> => {
62
+ const workspaceName: string = WorkspaceHandlingTests.getWorkspaceName();
63
+ try {
64
+ await runShellScript(deletePredefinedNamespace);
65
+ } catch (e) {
66
+ Logger.error(`Cannot remove the predefined project: ${workspaceName}, please fix it manually: ${e}`);
67
+ }
68
+ });
57
69
 
58
- loginTests.loginIntoChe();
59
- // create the Empty workspace using CHE Dashboard
60
- test(`Create and open new workspace, stack:${'Empty Workspace'}`, async function(): Promise<void> {
61
- await workspaceHandlingTests.createAndOpenWorkspace('Empty Workspace');
62
- });
63
- test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
64
- await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
65
- });
70
+ loginTests.loginIntoChe();
71
+ // create the Empty workspace using CHE Dashboard
72
+ test(`Create and open new workspace, stack:${'Empty Workspace'}`, async function (): Promise<void> {
73
+ await workspaceHandlingTests.createAndOpenWorkspace('Empty Workspace');
74
+ });
75
+ test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
76
+ await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
77
+ });
66
78
 
67
- // verify that just created workspace with unique name is present in the predefined namespace
68
- test('Validate the created workspace is present in predefined namespace', async function(): Promise<void> {
69
- workspaceName = WorkspaceHandlingTests.getWorkspaceName();
70
- registerRunningWorkspace(workspaceName);
71
- const ocDevWorkspaceOutput: string = await runShellScript(getDevWorkspaceFromPredefinedNameSpace);
72
- await assert.isTrue(ocDevWorkspaceOutput.includes(workspaceName));
73
- });
79
+ // verify that just created workspace with unique name is present in the predefined namespace
80
+ test('Validate the created workspace is present in predefined namespace', async function (): Promise<void> {
81
+ workspaceName = WorkspaceHandlingTests.getWorkspaceName();
82
+ registerRunningWorkspace(workspaceName);
83
+ const ocDevWorkspaceOutput: string = await runShellScript(getDevWorkspaceFromPredefinedNameSpace);
84
+ assert.isTrue(ocDevWorkspaceOutput.includes(workspaceName));
85
+ });
74
86
 
75
- loginTests.logoutFromChe();
87
+ loginTests.logoutFromChe();
76
88
  });
77
-
78
-