@eclipse-che/che-e2e 7.74.0-dev-1d09cb7 → 7.74.0-dev-aace77a
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 +197 -0
- package/.prettierignore +10 -0
- package/.prettierrc.json +10 -0
- package/CODE_STYLE.md +144 -0
- package/README.md +47 -47
- package/configs/inversify.config.ts +39 -14
- package/configs/inversify.types.ts +44 -30
- 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 +42 -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 +36 -9
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +19 -5
- 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/CHROME_DRIVER_CONSTANTS.js +36 -0
- 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 -22
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +15 -15
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +20 -21
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +55 -60
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +58 -48
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +22 -20
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +26 -12
- 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 +14 -14
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +7 -7
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +24 -28
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +13 -16
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +9 -9
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +19 -23
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +20 -19
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +11 -11
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +24 -24
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +30 -30
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +33 -27
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +17 -17
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js +8 -6
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +27 -24
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +17 -17
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +10 -8
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +10 -10
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +13 -13
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +52 -52
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +23 -19
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +38 -41
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +52 -50
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +49 -51
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +45 -42
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +13 -13
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +9 -7
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +22 -19
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +21 -21
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +91 -65
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +34 -15
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +34 -18
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +73 -68
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/IContextParams.js +12 -0
- package/dist/utils/IContextParams.js.map +1 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js +3 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js.map +1 -0
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +146 -107
- 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 +26 -16
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js +29 -9
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +19 -9
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +29 -29
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +12 -8
- 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 +5 -5
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/ITestWorkspaceUtil.js +2 -2
- package/dist/utils/workspace/TestWorkspaceUtil.js +25 -23
- 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 +45 -58
- package/driver/IDriver.ts +3 -3
- package/index.ts +11 -9
- package/package.json +59 -49
- package/pageobjects/dashboard/CreateWorkspace.ts +65 -55
- package/pageobjects/dashboard/Dashboard.ts +100 -100
- package/pageobjects/dashboard/Workspaces.ts +210 -186
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +153 -131
- package/pageobjects/git-providers/OauthPage.ts +177 -166
- package/pageobjects/ide/CheCodeLocatorLoader.ts +51 -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 +51 -56
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +27 -27
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +15 -18
- package/pageobjects/login/openshift/RedHatLoginPage.ts +49 -46
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +43 -34
- package/pageobjects/openshift/OcpApplicationPage.ts +21 -19
- package/pageobjects/openshift/OcpImportFromGitPage.ts +68 -68
- package/pageobjects/openshift/OcpMainPage.ts +69 -69
- package/specs/MochaHooks.ts +59 -52
- package/specs/SmokeTest.spec.ts +47 -45
- package/specs/api/ContainerOverridesAPI.spec.ts +39 -26
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +110 -97
- package/specs/api/EmptyWorkspaceAPI.spec.ts +67 -58
- package/specs/api/PodOverridesAPI.spec.ts +48 -34
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +36 -36
- package/specs/dashboard-samples/Quarkus.spec.ts +41 -40
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +202 -183
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +85 -75
- package/specs/factory/Factory.spec.ts +184 -178
- package/specs/factory/NoSetupRepoFactory.spec.ts +233 -219
- package/specs/factory/RefusedOAuthFactory.spec.ts +223 -211
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +70 -64
- 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 +78 -74
- package/utils/CheReporter.ts +159 -157
- package/utils/DevWorkspaceConfigurationHelper.ts +63 -69
- package/utils/DevfilesRegistryHelper.ts +71 -57
- package/utils/DriverHelper.ts +728 -700
- package/utils/IContextParams.ts +26 -0
- package/utils/IKubernetesCommandLineToolsExecutor.ts +42 -0
- package/utils/KubernetesCommandLineToolsExecutor.ts +231 -183
- package/utils/Logger.ts +102 -125
- package/utils/ScreenCatcher.ts +57 -46
- package/utils/ShellExecutor.ts +23 -12
- package/utils/StringUtil.ts +49 -36
- 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 +0 -44
- 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
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,50 @@ 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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.forBrowser('chrome')
|
|
63
|
-
.setChromeOptions(options);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// if 'true' run with remote driver
|
|
67
|
-
if (ChromeDriverConstants.TS_SELENIUM_REMOTE_DRIVER_URL) {
|
|
68
|
-
builder = builder.usingServer(ChromeDriverConstants.TS_SELENIUM_REMOTE_DRIVER_URL);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return builder;
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
20
|
+
private readonly driver: ThenableWebDriver | undefined;
|
|
21
|
+
|
|
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
|
+
|
|
29
|
+
get(): ThenableWebDriver {
|
|
30
|
+
return this.driver as ThenableWebDriver;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
private getDriverOptions(): Options {
|
|
34
|
+
let options: Options = new Options()
|
|
35
|
+
.addArguments('--no-sandbox')
|
|
36
|
+
.addArguments('--disable-web-security')
|
|
37
|
+
.addArguments('--allow-running-insecure-content')
|
|
38
|
+
.addArguments('--ignore-certificate-errors');
|
|
39
|
+
// if 'true' run in 'headless' mode
|
|
40
|
+
if (CHROME_DRIVER_CONSTANTS.TS_SELENIUM_HEADLESS) {
|
|
41
|
+
options = options.addArguments('headless');
|
|
42
|
+
}
|
|
43
|
+
return options;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private getDriverBuilder(options: Options): Builder {
|
|
47
|
+
const disableW3copts: object = { 'goog:chromeOptions': { w3c: false } };
|
|
48
|
+
let builder: Builder = new Builder().forBrowser('chrome').setChromeOptions(options);
|
|
49
|
+
|
|
50
|
+
// if 'false' w3c protocol is disabled
|
|
51
|
+
if (!CHROME_DRIVER_CONSTANTS.TS_SELENIUM_W3C_CHROME_OPTION) {
|
|
52
|
+
builder.withCapabilities(disableW3copts).forBrowser('chrome').setChromeOptions(options);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// if 'true' run with remote driver
|
|
56
|
+
if (CHROME_DRIVER_CONSTANTS.TS_SELENIUM_REMOTE_DRIVER_URL) {
|
|
57
|
+
builder = builder.usingServer(CHROME_DRIVER_CONSTANTS.TS_SELENIUM_REMOTE_DRIVER_URL);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return builder;
|
|
61
|
+
}
|
|
75
62
|
}
|
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
|
@@ -8,6 +8,8 @@ export * from './utils/BrowserTabsUtil';
|
|
|
8
8
|
export * from './utils/DevWorkspaceConfigurationHelper';
|
|
9
9
|
export * from './utils/DevfilesRegistryHelper';
|
|
10
10
|
export * from './utils/DriverHelper';
|
|
11
|
+
export * from './utils/IContextParams';
|
|
12
|
+
export * from './utils/IKubernetesCommandLineToolsExecutor';
|
|
11
13
|
export * from './utils/KubernetesCommandLineToolsExecutor';
|
|
12
14
|
export * from './utils/Logger';
|
|
13
15
|
export * from './utils/ScreenCatcher';
|
|
@@ -41,12 +43,12 @@ export * from './pageobjects/openshift/OcpMainPage';
|
|
|
41
43
|
export * from './tests-library/LoginTests';
|
|
42
44
|
export * from './tests-library/ProjectAndFileTests';
|
|
43
45
|
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/
|
|
46
|
+
export * from './constants/API_TEST_CONSTANTS';
|
|
47
|
+
export * from './constants/BASE_TEST_CONSTANTS';
|
|
48
|
+
export * from './constants/CHROME_DRIVER_CONSTANTS';
|
|
49
|
+
export * from './constants/FACTORY_TEST_CONSTANTS';
|
|
50
|
+
export * from './constants/MONACO_CONSTANTS';
|
|
51
|
+
export * from './constants/OAUTH_CONSTANTS';
|
|
52
|
+
export * from './constants/PLUGIN_TEST_CONSTANTS';
|
|
53
|
+
export * from './constants/REPORTER_CONSTANTS';
|
|
54
|
+
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-aace77a",
|
|
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": "4.9.4",
|
|
50
|
+
"vscode-extension-tester-locators": "3.1.0",
|
|
51
|
+
"yaml": "^2.2.2"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@eclipse-che/api": "latest",
|
|
55
|
+
"inversify": "6.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,95 @@ 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
|
+
private static readonly FACTORY_URL: 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
|
-
await this.driverHelper.waitVisibility(CreateWorkspace.FACTORY_URL_LOCATOR, timeout);
|
|
59
|
-
await this.driverHelper.type(CreateWorkspace.FACTORY_URL_LOCATOR, Key.chord(factoryUrl, Key.ENTER), timeout);
|
|
60
|
-
}
|
|
65
|
+
async importFromGitUsingUI(factoryUrl: string, timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise<void> {
|
|
66
|
+
Logger.debug(`factoryUrl: "${factoryUrl}"`);
|
|
61
67
|
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
await this.driverHelper.waitVisibility(CreateWorkspace.FACTORY_URL, timeout);
|
|
69
|
+
await this.driverHelper.type(CreateWorkspace.FACTORY_URL, Key.chord(factoryUrl, Key.ENTER), timeout);
|
|
70
|
+
}
|
|
64
71
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
72
|
+
async clickOnEditorsDropdownListButton(sampleName: string, timeout: number): Promise<void> {
|
|
73
|
+
Logger.debug(`sampleName: "${sampleName}, editor ${BASE_TEST_CONSTANTS.TS_SELENIUM_EDITOR}"`);
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
const editorDropdownListLocator: By = this.getEditorsDropdownListLocator(sampleName);
|
|
76
|
+
await this.driverHelper.waitAndClick(editorDropdownListLocator, timeout);
|
|
77
|
+
}
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
case 'che-code':
|
|
77
|
-
editor = 'code';
|
|
78
|
-
break;
|
|
79
|
-
default:
|
|
80
|
-
throw new Error(`Unsupported editor ${process.env.TS_SELENIUM_EDITOR}`);
|
|
81
|
-
}
|
|
79
|
+
private getEditorsDropdownListLocator(sampleName: string): By {
|
|
80
|
+
return By.xpath(`//div[text()=\'${sampleName}\']//parent::article//button`);
|
|
81
|
+
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
private getSampleLocatorWithSpecificEditor(sampleName: string): By {
|
|
84
|
+
let editor: string = '';
|
|
85
|
+
switch (process.env.TS_SELENIUM_EDITOR) {
|
|
86
|
+
case 'che-code':
|
|
87
|
+
editor = 'code';
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
throw new Error(`Unsupported editor ${process.env.TS_SELENIUM_EDITOR}`);
|
|
91
|
+
}
|
|
84
92
|
|
|
85
|
-
|
|
93
|
+
Logger.trace(`sampleName: ${sampleName}, editor "${editor}"`);
|
|
94
|
+
|
|
95
|
+
return By.xpath(`//div[text()='${sampleName}']//parent::article//span[text()[
|
|
86
96
|
contains(
|
|
87
97
|
translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),
|
|
88
98
|
'${editor}')]
|
|
89
99
|
]//parent::a`);
|
|
90
|
-
|
|
100
|
+
}
|
|
91
101
|
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
private getSampleLocator(sampleName: string): By {
|
|
103
|
+
Logger.trace(`sampleName: ${sampleName}, used default editor`);
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
return By.xpath(`//article[contains(@class, 'sample-card')]//div[text()='${sampleName}']`);
|
|
106
|
+
}
|
|
97
107
|
}
|