@eclipse-che/che-e2e 7.67.0 → 7.67.1-dev-e49f025
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/README.md +13 -4
- package/build/dockerfiles/Dockerfile +1 -1
- package/configs/inversify.config.ts +20 -17
- package/configs/inversify.types.ts +3 -3
- package/configs/mocharc.ts +14 -4
- package/configs/sh-scripts/generateIndex.sh +2 -3
- package/constants/APITestConstants.ts +56 -0
- package/constants/BaseTestConstants.ts +65 -0
- package/constants/ChromeDriverConstants.ts +46 -0
- package/constants/FactoryTestConstants.ts +45 -0
- package/constants/MonacoConstants.ts +22 -0
- package/constants/OAuthConstants.ts +56 -0
- package/constants/PluginsTestConstants.ts +15 -0
- package/constants/ReporterConstants.ts +45 -0
- package/constants/TimeoutConstants.ts +28 -146
- package/dist/configs/inversify.config.js +17 -13
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +3 -2
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +13 -4
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/APITestConstants.js +54 -0
- package/dist/constants/APITestConstants.js.map +1 -0
- package/dist/constants/BaseTestConstants.js +61 -0
- package/dist/constants/BaseTestConstants.js.map +1 -0
- package/dist/constants/ChromeDriverConstants.js +44 -0
- package/dist/constants/ChromeDriverConstants.js.map +1 -0
- package/dist/constants/FactoryTestConstants.js +44 -0
- package/dist/constants/FactoryTestConstants.js.map +1 -0
- package/dist/constants/MonacoConstants.js +25 -0
- package/dist/constants/MonacoConstants.js.map +1 -0
- package/dist/constants/OAuthConstants.js +52 -0
- package/dist/constants/OAuthConstants.js.map +1 -0
- package/dist/constants/PluginsTestConstants.js +19 -0
- package/dist/constants/PluginsTestConstants.js.map +1 -0
- package/dist/constants/ReporterConstants.js +43 -0
- package/dist/constants/ReporterConstants.js.map +1 -0
- package/dist/constants/TimeoutConstants.js +22 -113
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js +7 -7
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +22 -12
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +2 -2
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +7 -6
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +3 -4
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +2 -3
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +12 -19
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +2 -2
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js.map +1 -0
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +68 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -0
- package/dist/pageobjects/{openshift/CheLoginPage.js → login/kubernetes/KubernetesLoginPage.js} +21 -26
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -0
- package/dist/pageobjects/{openshift → login/openshift}/OcpLoginPage.js +7 -7
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{OcpRedHatLoginPage.js → openshift/OcpRedHatLoginPage.js} +5 -5
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{OcpUserLoginPage.js → openshift/OcpUserLoginPage.js} +7 -7
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{RedHatLoginPage.js → openshift/RedHatLoginPage.js} +6 -6
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{RegularUserOcpCheLoginPage.js → openshift/RegularUserOcpCheLoginPage.js} +8 -8
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -0
- package/dist/specs/MochaHooks.js +18 -11
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +5 -2
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js +5 -4
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +93 -0
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -0
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +62 -0
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -0
- package/dist/specs/api/PodOverridesAPI.spec.js +5 -4
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +7 -2
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js +7 -6
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +4 -4
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +20 -18
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +28 -28
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +28 -26
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +4 -4
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +1 -2
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +2 -2
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +33 -36
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +72 -0
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -0
- package/dist/utils/DevfilesRegistryHelper.js +82 -0
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -0
- package/dist/utils/DriverHelper.js +20 -17
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +42 -29
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +11 -11
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js +9 -12
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js +5 -2
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/{vsc/GitUtil.js → StringUtil.js} +26 -8
- package/dist/utils/StringUtil.js.map +1 -0
- package/dist/utils/request-handlers/CheApiRequestHandler.js +2 -2
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +4 -2
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +9 -7
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/driver/ChromeDriver.ts +7 -7
- package/index.ts +22 -12
- package/package.json +4 -2
- package/pageobjects/dashboard/CreateWorkspace.ts +2 -2
- package/pageobjects/dashboard/Dashboard.ts +7 -6
- package/pageobjects/dashboard/Workspaces.ts +3 -4
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +2 -3
- package/pageobjects/git-providers/OauthPage.ts +8 -16
- package/pageobjects/ide/CheCodeLocatorLoader.ts +2 -2
- package/pageobjects/login/kubernetes/DexLoginPage.ts +58 -0
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +33 -0
- package/pageobjects/{openshift → login/openshift}/OcpLoginPage.ts +7 -7
- package/pageobjects/login/{OcpRedHatLoginPage.ts → openshift/OcpRedHatLoginPage.ts} +6 -6
- package/pageobjects/login/{OcpUserLoginPage.ts → openshift/OcpUserLoginPage.ts} +8 -8
- package/pageobjects/login/{RedHatLoginPage.ts → openshift/RedHatLoginPage.ts} +6 -6
- package/pageobjects/login/{RegularUserOcpCheLoginPage.ts → openshift/RegularUserOcpCheLoginPage.ts} +9 -9
- package/specs/MochaHooks.ts +18 -12
- package/specs/SmokeTest.spec.ts +5 -2
- package/specs/api/ContainerOverridesAPI.spec.ts +5 -4
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +106 -0
- package/specs/api/EmptyWorkspaceAPI.spec.ts +74 -0
- package/specs/api/PodOverridesAPI.spec.ts +5 -4
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +10 -2
- package/specs/dashboard-samples/RecomendedExtentions.spec.ts +8 -7
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +4 -4
- package/specs/factory/Factory.spec.ts +21 -19
- package/specs/factory/NoSetupRepoFactory.spec.ts +29 -30
- package/specs/factory/RefusedOAuthFactory.spec.ts +29 -28
- package/tests-library/LoginTests.ts +9 -9
- package/tests-library/ProjectAndFileTests.ts +1 -1
- package/tests-library/WorkspaceHandlingTests.ts +11 -12
- package/utils/BrowserTabsUtil.ts +2 -2
- package/utils/CheReporter.ts +35 -42
- package/utils/DevWorkspaceConfigurationHelper.ts +83 -0
- package/utils/DevfilesRegistryHelper.ts +77 -0
- package/utils/DriverHelper.ts +54 -50
- package/utils/KubernetesCommandLineToolsExecutor.ts +43 -28
- package/utils/Logger.ts +16 -17
- package/utils/ScreenCatcher.ts +8 -9
- package/utils/ShellExecutor.ts +6 -2
- package/utils/StringUtil.ts +46 -0
- package/utils/request-handlers/CheApiRequestHandler.ts +4 -4
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +4 -2
- package/utils/workspace/ApiUrlResolver.ts +2 -2
- package/utils/workspace/TestWorkspaceUtil.ts +16 -14
- package/constants/TestConstants.ts +0 -247
- package/dist/constants/TestConstants.js +0 -198
- package/dist/constants/TestConstants.js.map +0 -1
- package/dist/pageobjects/login/ICheLoginPage.js.map +0 -1
- package/dist/pageobjects/login/IOcpLoginPage.js.map +0 -1
- package/dist/pageobjects/login/OcpRedHatLoginPage.js.map +0 -1
- package/dist/pageobjects/login/OcpUserLoginPage.js.map +0 -1
- package/dist/pageobjects/login/RedHatLoginPage.js.map +0 -1
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js.map +0 -1
- package/dist/pageobjects/openshift/CheLoginPage.js.map +0 -1
- package/dist/pageobjects/openshift/OcpLoginPage.js.map +0 -1
- package/dist/specs/api/CloneGitRepoAPI.spec.js +0 -60
- package/dist/specs/api/CloneGitRepoAPI.spec.js.map +0 -1
- package/dist/utils/Sanitizer.js +0 -29
- package/dist/utils/Sanitizer.js.map +0 -1
- package/dist/utils/vsc/GitUtil.js.map +0 -1
- package/pageobjects/openshift/CheLoginPage.ts +0 -42
- package/specs/api/CloneGitRepoAPI.spec.ts +0 -72
- package/utils/Sanitizer.ts +0 -19
- package/utils/vsc/GitUtil.ts +0 -25
- /package/dist/pageobjects/login/{ICheLoginPage.js → interfaces/ICheLoginPage.js} +0 -0
- /package/dist/pageobjects/login/{IOcpLoginPage.js → interfaces/IOcpLoginPage.js} +0 -0
- /package/pageobjects/login/{ICheLoginPage.ts → interfaces/ICheLoginPage.ts} +0 -0
- /package/pageobjects/login/{IOcpLoginPage.ts → interfaces/IOcpLoginPage.ts} +0 -0
package/utils/Logger.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
2
|
-
|
|
3
1
|
/*********************************************************************
|
|
4
2
|
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
5
3
|
*
|
|
@@ -9,6 +7,7 @@ import { TestConstants } from '../constants/TestConstants';
|
|
|
9
7
|
*
|
|
10
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
11
9
|
**********************************************************************/
|
|
10
|
+
import { ReporterConstants } from '../constants/ReporterConstants';
|
|
12
11
|
|
|
13
12
|
export abstract class Logger {
|
|
14
13
|
|
|
@@ -17,7 +16,7 @@ export abstract class Logger {
|
|
|
17
16
|
* @param text log text
|
|
18
17
|
* @param indentLevel log level
|
|
19
18
|
*/
|
|
20
|
-
|
|
19
|
+
static error(text: string, indentLevel: number = 1): void {
|
|
21
20
|
this.logText(indentLevel, `[ERROR] ${text}`);
|
|
22
21
|
}
|
|
23
22
|
|
|
@@ -26,8 +25,8 @@ export abstract class Logger {
|
|
|
26
25
|
* @param text log text
|
|
27
26
|
* @param indentLevel log level
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
|
-
if (
|
|
28
|
+
static warn(text: string, indentLevel: number = 1): void {
|
|
29
|
+
if (ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR') {
|
|
31
30
|
return;
|
|
32
31
|
}
|
|
33
32
|
this.logText(indentLevel, `[WARN] ${text}`);
|
|
@@ -38,9 +37,9 @@ export abstract class Logger {
|
|
|
38
37
|
* @param text log text
|
|
39
38
|
* @param indentLevel log level
|
|
40
39
|
*/
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
|
|
40
|
+
static info(text: string, indentLevel: number = 3): void {
|
|
41
|
+
if (ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR' ||
|
|
42
|
+
ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'WARN') {
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
46
45
|
this.logText(indentLevel, `• ${text}`);
|
|
@@ -51,10 +50,10 @@ export abstract class Logger {
|
|
|
51
50
|
* @param text log text
|
|
52
51
|
* @param indentLevel log level
|
|
53
52
|
*/
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
static debug(text: string, indentLevel: number = 5): void {
|
|
54
|
+
if (ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR' ||
|
|
55
|
+
ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'WARN' ||
|
|
56
|
+
ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'INFO') {
|
|
58
57
|
return;
|
|
59
58
|
}
|
|
60
59
|
this.logText(indentLevel, `▼ ${text}`);
|
|
@@ -66,11 +65,11 @@ export abstract class Logger {
|
|
|
66
65
|
* @param text log text
|
|
67
66
|
* @param indentLevel log level
|
|
68
67
|
*/
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
static trace(text: string, indentLevel: number = 6): void {
|
|
69
|
+
if (ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR' ||
|
|
70
|
+
ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'WARN' ||
|
|
71
|
+
ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'INFO' ||
|
|
72
|
+
ReporterConstants.TS_SELENIUM_LOG_LEVEL === 'DEBUG') {
|
|
74
73
|
return;
|
|
75
74
|
}
|
|
76
75
|
this.logText(indentLevel, `‣ ${text}`);
|
package/utils/ScreenCatcher.ts
CHANGED
|
@@ -11,24 +11,23 @@ import * as fs from 'fs';
|
|
|
11
11
|
import { injectable, inject } from 'inversify';
|
|
12
12
|
import { CLASSES } from '../configs/inversify.types';
|
|
13
13
|
import { DriverHelper } from './DriverHelper';
|
|
14
|
-
import { Sanitizer } from './Sanitizer';
|
|
15
14
|
import { error } from 'selenium-webdriver';
|
|
16
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
17
15
|
import { WriteStream } from 'fs';
|
|
16
|
+
import { StringUtil } from './StringUtil';
|
|
17
|
+
import { ReporterConstants } from '../constants/ReporterConstants';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class ScreenCatcher {
|
|
21
|
-
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper
|
|
22
|
-
@inject(CLASSES.Sanitizer) private readonly sanitizer: Sanitizer) { }
|
|
21
|
+
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
23
22
|
|
|
24
23
|
async catchMethodScreen(methodName: string, methodIndex: number, screenshotIndex: number): Promise<void> {
|
|
25
|
-
const executionScreenCastDir: string = `${
|
|
26
|
-
const executionScreenCastErrorsDir: string = `${
|
|
24
|
+
const executionScreenCastDir: string = `${ReporterConstants.TS_SELENIUM_REPORT_FOLDER}/executionScreencast`;
|
|
25
|
+
const executionScreenCastErrorsDir: string = `${ReporterConstants.TS_SELENIUM_REPORT_FOLDER}/executionScreencastErrors`;
|
|
27
26
|
const formattedMethodIndex: string = new Intl.NumberFormat('en-us', { minimumIntegerDigits: 3 }).format(methodIndex);
|
|
28
27
|
const formattedScreenshotIndex: string = new Intl.NumberFormat('en-us', { minimumIntegerDigits: 5 }).format(screenshotIndex).replace(/,/g, '');
|
|
29
28
|
|
|
30
|
-
if (!fs.existsSync(
|
|
31
|
-
fs.mkdirSync(
|
|
29
|
+
if (!fs.existsSync(ReporterConstants.TS_SELENIUM_REPORT_FOLDER)) {
|
|
30
|
+
fs.mkdirSync(ReporterConstants.TS_SELENIUM_REPORT_FOLDER);
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
if (!fs.existsSync(executionScreenCastDir)) {
|
|
@@ -38,7 +37,7 @@ export class ScreenCatcher {
|
|
|
38
37
|
const date: Date = new Date();
|
|
39
38
|
const timeStr: string = date.toLocaleTimeString('en-us', { hour12: false }) + '.' + new Intl.NumberFormat('en-us', { minimumIntegerDigits: 3 }).format(date.getMilliseconds());
|
|
40
39
|
|
|
41
|
-
const screenshotPath: string = `${executionScreenCastDir}/${formattedMethodIndex}-${formattedScreenshotIndex}--(${
|
|
40
|
+
const screenshotPath: string = `${executionScreenCastDir}/${formattedMethodIndex}-${formattedScreenshotIndex}--(${StringUtil.sanitizeTitle(timeStr)})_${StringUtil.sanitizeTitle(methodName)}.png`;
|
|
42
41
|
|
|
43
42
|
try {
|
|
44
43
|
await this.catchScreen(screenshotPath);
|
package/utils/ShellExecutor.ts
CHANGED
|
@@ -2,11 +2,15 @@ import { echo, exec, ShellString } from 'shelljs';
|
|
|
2
2
|
|
|
3
3
|
export class ShellExecutor {
|
|
4
4
|
|
|
5
|
-
wait(seconds: number): void {
|
|
5
|
+
static wait(seconds: number): void {
|
|
6
6
|
this.execWithLog(`sleep ${seconds}s`);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
static curl(link: string): ShellString {
|
|
10
|
+
return this.execWithLog(`curl -k ${link}`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
protected static execWithLog(command: string): ShellString {
|
|
10
14
|
echo(command);
|
|
11
15
|
return exec(command);
|
|
12
16
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
|
|
11
|
+
import { injectable } from 'inversify';
|
|
12
|
+
import { Logger } from './Logger';
|
|
13
|
+
|
|
14
|
+
@injectable()
|
|
15
|
+
export class StringUtil {
|
|
16
|
+
/**
|
|
17
|
+
* Method extracts a test repo name from git clone https url;
|
|
18
|
+
* it splits the url into string[] by "/" or ".", deletes empty elements and elements that contains just "git", "main" or "tree" word, than returns the last one;
|
|
19
|
+
* please, avoid to call the test repo as just "git" or to use dots in the name, like: github.com/user/git.git, github.com/user/name.with.dots.
|
|
20
|
+
* @param url git https url (which using for "git clone")
|
|
21
|
+
* @return project name
|
|
22
|
+
*/
|
|
23
|
+
static getProjectNameFromGitUrl(url: string): string {
|
|
24
|
+
Logger.debug(`${this.constructor.name}.${this.getProjectNameFromGitUrl.name} - ${url}`);
|
|
25
|
+
if (url.includes('/tree/')) {
|
|
26
|
+
url = url.split('/').slice(0, -2).join('/');
|
|
27
|
+
}
|
|
28
|
+
const projectName: string = url.split(/[\/.]/).filter((e: string) => !['git', ''].includes(e)).reverse()[0];
|
|
29
|
+
Logger.debug(`${this.constructor.name}.${this.getProjectNameFromGitUrl.name} - ${projectName}`);
|
|
30
|
+
return projectName;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static sanitizeTitle(arg: string): string {
|
|
34
|
+
return arg.replace(/\//g, '+').replace(/,/g, '.').replace(/:/g, '-').replace(/['"]/g, '').replace(/[^a-z0-9+\-.()\[\]_]/gi, '_');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Replaces ${ENV}, $ENV to "$ENV"
|
|
39
|
+
* @param command string command with environmental variables in unsupported format
|
|
40
|
+
* @return updated command with environmental variables in supported format
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
static updateCommandEnvsToShStyle(command: string): string {
|
|
44
|
+
return command.replace(/[{}]/g, '').replace(/(?<!")\${?[a-zA-Z0-9_+\-\s]+\b}?/gm, `"\$&"`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
|
|
11
11
|
import axios, { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
12
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
13
12
|
import { TYPES } from '../../configs/inversify.types';
|
|
14
13
|
import { inject, injectable } from 'inversify';
|
|
15
14
|
import { IAuthorizationHeaderHandler } from './headers/IAuthorizationHeaderHandler';
|
|
16
15
|
import { Logger } from '../Logger';
|
|
16
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class CheApiRequestHandler {
|
|
@@ -21,7 +21,7 @@ export class CheApiRequestHandler {
|
|
|
21
21
|
/**
|
|
22
22
|
* This method adds a request interceptor into axios request interceptors list and returns an ID of the interceptor
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
static enableRequestInterceptor(): number {
|
|
25
25
|
Logger.debug(`CheApiRequestHandler.enableRequestInterceptor`);
|
|
26
26
|
return axios.interceptors.request.use( request => {
|
|
27
27
|
try {
|
|
@@ -47,7 +47,7 @@ export class CheApiRequestHandler {
|
|
|
47
47
|
/**
|
|
48
48
|
* This method adds a response interceptor into axios response interceptors list and returns an ID of the interceptor
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
static enableResponseInterceptor(): number {
|
|
51
51
|
Logger.debug(`CheApiRequestHandler.enableResponseRedirects`);
|
|
52
52
|
return axios.interceptors.response.use( response => {
|
|
53
53
|
try {
|
|
@@ -104,7 +104,7 @@ export class CheApiRequestHandler {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
private assembleUrl(relativeUrl: string): string {
|
|
107
|
-
return `${
|
|
107
|
+
return `${BaseTestConstants.TS_SELENIUM_BASE_URL}/${relativeUrl}`;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
}
|
|
@@ -14,16 +14,18 @@ import { DriverHelper } from '../../DriverHelper';
|
|
|
14
14
|
import { CLASSES } from '../../../configs/inversify.types';
|
|
15
15
|
import { Logger } from '../../Logger';
|
|
16
16
|
import { IWebDriverCookie } from 'selenium-webdriver';
|
|
17
|
+
import { BaseTestConstants, Platform } from '../../../constants/BaseTestConstants';
|
|
17
18
|
|
|
18
19
|
@injectable()
|
|
19
20
|
export class CheMultiuserAuthorizationHeaderHandler implements IAuthorizationHeaderHandler {
|
|
20
21
|
private authorizationToken: string = '';
|
|
22
|
+
private readonly cookiesType: string = BaseTestConstants.TS_PLATFORM === Platform.OPENSHIFT ? '_oauth_proxy' : '_oauth2_proxy';
|
|
21
23
|
|
|
22
24
|
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
23
25
|
|
|
24
26
|
async get(): Promise<AxiosRequestConfig> {
|
|
25
27
|
try {
|
|
26
|
-
let token: IWebDriverCookie = await this.driverHelper.getDriver().manage().getCookie(
|
|
28
|
+
let token: IWebDriverCookie = await this.driverHelper.getDriver().manage().getCookie(this.cookiesType);
|
|
27
29
|
if (this.authorizationToken !== token.value) {
|
|
28
30
|
this.authorizationToken = token.value;
|
|
29
31
|
}
|
|
@@ -35,6 +37,6 @@ export class CheMultiuserAuthorizationHeaderHandler implements IAuthorizationHea
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
return { headers: { 'cookie':
|
|
40
|
+
return { headers: { 'cookie': `${this.cookiesType}=${this.authorizationToken}` } };
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -22,11 +22,11 @@ export class ApiUrlResolver {
|
|
|
22
22
|
|
|
23
23
|
constructor(@inject(CLASSES.CheApiRequestHandler) private readonly processRequestHandler: CheApiRequestHandler) {}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
async getWorkspaceApiUrl(workspaceName: string): Promise<string> {
|
|
26
26
|
return `${await this.getWorkspacesApiUrl()}/${workspaceName}`;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
async getWorkspacesApiUrl(): Promise<string> {
|
|
30
30
|
const namespace: string = await this.obtainUserNamespace();
|
|
31
31
|
return `${ApiUrlResolver.DASHBOARD_API_URL}/${namespace}/devworkspaces`;
|
|
32
32
|
}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
|
|
11
11
|
import 'reflect-metadata';
|
|
12
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
13
12
|
import { injectable, inject } from 'inversify';
|
|
14
13
|
import { DriverHelper } from '../DriverHelper';
|
|
15
14
|
import { WorkspaceStatus } from './WorkspaceStatus';
|
|
@@ -20,11 +19,12 @@ import { Logger } from '../Logger';
|
|
|
20
19
|
import axios, { AxiosResponse } from 'axios';
|
|
21
20
|
import { ITestWorkspaceUtil } from './ITestWorkspaceUtil';
|
|
22
21
|
import { ApiUrlResolver } from './ApiUrlResolver';
|
|
22
|
+
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
23
23
|
|
|
24
24
|
@injectable()
|
|
25
25
|
export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
26
|
+
readonly polling: number = TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
27
|
+
readonly attempts: number = TimeoutConstants.TS_DASHBOARD_WORKSPACE_STOP_TIMEOUT / this.polling;
|
|
28
28
|
|
|
29
29
|
constructor(
|
|
30
30
|
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
|
|
@@ -32,7 +32,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
32
32
|
@inject(CLASSES.ApiUrlResolver) private readonly apiUrlResolver: ApiUrlResolver
|
|
33
33
|
) { }
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
async waitWorkspaceStatus(workspaceName: string, expectedWorkspaceStatus: WorkspaceStatus): Promise<void> {
|
|
36
36
|
Logger.debug('TestWorkspaceUtil.waitWorkspaceStatus');
|
|
37
37
|
|
|
38
38
|
let workspaceStatus: string = '';
|
|
@@ -60,8 +60,8 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
Logger.debug(
|
|
63
|
+
async stopWorkspaceByName(workspaceName: string): Promise<void> {
|
|
64
|
+
Logger.debug(`TestWorkspaceUtil.stopWorkspaceByName: ${workspaceName}`);
|
|
65
65
|
|
|
66
66
|
const stopWorkspaceApiUrl: string = await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName);
|
|
67
67
|
let stopWorkspaceResponse: AxiosResponse;
|
|
@@ -69,7 +69,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
69
69
|
try {
|
|
70
70
|
stopWorkspaceResponse = await this.processRequestHandler.patch(stopWorkspaceApiUrl, [{'op': 'replace', 'path': '/spec/started', 'value': false}]);
|
|
71
71
|
} catch (err) {
|
|
72
|
-
|
|
72
|
+
Logger.error(`Stop workspace call failed. URL used: ${stopWorkspaceApiUrl}`);
|
|
73
73
|
throw err;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -78,11 +78,12 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
await this.waitWorkspaceStatus(workspaceName, WorkspaceStatus.STOPPED);
|
|
81
|
+
Logger.debug(`TestWorkspaceUtil.stopWorkspaceByName: ${workspaceName} stopped successfully`);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
// delete a workspace without stopping phase (similar with force deleting)
|
|
84
|
-
|
|
85
|
-
Logger.debug(`TestWorkspaceUtil.deleteWorkspaceByName ${workspaceName}` );
|
|
85
|
+
async deleteWorkspaceByName(workspaceName: string): Promise<void> {
|
|
86
|
+
Logger.debug(`TestWorkspaceUtil.deleteWorkspaceByName: ${workspaceName}` );
|
|
86
87
|
|
|
87
88
|
const deleteWorkspaceApiUrl: string = await this.apiUrlResolver.getWorkspaceApiUrl(workspaceName);
|
|
88
89
|
let deleteWorkspaceResponse: AxiosResponse;
|
|
@@ -108,6 +109,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
108
109
|
} catch (error) {
|
|
109
110
|
if (axios.isAxiosError(error) && error.response?.status === 404) {
|
|
110
111
|
deleteWorkspaceStatus = true;
|
|
112
|
+
Logger.debug(`TestWorkspaceUtil.stopWorkspaceByName: ${workspaceName} deleted successfully`);
|
|
111
113
|
break;
|
|
112
114
|
}
|
|
113
115
|
}
|
|
@@ -115,12 +117,12 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
115
117
|
|
|
116
118
|
if (!deleteWorkspaceStatus) {
|
|
117
119
|
let waitTime: number = this.attempts * this.polling;
|
|
118
|
-
throw new error.TimeoutError(`The workspace was not
|
|
120
|
+
throw new error.TimeoutError(`The workspace was not deleted in ${waitTime} ms.`);
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
// stop workspace before deleting with checking stopping phase
|
|
123
|
-
|
|
125
|
+
async stopAndDeleteWorkspaceByName(workspaceName: string): Promise<void> {
|
|
124
126
|
Logger.debug('TestWorkspaceUtil.stopAndDeleteWorkspaceByName');
|
|
125
127
|
|
|
126
128
|
await this.stopWorkspaceByName(workspaceName);
|
|
@@ -128,7 +130,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
// stop all run workspaces in the namespace
|
|
131
|
-
|
|
133
|
+
async stopAllRunningWorkspaces(namespace: string): Promise<void> {
|
|
132
134
|
Logger.debug('TestWorkspaceUtil.stopAllRunProjects');
|
|
133
135
|
let response: AxiosResponse = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
134
136
|
for (let i: number = 0; i < response.data.items.length; i++) {
|
|
@@ -138,7 +140,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
// stop all run workspaces, check statuses and remove the workspaces
|
|
141
|
-
|
|
143
|
+
async stopAndDeleteAllRunningWorkspaces(namespace: string): Promise<void> {
|
|
142
144
|
Logger.debug('TestWorkspaceUtil.stopAndDeleteAllRunProjects');
|
|
143
145
|
let response: AxiosResponse = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
144
146
|
await this.stopAllRunningWorkspaces(namespace);
|
|
@@ -150,7 +152,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
150
152
|
|
|
151
153
|
// stop all run workspaces without stopping and waiting for of 'Stopped' phase
|
|
152
154
|
// similar with 'force' deleting
|
|
153
|
-
|
|
155
|
+
async deleteAllWorkspaces(namespace: string): Promise<void> {
|
|
154
156
|
Logger.debug('TestWorkspaceUtil.deleteAllRunProjects');
|
|
155
157
|
let response: AxiosResponse = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
156
158
|
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
/*********************************************************************
|
|
2
|
-
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made
|
|
5
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
-
*
|
|
8
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
-
**********************************************************************/
|
|
10
|
-
|
|
11
|
-
function getBaseUrl(): string {
|
|
12
|
-
const baseUrl: string | undefined = process.env.TS_SELENIUM_BASE_URL;
|
|
13
|
-
if (!baseUrl) {
|
|
14
|
-
return 'http://sample-url';
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return baseUrl.replace(/\/$/, '');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export enum GitProviderType {
|
|
21
|
-
GITHUB = 'github',
|
|
22
|
-
GITLAB = 'gitlab',
|
|
23
|
-
BITBUCKET = 'bitbucket'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export enum KubernetesCommandLineTool {
|
|
27
|
-
OC = 'oc',
|
|
28
|
-
KUBECTL = 'kubectl',
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const TestConstants: any = {
|
|
32
|
-
/**
|
|
33
|
-
* Base URL of the application which should be checked
|
|
34
|
-
*/
|
|
35
|
-
TS_SELENIUM_BASE_URL: getBaseUrl(),
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Run browser in "Headless" (hidden) mode, "false" by default.
|
|
39
|
-
*/
|
|
40
|
-
TS_SELENIUM_HEADLESS: process.env.TS_SELENIUM_HEADLESS === 'true',
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Create instance of chromedriver, "true" by default. Should be "false" to run only API tests.
|
|
44
|
-
*/
|
|
45
|
-
TS_USE_WEB_DRIVER_FOR_TEST: process.env.TS_USE_WEB_DRIVER_FOR_TEST !== 'false',
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Run browser in "Fullscreen" (kiosk) mode.
|
|
49
|
-
* Default to true if undefined
|
|
50
|
-
*/
|
|
51
|
-
TS_SELENIUM_LAUNCH_FULLSCREEN: (process.env.TS_SELENIUM_LAUNCH_FULLSCREEN !== 'false'),
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Run browser with an enabled or disabled W3C protocol (on Chrome 76 and upper, it is enabled by default), "true" by default.
|
|
55
|
-
*/
|
|
56
|
-
TS_SELENIUM_W3C_CHROME_OPTION: process.env.TS_SELENIUM_W3C_CHROME_OPTION !== 'false',
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Browser width resolution, "1920" by default.
|
|
60
|
-
*/
|
|
61
|
-
TS_SELENIUM_RESOLUTION_WIDTH: Number(process.env.TS_SELENIUM_RESOLUTION_WIDTH) || 1920,
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Browser height resolution, "1080" by default.
|
|
65
|
-
*/
|
|
66
|
-
TS_SELENIUM_RESOLUTION_HEIGHT: Number(process.env.TS_SELENIUM_RESOLUTION_HEIGHT) || 1080,
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Editor the tests are running against, "code" by default.
|
|
70
|
-
* Possible values: "che-code"
|
|
71
|
-
*/
|
|
72
|
-
TS_SELENIUM_EDITOR: process.env.TS_SELENIUM_EDITOR || 'che-code',
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Base version of VSCode editor for monaco-page-objects, "1.37.0" by default.
|
|
76
|
-
*/
|
|
77
|
-
TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION: process.env.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION || '1.37.0',
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Latest compatible version to be used, based on versions available in
|
|
81
|
-
* https://github.com/redhat-developer/vscode-extension-tester/tree/master/locators/lib ,
|
|
82
|
-
* "1.73.0" by default.
|
|
83
|
-
*/
|
|
84
|
-
TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION: process.env.TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION || '1.73.0',
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Default amount of tries, "5" by default.
|
|
88
|
-
*/
|
|
89
|
-
TS_SELENIUM_DEFAULT_ATTEMPTS: Number(process.env.TS_SELENIUM_DEFAULT_ATTEMPTS) || 5,
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Default delay in milliseconds between tries, "1000" by default.
|
|
93
|
-
*/
|
|
94
|
-
TS_SELENIUM_DEFAULT_POLLING: Number(process.env.TS_SELENIUM_DEFAULT_POLLING) || 1000,
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Amount of tries for checking workspace status.
|
|
98
|
-
*/
|
|
99
|
-
TS_SELENIUM_WORKSPACE_STATUS_ATTEMPTS: Number(process.env.TS_SELENIUM_WORKSPACE_STATUS_ATTEMPTS) || 90,
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Delay in milliseconds between checking workspace status tries.
|
|
103
|
-
*/
|
|
104
|
-
TS_SELENIUM_WORKSPACE_STATUS_POLLING: Number(process.env.TS_SELENIUM_WORKSPACE_STATUS_POLLING) || 10000,
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Name of workspace created for 'Happy Path' scenario validation.
|
|
108
|
-
*/
|
|
109
|
-
TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME: process.env.TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME || 'EmptyWorkspace',
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Value of OpenShift oAuth property determines how to login in installed application,
|
|
113
|
-
* if 'false' as an user of application, if 'true' as a regular user of OCP.
|
|
114
|
-
*/
|
|
115
|
-
TS_SELENIUM_VALUE_OPENSHIFT_OAUTH: process.env.TS_SELENIUM_VALUE_OPENSHIFT_OAUTH === 'true',
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Log into OCP by using appropriate provider title.
|
|
119
|
-
*/
|
|
120
|
-
TS_OCP_LOGIN_PAGE_PROVIDER_TITLE: process.env.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE || '',
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Path to folder with load tests execution report.
|
|
124
|
-
*/
|
|
125
|
-
TS_SELENIUM_LOAD_TEST_REPORT_FOLDER: process.env.TS_SELENIUM_LOAD_TEST_REPORT_FOLDER || './load-test-folder',
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Regular username used to login in OCP.
|
|
129
|
-
*/
|
|
130
|
-
TS_SELENIUM_OCP_USERNAME: process.env.TS_SELENIUM_OCP_USERNAME || '',
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Password regular user used to login in OCP.
|
|
134
|
-
*/
|
|
135
|
-
TS_SELENIUM_OCP_PASSWORD: process.env.TS_SELENIUM_OCP_PASSWORD || '',
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Delay between screenshots catching in the milliseconds for the execution screencast.
|
|
139
|
-
*/
|
|
140
|
-
TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS: Number(process.env.TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS) || 1000,
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Path to folder with tests execution report.
|
|
144
|
-
*/
|
|
145
|
-
TS_SELENIUM_REPORT_FOLDER: process.env.TS_SELENIUM_REPORT_FOLDER || './report',
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Enable or disable storing of execution screencast, "false" by default.
|
|
149
|
-
*/
|
|
150
|
-
TS_SELENIUM_EXECUTION_SCREENCAST: process.env.TS_SELENIUM_EXECUTION_SCREENCAST === 'true',
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Delete screencast after execution if all tests passed, "true" by default.
|
|
154
|
-
*/
|
|
155
|
-
DELETE_SCREENCAST_IF_TEST_PASS: process.env.DELETE_SCREENCAST_IF_TEST_PASS !== 'false',
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Remote driver URL.
|
|
159
|
-
*/
|
|
160
|
-
TS_SELENIUM_REMOTE_DRIVER_URL: process.env.TS_SELENIUM_REMOTE_DRIVER_URL || '',
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Stop and remove workspace if a test fails.
|
|
164
|
-
*/
|
|
165
|
-
DELETE_WORKSPACE_ON_FAILED_TEST: process.env.DELETE_WORKSPACE_ON_FAILED_TEST === 'true',
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Log level settings, possible variants: 'INFO' (by default), 'DEBUG', 'TRACE'.
|
|
169
|
-
*/
|
|
170
|
-
TS_SELENIUM_LOG_LEVEL: process.env.TS_SELENIUM_LOG_LEVEL || 'INFO',
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Enable Axios request interceptor, false by default
|
|
174
|
-
*/
|
|
175
|
-
TS_SELENIUM_REQUEST_INTERCEPTOR: process.env.TS_SELENIUM_REQUEST_INTERCEPTOR === 'true',
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Enable Axios response interceptor, false by default
|
|
179
|
-
*/
|
|
180
|
-
TS_SELENIUM_RESPONSE_INTERCEPTOR: process.env.TS_SELENIUM_RESPONSE_INTERCEPTOR === 'true',
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Running test suite - possible variants can be found in package.json scripts part.
|
|
184
|
-
*/
|
|
185
|
-
TEST_SUITE: process.env.TEST_SUITE || 'userstory',
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Print all timeout variables when tests launch, default to false
|
|
189
|
-
*/
|
|
190
|
-
TS_SELENIUM_PRINT_TIMEOUT_VARIABLES: process.env.TS_SELENIUM_PRINT_TIMEOUT_VARIABLES || false,
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* URL of the workspace created by devworkspace-controller
|
|
194
|
-
*/
|
|
195
|
-
TS_SELENIUM_DEVWORKSPACE_URL: process.env.TS_SELENIUM_DEVWORKSPACE_URL,
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* This variable specifies that run test is used for load testing and that all artifacts will be sent to ftp client.
|
|
199
|
-
*/
|
|
200
|
-
TS_LOAD_TESTS: process.env.TS_LOAD_TESTS || 'false',
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Constant, which prolong timeout constants for local debug.
|
|
204
|
-
*/
|
|
205
|
-
TS_DEBUG_MODE: process.env.TS_DEBUG_MODE === 'true',
|
|
206
|
-
|
|
207
|
-
E2E_OCP_CLUSTER_VERSION: process.env.E2E_OCP_CLUSTER_VERSION || '4.x',
|
|
208
|
-
|
|
209
|
-
TS_SAMPLE_LIST: process.env.TS_SAMPLE_LIST || 'Node.js MongoDB,Node.js Express',
|
|
210
|
-
|
|
211
|
-
/* -------------------------------------------
|
|
212
|
-
| The factory tests related constants
|
|
213
|
-
----------------------------------------------*/
|
|
214
|
-
TS_SELENIUM_FACTORY_GIT_PROVIDER: process.env.TS_SELENIUM_FACTORY_GIT_PROVIDER || GitProviderType.GITHUB,
|
|
215
|
-
|
|
216
|
-
TS_SELENIUM_FACTORY_GIT_REPO_URL: process.env.TS_SELENIUM_FACTORY_GIT_REPO_URL || '',
|
|
217
|
-
|
|
218
|
-
TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO: process.env.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO === 'true',
|
|
219
|
-
|
|
220
|
-
TS_SELENIUM_FACTORY_GIT_REPO_BRANCH: process.env.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH || 'master',
|
|
221
|
-
|
|
222
|
-
TS_SELENIUM_FACTORY_URL(): string {
|
|
223
|
-
return process.env.TS_SELENIUM_FACTORY_URL || TestConstants.TS_SELENIUM_BASE_URL + '/dashboard/#/' + this.TS_SELENIUM_FACTORY_GIT_REPO_URL;
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
TS_SELENIUM_GIT_PROVIDER_USERNAME: process.env.TS_SELENIUM_GIT_PROVIDER_USERNAME || '',
|
|
227
|
-
|
|
228
|
-
TS_SELENIUM_GIT_PROVIDER_PASSWORD: process.env.TS_SELENIUM_GIT_PROVIDER_PASSWORD || '',
|
|
229
|
-
|
|
230
|
-
TS_SELENIUM_GIT_PROVIDER_IS_LDAP_LOGIN: process.env.TS_SELENIUM_GIT_PROVIDER_IS_LDAP_LOGIN === 'true',
|
|
231
|
-
|
|
232
|
-
TS_SELENIUM_GIT_PROVIDER_OAUTH: process.env.TS_SELENIUM_GIT_PROVIDER_OAUTH === 'true',
|
|
233
|
-
|
|
234
|
-
TS_SELENIUM_PROJECT_ROOT_FILE_NAME: process.env.TS_SELENIUM_PROJECT_ROOT_FILE_NAME || 'devfile.yaml',
|
|
235
|
-
|
|
236
|
-
/* -------------------------------------------
|
|
237
|
-
| The api tests related constants
|
|
238
|
-
----------------------------------------------*/
|
|
239
|
-
|
|
240
|
-
TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL: process.env.TS_API_TEST_KUBERNETES_COMMAND_LINE_TOOL || KubernetesCommandLineTool.OC,
|
|
241
|
-
|
|
242
|
-
TS_API_TEST_UDI_IMAGE: process.env.TS_API_TEST_UDI_IMAGE || 'quay.io/devfile/universal-developer-image:latest',
|
|
243
|
-
|
|
244
|
-
TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI: process.env.TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI || `https://eclipse-che.github.io/che-plugin-registry/main/v3/plugins/che-incubator/che-code/latest/devfile.yaml`,
|
|
245
|
-
|
|
246
|
-
TS_API_TEST_NAMESPACE: process.env.TS_API_TEST_NAMESPACE || undefined
|
|
247
|
-
};
|