@eclipse-che/che-e2e 7.73.0-dev-1397a5e → 7.73.0-dev-ed57855

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