@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.
- package/.eslintignore +10 -0
- package/.eslintrc.js +183 -0
- package/.prettierignore +10 -0
- package/.prettierrc.json +10 -0
- package/README.md +47 -47
- package/configs/inversify.config.ts +13 -9
- package/configs/inversify.types.ts +29 -29
- package/configs/mocharc.ts +21 -24
- package/constants/API_TEST_CONSTANTS.ts +67 -0
- package/constants/BASE_TEST_CONSTANTS.ts +80 -0
- package/constants/CHROME_DRIVER_CONSTANTS.ts +54 -0
- package/constants/FACTORY_TEST_CONSTANTS.ts +61 -0
- package/constants/MONACO_CONSTANTS.ts +25 -0
- package/constants/OAUTH_CONSTANTS.ts +67 -0
- package/constants/PLUGIN_TEST_CONSTANTS.ts +15 -0
- package/constants/REPORTER_CONSTANTS.ts +53 -0
- package/constants/TIMEOUT_CONSTANTS.ts +131 -0
- package/dist/configs/inversify.config.js +14 -8
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +2 -2
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +13 -16
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/{APITestConstants.js → API_TEST_CONSTANTS.js} +12 -12
- package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +16 -16
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{ChromeDriverConstants.js → CHROME_DRIVER_CONSTANTS.js} +13 -13
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
- package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +14 -13
- package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +7 -7
- package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
- package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +14 -14
- package/dist/constants/OAUTH_CONSTANTS.js.map +1 -0
- package/dist/constants/{PluginsTestConstants.js → PLUGIN_TEST_CONSTANTS.js} +7 -7
- package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{ReporterConstants.js → REPORTER_CONSTANTS.js} +12 -12
- package/dist/constants/REPORTER_CONSTANTS.js.map +1 -0
- package/dist/constants/{TimeoutConstants.js → TIMEOUT_CONSTANTS.js} +24 -24
- package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -0
- package/dist/driver/ChromeDriver.js +12 -16
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +11 -11
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +16 -16
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +28 -28
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +36 -25
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +20 -18
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +9 -9
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js +2 -2
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js +2 -2
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +5 -5
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +5 -5
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +13 -13
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +5 -5
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +6 -6
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +5 -5
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +8 -8
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +5 -5
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +4 -4
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +6 -6
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +26 -23
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +11 -11
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js +10 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +26 -15
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +17 -11
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +12 -3
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +5 -5
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +7 -7
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +41 -41
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +14 -9
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +25 -25
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +37 -34
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +33 -33
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +12 -3
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +7 -7
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +7 -5
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +16 -13
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +19 -14
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +44 -44
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +17 -8
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +19 -13
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +64 -66
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +28 -24
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +18 -19
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js +18 -12
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js +9 -0
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +15 -7
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +27 -27
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +10 -6
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js +2 -2
- package/dist/utils/workspace/ApiUrlResolver.js +3 -3
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/ITestWorkspaceUtil.js +2 -2
- package/dist/utils/workspace/TestWorkspaceUtil.js +21 -19
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js +2 -2
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/ChromeDriver.ts +44 -50
- package/driver/IDriver.ts +3 -3
- package/index.ts +9 -9
- package/package.json +59 -49
- package/pageobjects/dashboard/CreateWorkspace.ts +64 -55
- package/pageobjects/dashboard/Dashboard.ts +101 -100
- package/pageobjects/dashboard/Workspaces.ts +196 -164
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +150 -125
- package/pageobjects/git-providers/OauthPage.ts +177 -166
- package/pageobjects/ide/CheCodeLocatorLoader.ts +49 -46
- package/pageobjects/login/interfaces/ICheLoginPage.ts +3 -3
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +3 -3
- package/pageobjects/login/kubernetes/DexLoginPage.ts +31 -30
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +15 -14
- package/pageobjects/login/openshift/OcpLoginPage.ts +61 -54
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +29 -24
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +15 -18
- package/pageobjects/login/openshift/RedHatLoginPage.ts +48 -46
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +38 -34
- package/pageobjects/openshift/OcpApplicationPage.ts +21 -20
- package/pageobjects/openshift/OcpImportFromGitPage.ts +70 -68
- package/pageobjects/openshift/OcpMainPage.ts +69 -68
- package/specs/MochaHooks.ts +59 -50
- package/specs/SmokeTest.spec.ts +43 -40
- package/specs/api/ContainerOverridesAPI.spec.ts +33 -26
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +106 -95
- package/specs/api/EmptyWorkspaceAPI.spec.ts +62 -57
- package/specs/api/PodOverridesAPI.spec.ts +42 -33
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +31 -31
- package/specs/dashboard-samples/Quarkus.spec.ts +34 -34
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +192 -174
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +61 -52
- package/specs/factory/Factory.spec.ts +178 -168
- package/specs/factory/NoSetupRepoFactory.spec.ts +226 -211
- package/specs/factory/RefusedOAuthFactory.spec.ts +218 -204
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +64 -54
- package/tests-library/LoginTests.ts +34 -32
- package/tests-library/ProjectAndFileTests.ts +21 -18
- package/tests-library/WorkspaceHandlingTests.ts +98 -89
- package/tsconfig.json +15 -15
- package/utils/BrowserTabsUtil.ts +103 -97
- package/utils/CheReporter.ts +141 -145
- package/utils/DevWorkspaceConfigurationHelper.ts +70 -61
- package/utils/DevfilesRegistryHelper.ts +67 -58
- package/utils/DriverHelper.ts +726 -700
- package/utils/KubernetesCommandLineToolsExecutor.ts +196 -180
- package/utils/Logger.ts +102 -125
- package/utils/ScreenCatcher.ts +57 -46
- package/utils/ShellExecutor.ts +19 -11
- package/utils/StringUtil.ts +40 -32
- package/utils/request-handlers/CheApiRequestHandler.ts +91 -88
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +32 -21
- package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +3 -3
- package/utils/workspace/ApiUrlResolver.ts +31 -26
- package/utils/workspace/ITestWorkspaceUtil.ts +31 -31
- package/utils/workspace/TestWorkspaceUtil.ts +152 -145
- package/utils/workspace/WorkspaceStatus.ts +5 -5
- package/constants/APITestConstants.ts +0 -57
- package/constants/BaseTestConstants.ts +0 -68
- package/constants/ChromeDriverConstants.ts +0 -46
- package/constants/FactoryTestConstants.ts +0 -51
- package/constants/MonacoConstants.ts +0 -22
- package/constants/OAuthConstants.ts +0 -57
- package/constants/PluginsTestConstants.ts +0 -15
- package/constants/ReporterConstants.ts +0 -45
- package/constants/TimeoutConstants.ts +0 -113
- package/dist/constants/APITestConstants.js.map +0 -1
- package/dist/constants/BaseTestConstants.js.map +0 -1
- package/dist/constants/ChromeDriverConstants.js.map +0 -1
- package/dist/constants/FactoryTestConstants.js.map +0 -1
- package/dist/constants/MonacoConstants.js.map +0 -1
- package/dist/constants/OAuthConstants.js.map +0 -1
- package/dist/constants/PluginsTestConstants.js.map +0 -1
- package/dist/constants/ReporterConstants.js.map +0 -1
- package/dist/constants/TimeoutConstants.js.map +0 -1
- package/tslint.json +0 -126
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
*
|
|
2
|
+
/** *******************************************************************
|
|
3
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
4
4
|
*
|
|
5
5
|
* This program and the accompanying materials are made
|
|
6
6
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -35,14 +35,14 @@ const inversify_types_1 = require("../../configs/inversify.types");
|
|
|
35
35
|
const Logger_1 = require("../Logger");
|
|
36
36
|
const axios_1 = __importDefault(require("axios"));
|
|
37
37
|
const ApiUrlResolver_1 = require("./ApiUrlResolver");
|
|
38
|
-
const
|
|
38
|
+
const TIMEOUT_CONSTANTS_1 = require("../../constants/TIMEOUT_CONSTANTS");
|
|
39
39
|
let TestWorkspaceUtil = class TestWorkspaceUtil {
|
|
40
40
|
constructor(driverHelper, processRequestHandler, apiUrlResolver) {
|
|
41
41
|
this.driverHelper = driverHelper;
|
|
42
42
|
this.processRequestHandler = processRequestHandler;
|
|
43
43
|
this.apiUrlResolver = apiUrlResolver;
|
|
44
|
-
this.polling =
|
|
45
|
-
this.attempts =
|
|
44
|
+
this.polling = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
|
|
45
|
+
this.attempts = TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_DASHBOARD_WORKSPACE_STOP_TIMEOUT / this.polling;
|
|
46
46
|
}
|
|
47
47
|
async waitWorkspaceStatus(workspaceName, expectedWorkspaceStatus) {
|
|
48
48
|
Logger_1.Logger.debug();
|
|
@@ -61,7 +61,7 @@ let TestWorkspaceUtil = class TestWorkspaceUtil {
|
|
|
61
61
|
await this.driverHelper.wait(this.polling);
|
|
62
62
|
}
|
|
63
63
|
if (!expectedStatus) {
|
|
64
|
-
|
|
64
|
+
const waitTime = this.attempts * this.polling;
|
|
65
65
|
throw new selenium_webdriver_1.error.TimeoutError(`The workspace was not stopped in ${waitTime} ms. Current status is: ${workspaceStatus}`);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -70,11 +70,13 @@ let TestWorkspaceUtil = class TestWorkspaceUtil {
|
|
|
70
70
|
const stopWorkspaceApiUrl = await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName);
|
|
71
71
|
let stopWorkspaceResponse;
|
|
72
72
|
try {
|
|
73
|
-
stopWorkspaceResponse = await this.processRequestHandler.patch(stopWorkspaceApiUrl, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
'
|
|
77
|
-
|
|
73
|
+
stopWorkspaceResponse = await this.processRequestHandler.patch(stopWorkspaceApiUrl, [
|
|
74
|
+
{
|
|
75
|
+
op: 'replace',
|
|
76
|
+
path: '/spec/started',
|
|
77
|
+
value: false
|
|
78
|
+
}
|
|
79
|
+
]);
|
|
78
80
|
}
|
|
79
81
|
catch (err) {
|
|
80
82
|
Logger_1.Logger.error(`stop workspace call failed. URL used: ${stopWorkspaceApiUrl}`);
|
|
@@ -120,7 +122,7 @@ let TestWorkspaceUtil = class TestWorkspaceUtil {
|
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
124
|
if (!deleteWorkspaceStatus) {
|
|
123
|
-
|
|
125
|
+
const waitTime = this.attempts * this.polling;
|
|
124
126
|
throw new selenium_webdriver_1.error.TimeoutError(`The workspace was not deleted in ${waitTime} ms.`);
|
|
125
127
|
}
|
|
126
128
|
}
|
|
@@ -131,19 +133,19 @@ let TestWorkspaceUtil = class TestWorkspaceUtil {
|
|
|
131
133
|
await this.deleteWorkspaceByName(workspaceName);
|
|
132
134
|
}
|
|
133
135
|
// stop all run workspaces in the namespace
|
|
134
|
-
async stopAllRunningWorkspaces(
|
|
136
|
+
async stopAllRunningWorkspaces() {
|
|
135
137
|
Logger_1.Logger.debug();
|
|
136
|
-
|
|
138
|
+
const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
137
139
|
for (let i = 0; i < response.data.items.length; i++) {
|
|
138
140
|
Logger_1.Logger.info('the project is being stopped: ' + response.data.items[i].metadata.name);
|
|
139
141
|
await this.stopWorkspaceByName(response.data.items[i].metadata.name);
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
144
|
// stop all run workspaces, check statuses and remove the workspaces
|
|
143
|
-
async stopAndDeleteAllRunningWorkspaces(
|
|
145
|
+
async stopAndDeleteAllRunningWorkspaces() {
|
|
144
146
|
Logger_1.Logger.debug();
|
|
145
|
-
|
|
146
|
-
await this.stopAllRunningWorkspaces(
|
|
147
|
+
const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
148
|
+
await this.stopAllRunningWorkspaces();
|
|
147
149
|
for (let i = 0; i < response.data.items.length; i++) {
|
|
148
150
|
Logger_1.Logger.info('the project is being deleted: ' + response.data.items[i].metadata.name);
|
|
149
151
|
await this.deleteWorkspaceByName(response.data.items[i].metadata.name);
|
|
@@ -151,9 +153,9 @@ let TestWorkspaceUtil = class TestWorkspaceUtil {
|
|
|
151
153
|
}
|
|
152
154
|
// stop all run workspaces without stopping and waiting for of 'Stopped' phase
|
|
153
155
|
// similar with 'force' deleting
|
|
154
|
-
async deleteAllWorkspaces(
|
|
156
|
+
async deleteAllWorkspaces() {
|
|
155
157
|
Logger_1.Logger.debug();
|
|
156
|
-
|
|
158
|
+
const response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
157
159
|
for (let i = 0; i < response.data.items.length; i++) {
|
|
158
160
|
Logger_1.Logger.info('the project is being deleted .......: ' + response.data.items[i].metadata.name);
|
|
159
161
|
await this.deleteWorkspaceByName(response.data.items[i].metadata.name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestWorkspaceUtil.js","sourceRoot":"","sources":["../../../utils/workspace/TestWorkspaceUtil.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;;;;;;;;;;;;;;;;AAExE,4BAA0B;AAC1B,yCAA+C;AAC/C,kDAA+C;AAC/C,uDAAoD;AACpD,2DAA2C;AAC3C,mFAAgF;AAChF,mEAAwD;AACxD,sCAAmC;AACnC,kDAA6C;AAE7C,qDAAkD;AAClD,
|
|
1
|
+
{"version":3,"file":"TestWorkspaceUtil.js","sourceRoot":"","sources":["../../../utils/workspace/TestWorkspaceUtil.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;;;;;;;;;;;;;;;;AAExE,4BAA0B;AAC1B,yCAA+C;AAC/C,kDAA+C;AAC/C,uDAAoD;AACpD,2DAA2C;AAC3C,mFAAgF;AAChF,mEAAwD;AACxD,sCAAmC;AACnC,kD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+1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
*
|
|
2
|
+
/** *******************************************************************
|
|
3
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
4
4
|
*
|
|
5
5
|
* This program and the accompanying materials are made
|
|
6
6
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceStatus.js","sourceRoot":"","sources":["../../../utils/workspace/WorkspaceStatus.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;AAExE,IAAY,eAIX;AAJD,WAAY,eAAe;
|
|
1
|
+
{"version":3,"file":"WorkspaceStatus.js","sourceRoot":"","sources":["../../../utils/workspace/WorkspaceStatus.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;AAExE,IAAY,eAIX;AAJD,WAAY,eAAe;IAC1B,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;AACtB,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B"}
|
package/driver/ChromeDriver.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
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
|
|
@@ -13,63 +13,57 @@ import { injectable } from 'inversify';
|
|
|
13
13
|
import { Builder, ThenableWebDriver } from 'selenium-webdriver';
|
|
14
14
|
import { IDriver } from './IDriver';
|
|
15
15
|
import { Options } from 'selenium-webdriver/chrome';
|
|
16
|
-
import {
|
|
16
|
+
import { CHROME_DRIVER_CONSTANTS } from '../constants/CHROME_DRIVER_CONSTANTS';
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class ChromeDriver implements IDriver {
|
|
20
|
-
|
|
20
|
+
private readonly driver: ThenableWebDriver | undefined;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
constructor() {
|
|
23
|
+
const options: Options = this.getDriverOptions();
|
|
24
|
+
if (CHROME_DRIVER_CONSTANTS.TS_USE_WEB_DRIVER_FOR_TEST) {
|
|
25
|
+
this.driver = this.getDriverBuilder(options).build();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
get(): ThenableWebDriver {
|
|
30
|
+
return this.driver as ThenableWebDriver;
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
async setWindowSize(): Promise<void> {
|
|
34
|
+
await (this.driver as ThenableWebDriver)
|
|
35
|
+
.manage()
|
|
36
|
+
.window()
|
|
37
|
+
.setSize(CHROME_DRIVER_CONSTANTS.TS_SELENIUM_RESOLUTION_WIDTH, CHROME_DRIVER_CONSTANTS.TS_SELENIUM_RESOLUTION_HEIGHT);
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
private getDriverOptions(): Options {
|
|
41
|
+
let options: Options = new Options()
|
|
42
|
+
.addArguments('--no-sandbox')
|
|
43
|
+
.addArguments('--disable-web-security')
|
|
44
|
+
.addArguments('--allow-running-insecure-content')
|
|
45
|
+
.addArguments('--ignore-certificate-errors');
|
|
46
|
+
// if 'true' run in 'headless' mode
|
|
47
|
+
if (CHROME_DRIVER_CONSTANTS.TS_SELENIUM_HEADLESS) {
|
|
48
|
+
options = options.addArguments('headless');
|
|
49
|
+
}
|
|
50
|
+
return options;
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.forBrowser('chrome')
|
|
57
|
-
.setChromeOptions(options);
|
|
53
|
+
private getDriverBuilder(options: Options): Builder {
|
|
54
|
+
const disableW3copts: object = { 'goog:chromeOptions': { w3c: false } };
|
|
55
|
+
let builder: Builder = new Builder().forBrowser('chrome').setChromeOptions(options);
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
.setChromeOptions(options);
|
|
64
|
-
}
|
|
57
|
+
// if 'false' w3c protocol is disabled
|
|
58
|
+
if (!CHROME_DRIVER_CONSTANTS.TS_SELENIUM_W3C_CHROME_OPTION) {
|
|
59
|
+
builder.withCapabilities(disableW3copts).forBrowser('chrome').setChromeOptions(options);
|
|
60
|
+
}
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return builder;
|
|
72
|
-
|
|
73
|
-
}
|
|
62
|
+
// if 'true' run with remote driver
|
|
63
|
+
if (CHROME_DRIVER_CONSTANTS.TS_SELENIUM_REMOTE_DRIVER_URL) {
|
|
64
|
+
builder = builder.usingServer(CHROME_DRIVER_CONSTANTS.TS_SELENIUM_REMOTE_DRIVER_URL);
|
|
65
|
+
}
|
|
74
66
|
|
|
67
|
+
return builder;
|
|
68
|
+
}
|
|
75
69
|
}
|
package/driver/IDriver.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
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
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
import { ThenableWebDriver } from 'selenium-webdriver';
|
|
11
11
|
|
|
12
12
|
export interface IDriver {
|
|
13
|
-
|
|
13
|
+
get(): ThenableWebDriver;
|
|
14
14
|
}
|
package/index.ts
CHANGED
|
@@ -41,12 +41,12 @@ export * from './pageobjects/openshift/OcpMainPage';
|
|
|
41
41
|
export * from './tests-library/LoginTests';
|
|
42
42
|
export * from './tests-library/ProjectAndFileTests';
|
|
43
43
|
export * from './tests-library/WorkspaceHandlingTests';
|
|
44
|
-
export * from './constants/
|
|
45
|
-
export * from './constants/
|
|
46
|
-
export * from './constants/
|
|
47
|
-
export * from './constants/
|
|
48
|
-
export * from './constants/
|
|
49
|
-
export * from './constants/
|
|
50
|
-
export * from './constants/
|
|
51
|
-
export * from './constants/
|
|
52
|
-
export * from './constants/
|
|
44
|
+
export * from './constants/API_TEST_CONSTANTS';
|
|
45
|
+
export * from './constants/BASE_TEST_CONSTANTS';
|
|
46
|
+
export * from './constants/CHROME_DRIVER_CONSTANTS';
|
|
47
|
+
export * from './constants/FACTORY_TEST_CONSTANTS';
|
|
48
|
+
export * from './constants/MONACO_CONSTANTS';
|
|
49
|
+
export * from './constants/OAUTH_CONSTANTS';
|
|
50
|
+
export * from './constants/PLUGIN_TEST_CONSTANTS';
|
|
51
|
+
export * from './constants/REPORTER_CONSTANTS';
|
|
52
|
+
export * from './constants/TIMEOUT_CONSTANTS';
|
package/package.json
CHANGED
|
@@ -1,51 +1,61 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
"name": "@eclipse-che/che-e2e",
|
|
3
|
+
"version": "7.74.0-dev-41d1364",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lint": "eslint --fix .",
|
|
8
|
+
"prettier": "prettier --config .prettierrc.json . --write",
|
|
9
|
+
"tsc": "rm -rf ./dist && ./configs/sh-scripts/generateIndex.sh && tsc -p .",
|
|
10
|
+
"test": "./configs/sh-scripts/initDefaultValues.sh npm run lint && npm run tsc && export USERSTORY=$USERSTORY && mocha --config dist/configs/mocharc.js",
|
|
11
|
+
"driver-less-test": "export TS_USE_WEB_DRIVER_FOR_TEST=false && npm run test",
|
|
12
|
+
"cleanup-docker": "if [ $(docker ps -a | grep -c selenium-e2e) -gt 0 ]; then docker rm -f $(docker ps --filter \"name=selenium-e2e\" -aq); fi;",
|
|
13
|
+
"test-docker": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL eclipse/che-e2e:nightly",
|
|
14
|
+
"test-docker-mount-e2e": "npm run cleanup-docker && docker run -it --shm-size=2g -p 5920:5920 --name selenium-e2e -e TS_SELENIUM_BASE_URL=$TS_SELENIUM_BASE_URL -v $(pwd):/tmp/e2e:Z eclipse/che-e2e:nightly",
|
|
15
|
+
"test-all-devfiles": " ./configs/sh-scripts/initDefaultValues.sh && ./configs/sh-scripts/initDevfileTests.sh",
|
|
16
|
+
"devfile-acceptance-test-suite": "./configs/sh-scripts/initDefaultValues.sh npm run lint && npm run tsc && export TS_USE_WEB_DRIVER_FOR_TEST=false && mocha 'dist/specs/api/*.js' --config dist/configs/mocharc.js --delay --grep 'Devfile acceptance test suite'"
|
|
17
|
+
},
|
|
18
|
+
"author": "Ihor Okhrimenko (iokhrime@redhat.com)",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@eclipse-che/che-devworkspace-generator": "next",
|
|
22
|
+
"@types/chai": "^4.3.4",
|
|
23
|
+
"@types/clone-deep": "^4.0.1",
|
|
24
|
+
"@types/mocha": "5.2.6",
|
|
25
|
+
"@types/node": "11.13.4",
|
|
26
|
+
"@types/rimraf": "2.0.2",
|
|
27
|
+
"@types/selenium-webdriver": "4.1.3",
|
|
28
|
+
"@types/shelljs": "^0.8.11",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
|
30
|
+
"@typescript-eslint/eslint-plugin-tslint": "^6.1.0",
|
|
31
|
+
"@typescript-eslint/parser": "^6.1.0",
|
|
32
|
+
"axios": "^0.25.0",
|
|
33
|
+
"chai": "^4.3.4",
|
|
34
|
+
"chromedriver": "^114.0.2",
|
|
35
|
+
"clone-deep": "^4.0.1",
|
|
36
|
+
"eslint": "^8.45.0",
|
|
37
|
+
"eslint-config-prettier": "^8.10.0",
|
|
38
|
+
"eslint-plugin-header": "^3.1.1",
|
|
39
|
+
"eslint-plugin-jsdoc": "^46.5.0",
|
|
40
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
41
|
+
"husky": "^8.0.3",
|
|
42
|
+
"mocha": "^9.1.3",
|
|
43
|
+
"monaco-page-objects": "3.1.0",
|
|
44
|
+
"prettier": "^3.0.2",
|
|
45
|
+
"rimraf": "2.6.2",
|
|
46
|
+
"selenium-webdriver": "4.4.0",
|
|
47
|
+
"shelljs": "^0.8.5",
|
|
48
|
+
"ts-node": "^10.9.1",
|
|
49
|
+
"typescript": "3.9.9",
|
|
50
|
+
"vscode-extension-tester-locators": "3.1.0",
|
|
51
|
+
"yaml": "^2.2.2"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@eclipse-che/api": "latest",
|
|
55
|
+
"inversify": "5.0.1",
|
|
56
|
+
"reflect-metadata": "0.1.13"
|
|
57
|
+
},
|
|
58
|
+
"resolutions": {
|
|
59
|
+
"minimist": "^1.2.5"
|
|
60
|
+
}
|
|
51
61
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
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
|
|
@@ -13,85 +13,94 @@ import { CLASSES } from '../../configs/inversify.types';
|
|
|
13
13
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
14
14
|
import { By, Key } from 'selenium-webdriver';
|
|
15
15
|
import { Logger } from '../../utils/Logger';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
17
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class CreateWorkspace {
|
|
21
|
-
|
|
21
|
+
static readonly FACTORY_URL_LOCATOR: By = By.xpath('//input[@id="git-repo-url"]');
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
constructor(
|
|
24
|
+
@inject(CLASSES.DriverHelper)
|
|
25
|
+
private readonly driverHelper: DriverHelper
|
|
26
|
+
) {}
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
async waitTitleContains(expectedText: string, timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise<void> {
|
|
29
|
+
Logger.debug(`text: "${expectedText}"`);
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
const pageTitleLocator: By = By.xpath(`//h1[contains(text(), '${expectedText}')]`);
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
await this.driverHelper.waitVisibility(pageTitleLocator, timeout);
|
|
34
|
+
}
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
async waitPage(timeout: number = TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT): Promise<void> {
|
|
37
|
+
Logger.debug();
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
await this.waitTitleContains('Create Workspace', timeout);
|
|
40
|
+
}
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
async clickOnSampleNoEditorSelection(
|
|
43
|
+
sampleName: string,
|
|
44
|
+
timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT
|
|
45
|
+
): Promise<void> {
|
|
46
|
+
Logger.debug(`sampleName: "${sampleName}"`);
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
const sampleLocator: By = this.getSampleLocator(sampleName);
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
await this.driverHelper.waitAndClick(sampleLocator, timeout);
|
|
51
|
+
}
|
|
46
52
|
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
async clickOnSampleForSpecificEditor(
|
|
54
|
+
sampleName: string,
|
|
55
|
+
timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT
|
|
56
|
+
): Promise<void> {
|
|
57
|
+
await this.clickOnEditorsDropdownListButton(sampleName, timeout);
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
Logger.debug(`sampleName: "${sampleName}"`);
|
|
51
60
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
const sampleLocator: By = this.getSampleLocatorWithSpecificEditor(sampleName);
|
|
62
|
+
await this.driverHelper.waitAndClick(sampleLocator, timeout);
|
|
63
|
+
}
|
|
55
64
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
async importFromGitUsingUI(factoryUrl: string, timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise<void> {
|
|
66
|
+
Logger.debug(`factoryUrl: "${factoryUrl}"`);
|
|
67
|
+
await this.driverHelper.waitVisibility(CreateWorkspace.FACTORY_URL_LOCATOR, timeout);
|
|
68
|
+
await this.driverHelper.type(CreateWorkspace.FACTORY_URL_LOCATOR, Key.chord(factoryUrl, Key.ENTER), timeout);
|
|
69
|
+
}
|
|
61
70
|
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
private async clickOnEditorsDropdownListButton(sampleName: string, timeout: number): Promise<void> {
|
|
72
|
+
Logger.debug(`sampleName: "${sampleName}, editor ${BASE_TEST_CONSTANTS.TS_SELENIUM_EDITOR}"`);
|
|
64
73
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
const editorDropdownListLocator: By = this.getEditorsDropdownListLocator(sampleName);
|
|
75
|
+
await this.driverHelper.waitAndClick(editorDropdownListLocator, timeout);
|
|
76
|
+
}
|
|
68
77
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
private getEditorsDropdownListLocator(sampleName: string): By {
|
|
79
|
+
return By.xpath(`//div[text()=\'${sampleName}\']//parent::article//button`);
|
|
80
|
+
}
|
|
72
81
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
private getSampleLocatorWithSpecificEditor(sampleName: string): By {
|
|
83
|
+
let editor: string = '';
|
|
84
|
+
switch (process.env.TS_SELENIUM_EDITOR) {
|
|
85
|
+
case 'che-code':
|
|
86
|
+
editor = 'code';
|
|
87
|
+
break;
|
|
88
|
+
default:
|
|
89
|
+
throw new Error(`Unsupported editor ${process.env.TS_SELENIUM_EDITOR}`);
|
|
90
|
+
}
|
|
82
91
|
|
|
83
|
-
|
|
92
|
+
Logger.trace(`sampleName: ${sampleName}, editor "${editor}"`);
|
|
84
93
|
|
|
85
|
-
|
|
94
|
+
return By.xpath(`//div[text()='${sampleName}']//parent::article//span[text()[
|
|
86
95
|
contains(
|
|
87
96
|
translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),
|
|
88
97
|
'${editor}')]
|
|
89
98
|
]//parent::a`);
|
|
90
|
-
|
|
99
|
+
}
|
|
91
100
|
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
private getSampleLocator(sampleName: string): By {
|
|
102
|
+
Logger.trace(`sampleName: ${sampleName}, used default editor`);
|
|
94
103
|
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
return By.xpath(`//article[contains(@class, 'sample-card')]//div[text()='${sampleName}']`);
|
|
105
|
+
}
|
|
97
106
|
}
|