@eclipse-che/che-e2e 7.76.0-next-6068ce8 → 7.76.0-next-9fb1a12
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/CODE_STYLE.md +1 -1
- package/configs/inversify.config.ts +1 -7
- package/configs/mocharc.ts +11 -5
- package/configs/reporters.config.js +51 -0
- package/configs/sh-scripts/runFunctionalTests.sh +104 -0
- package/constants/API_TEST_CONSTANTS.ts +5 -2
- package/constants/BASE_TEST_CONSTANTS.ts +37 -7
- package/constants/MOCHA_CONSTANTS.ts +12 -2
- package/constants/REPORTER_CONSTANTS.ts +98 -5
- package/constants/TIMEOUT_CONSTANTS.ts +10 -22
- package/dist/configs/inversify.config.js +0 -5
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/mocharc.js +18 -13
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/API_TEST_CONSTANTS.js +3 -2
- package/dist/constants/API_TEST_CONSTANTS.js.map +1 -1
- package/dist/constants/BASE_TEST_CONSTANTS.js +22 -0
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -1
- package/dist/constants/MOCHA_CONSTANTS.js +8 -4
- package/dist/constants/MOCHA_CONSTANTS.js.map +1 -1
- package/dist/constants/REPORTER_CONSTANTS.js +70 -2
- package/dist/constants/REPORTER_CONSTANTS.js.map +1 -1
- package/dist/constants/TIMEOUT_CONSTANTS.js +0 -8
- package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -1
- package/dist/specs/MochaHooks.js +14 -3
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +1 -1
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js +2 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +9 -7
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +2 -5
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.js +97 -0
- package/dist/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.js.map +1 -0
- package/dist/specs/api/PodOverridesAPI.spec.js +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Documentation.spec.js +1 -1
- package/dist/specs/dashboard-samples/Documentation.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +2 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +2 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +1 -1
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js +1 -1
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js.map +1 -1
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js +3 -2
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +2 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js +6 -1
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js.map +1 -1
- package/dist/specs/web-terminal/WebTerminalTest.spec.js +2 -1
- package/dist/specs/web-terminal/WebTerminalTest.spec.js.map +1 -1
- package/dist/suites/disconnected-ocp/APITest.suite.js +14 -0
- package/dist/suites/disconnected-ocp/APITest.suite.js.map +1 -0
- package/dist/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.js +13 -0
- package/dist/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.js.map +1 -0
- package/dist/suites/disconnected-ocp/UITest.suite.js +19 -0
- package/dist/suites/disconnected-ocp/UITest.suite.js.map +1 -0
- package/dist/suites/online-ocp/APITest.suite.js +15 -0
- package/dist/suites/online-ocp/APITest.suite.js.map +1 -0
- package/dist/suites/online-ocp/DynamicallyGeneratingAPITest.suite.js +13 -0
- package/dist/suites/online-ocp/DynamicallyGeneratingAPITest.suite.js.map +1 -0
- package/dist/suites/online-ocp/UITest.suite.js +22 -0
- package/dist/suites/online-ocp/UITest.suite.js.map +1 -0
- package/dist/tests-library/LoginTests.js +3 -1
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +44 -2
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +22 -8
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +15 -14
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/package.json +11 -8
- package/specs/MochaHooks.ts +15 -3
- package/specs/SmokeTest.spec.ts +1 -1
- package/specs/api/ContainerOverridesAPI.spec.ts +2 -1
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +10 -8
- package/specs/api/EmptyWorkspaceAPI.spec.ts +2 -6
- package/specs/api/InbuiltApplicationDevWorkspacesAPI.spec.ts +130 -0
- package/specs/api/PodOverridesAPI.spec.ts +1 -1
- package/specs/dashboard-samples/Documentation.spec.ts +1 -1
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +2 -1
- package/specs/dashboard-samples/Quarkus.spec.ts +1 -1
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +2 -1
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +1 -1
- package/specs/factory/Factory.spec.ts +1 -1
- package/specs/factory/NoSetupRepoFactory.spec.ts +1 -1
- package/specs/factory/RefusedOAuthFactory.spec.ts +1 -1
- package/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.ts +1 -1
- package/specs/miscellaneous/KubedockPodmanTest.spec.ts +63 -59
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +2 -1
- package/specs/miscellaneous/WorkspaceWithParent.spec.ts +9 -2
- package/specs/web-terminal/WebTerminalTest.spec.ts +2 -1
- package/suites/disconnected-ocp/APITest.suite.ts +11 -0
- package/suites/disconnected-ocp/DynamicallyGeneratingAPITest.suite.ts +10 -0
- package/suites/disconnected-ocp/UITest.suite.ts +16 -0
- package/suites/online-ocp/APITest.suite.ts +12 -0
- package/suites/online-ocp/DynamicallyGeneratingAPITest.suite.ts +10 -0
- package/suites/online-ocp/UITest.suite.ts +19 -0
- package/tests-library/LoginTests.ts +6 -1
- package/tsconfig.json +1 -1
- package/utils/DevWorkspaceConfigurationHelper.ts +36 -3
- package/utils/DevfilesRegistryHelper.ts +28 -9
- package/utils/IKubernetesCommandLineToolsExecutor.ts +1 -1
- package/utils/KubernetesCommandLineToolsExecutor.ts +14 -14
- package/configs/reporters-config.json +0 -6
|
@@ -33,11 +33,12 @@ import { expect } from 'chai';
|
|
|
33
33
|
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
34
34
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
35
35
|
import { PLUGIN_TEST_CONSTANTS } from '../../constants/PLUGIN_TEST_CONSTANTS';
|
|
36
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
36
37
|
|
|
37
38
|
const samples: string[] = PLUGIN_TEST_CONSTANTS.TS_SAMPLE_LIST.split(',');
|
|
38
39
|
|
|
39
40
|
for (const sample of samples) {
|
|
40
|
-
suite(`Check if recommended extensions installed for ${sample}`, function (): void {
|
|
41
|
+
suite(`Check if recommended extensions installed for ${sample} ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
41
42
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
42
43
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
43
44
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
@@ -25,7 +25,7 @@ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
|
25
25
|
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
26
26
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
27
27
|
|
|
28
|
-
suite(
|
|
28
|
+
suite(`DevConsole Integration ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
29
29
|
let ocpImportPage: OcpImportFromGitPage;
|
|
30
30
|
let ocpApplicationPage: OcpApplicationPage;
|
|
31
31
|
|
|
@@ -39,7 +39,7 @@ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
|
39
39
|
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
40
40
|
|
|
41
41
|
suite(
|
|
42
|
-
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository`,
|
|
42
|
+
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
|
|
43
43
|
function (): void {
|
|
44
44
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
45
45
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -41,7 +41,7 @@ import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
|
41
41
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
42
42
|
|
|
43
43
|
suite(
|
|
44
|
-
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without PAT/OAuth setup`,
|
|
44
|
+
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without PAT/OAuth setup ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
|
|
45
45
|
function (): void {
|
|
46
46
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
47
47
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -40,7 +40,7 @@ import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
|
40
40
|
import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
41
41
|
|
|
42
42
|
suite(
|
|
43
|
-
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access`,
|
|
43
|
+
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
|
|
44
44
|
function (): void {
|
|
45
45
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
46
46
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -23,7 +23,7 @@ import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
|
23
23
|
const stackName: string = BASE_TEST_CONSTANTS.TS_SELENIUM_DASHBOARD_SAMPLE_NAME || 'Python';
|
|
24
24
|
const projectName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_PROJECT_NAME || 'python-hello-world';
|
|
25
25
|
|
|
26
|
-
suite(
|
|
26
|
+
suite(`"Start workspace with existed workspace name" test ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
27
27
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
28
28
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
29
29
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
@@ -18,75 +18,79 @@ import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
|
18
18
|
import { expect } from 'chai';
|
|
19
19
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
20
20
|
import { ShellString } from 'shelljs';
|
|
21
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
21
22
|
|
|
22
|
-
suite(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
suite(
|
|
24
|
+
`Check possibility to manage containers within a workspace with kubedock and podman ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
|
|
25
|
+
function (): void {
|
|
26
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
27
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
28
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
29
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
30
|
+
let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
|
|
31
|
+
let workspaceName: string = '';
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
const testScript: string =
|
|
34
|
+
'# Enable Kubedock\n' +
|
|
35
|
+
'export KUBEDOCK_ENABLED=true\n' +
|
|
36
|
+
'echo KUBEDOCK_ENABLED\n' +
|
|
37
|
+
'/entrypoint.sh\n' +
|
|
38
|
+
'cd $PROJECT_SOURCE\n' +
|
|
39
|
+
'export USER=$(oc whoami)\n' +
|
|
40
|
+
'export TKN=$(oc whoami -t)\n' +
|
|
41
|
+
'export REG="image-registry.openshift-image-registry.svc:5000"\n' +
|
|
42
|
+
'export PROJECT=$(oc project -q)\n' +
|
|
43
|
+
'export IMG="${REG}/${PROJECT}/hello"\n' +
|
|
44
|
+
'podman login --tls-verify=false --username ${USER} --password ${TKN} ${REG}\n' +
|
|
45
|
+
'podman build -t ${IMG} .\n' +
|
|
46
|
+
'podman push --tls-verify=false ${IMG}\n' +
|
|
47
|
+
'podman run --rm ${IMG}';
|
|
45
48
|
|
|
46
|
-
|
|
49
|
+
const factoryUrl: string = 'https://github.com/l0rd/dockerfile-hello-world';
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
loginTests.loginIntoChe();
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
test(`Create and open new workspace from factory:${factoryUrl}`, async function (): Promise<void> {
|
|
54
|
+
await workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
|
|
55
|
+
});
|
|
53
56
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
58
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
59
|
+
workspaceName = WorkspaceHandlingTests.getWorkspaceName();
|
|
60
|
+
expect(workspaceName, 'Workspace name was not fetched from the loading page').not.undefined;
|
|
61
|
+
});
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
test('Register running workspace', function (): void {
|
|
64
|
+
registerRunningWorkspace(workspaceName);
|
|
65
|
+
});
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
test('Wait workspace readiness', async function (): Promise<void> {
|
|
68
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
69
|
+
});
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
test('Check the project files were imported', async function (): Promise<void> {
|
|
72
|
+
const projectSection: ViewSection = await projectAndFileTests.getProjectViewSession();
|
|
73
|
+
expect(await projectAndFileTests.getProjectTreeItem(projectSection, 'Dockerfile'), 'Files not imported').not.undefined;
|
|
74
|
+
});
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
test('Create and check container runs using kubedock and podman', function (): void {
|
|
77
|
+
kubernetesCommandLineToolsExecutor = e2eContainer.get(CLASSES.KubernetesCommandLineToolsExecutor);
|
|
78
|
+
kubernetesCommandLineToolsExecutor.workspaceName = workspaceName;
|
|
79
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
80
|
+
kubernetesCommandLineToolsExecutor.getPodAndContainerNames();
|
|
81
|
+
const output: ShellString = kubernetesCommandLineToolsExecutor.execInContainerCommand(testScript);
|
|
82
|
+
expect(output, 'Podman test script failed').contains('Hello from Kubedock!');
|
|
83
|
+
});
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
test('Stop the workspace', async function (): Promise<void> {
|
|
86
|
+
await workspaceHandlingTests.stopWorkspace(workspaceName);
|
|
87
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
88
|
+
});
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
test('Delete the workspace', async function (): Promise<void> {
|
|
91
|
+
await workspaceHandlingTests.removeWorkspace(workspaceName);
|
|
92
|
+
});
|
|
90
93
|
|
|
91
|
-
|
|
92
|
-
}
|
|
94
|
+
loginTests.logoutFromChe();
|
|
95
|
+
}
|
|
96
|
+
);
|
|
@@ -16,8 +16,9 @@ import { LoginTests } from '../../tests-library/LoginTests';
|
|
|
16
16
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
17
17
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
18
18
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
19
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
19
20
|
|
|
20
|
-
suite(
|
|
21
|
+
suite(`Create predefined workspace and check it ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
21
22
|
const predefinedNamespaceName: string = 'predefined-ns';
|
|
22
23
|
const stackName: string = 'Empty Workspace';
|
|
23
24
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
11
11
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
12
12
|
import { InputBox, QuickOpenBox, QuickPickItem, ViewItem, ViewSection, Workbench } from 'monaco-page-objects';
|
|
13
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
13
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
14
14
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
15
15
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
16
16
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
@@ -21,13 +21,15 @@ import { API_TEST_CONSTANTS } from '../../constants/API_TEST_CONSTANTS';
|
|
|
21
21
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
22
22
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
23
23
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
24
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
24
25
|
|
|
25
|
-
suite(
|
|
26
|
+
suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
26
27
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
27
28
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
28
29
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
29
30
|
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
30
31
|
const shellExecutor: ShellExecutor = e2eContainer.get(CLASSES.ShellExecutor);
|
|
32
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
31
33
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
32
34
|
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
|
|
33
35
|
CLASSES.KubernetesCommandLineToolsExecutor
|
|
@@ -96,5 +98,10 @@ suite('Workspace using a parent test suite', function (): void {
|
|
|
96
98
|
expect(envList).contains('DEVFILE_ENV_VAR=true').and.contains('PARENT_ENV_VAR=true');
|
|
97
99
|
});
|
|
98
100
|
|
|
101
|
+
test('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
102
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
103
|
+
testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
104
|
+
});
|
|
105
|
+
|
|
99
106
|
loginTests.logoutFromChe();
|
|
100
107
|
});
|
|
@@ -11,8 +11,9 @@ import { CLASSES } from '../../configs/inversify.types';
|
|
|
11
11
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
12
12
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
13
13
|
import { OcpMainPage } from '../../pageobjects/openshift/OcpMainPage';
|
|
14
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
14
15
|
|
|
15
|
-
suite(
|
|
16
|
+
suite(`Login to Openshift console and start WebTerminal ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
16
17
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
17
18
|
const ocpMainPage: OcpMainPage = e2eContainer.get(CLASSES.OcpMainPage);
|
|
18
19
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import '../../specs/api/ContainerOverridesAPI.spec';
|
|
11
|
+
import '../../specs/api/PodOverridesAPI.spec';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import '../../specs/api/InbuiltApplicationDevWorkspacesAPI.spec';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import '../../specs/dashboard-samples/Quarkus.spec';
|
|
11
|
+
import '../../specs/dashboard-samples/RecommendedExtensions.spec';
|
|
12
|
+
import '../../specs/dashboard-samples/Documentation.spec';
|
|
13
|
+
import '../../specs/devconsole-intergration/DevConsoleIntegration.spec';
|
|
14
|
+
import '../../specs/miscellaneous/CreateWorkspaceWithExistedName.spec';
|
|
15
|
+
import '../../specs/miscellaneous/PredefinedNamespace.spec';
|
|
16
|
+
import '../../specs/miscellaneous/WorkspaceWithParent.spec';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import '../../specs/api/ContainerOverridesAPI.spec';
|
|
11
|
+
import '../../specs/api/EmptyWorkspaceAPI.spec';
|
|
12
|
+
import '../../specs/api/PodOverridesAPI.spec';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import '../../specs/api/InbuiltApplicationDevWorkspacesAPI.spec';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import '../../specs/SmokeTest.spec';
|
|
11
|
+
import '../../specs/dashboard-samples/EmptyWorkspace.spec';
|
|
12
|
+
import '../../specs/dashboard-samples/Quarkus.spec';
|
|
13
|
+
import '../../specs/dashboard-samples/RecommendedExtensions.spec';
|
|
14
|
+
import '../../specs/dashboard-samples/Documentation.spec';
|
|
15
|
+
import '../../specs/devconsole-intergration/DevConsoleIntegration.spec';
|
|
16
|
+
import '../../specs/miscellaneous/CreateWorkspaceWithExistedName.spec';
|
|
17
|
+
import '../../specs/miscellaneous/KubedockPodmanTest.spec';
|
|
18
|
+
import '../../specs/miscellaneous/PredefinedNamespace.spec';
|
|
19
|
+
import '../../specs/miscellaneous/WorkspaceWithParent.spec';
|
|
@@ -15,6 +15,7 @@ import { inject, injectable } from 'inversify';
|
|
|
15
15
|
import { Dashboard } from '../pageobjects/dashboard/Dashboard';
|
|
16
16
|
import { IOcpLoginPage } from '../pageobjects/login/interfaces/IOcpLoginPage';
|
|
17
17
|
import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';
|
|
18
|
+
import { registerRunningWorkspace } from '../specs/MochaHooks';
|
|
18
19
|
|
|
19
20
|
@injectable()
|
|
20
21
|
export class LoginTests {
|
|
@@ -40,7 +41,10 @@ export class LoginTests {
|
|
|
40
41
|
|
|
41
42
|
loginIntoOcpConsole(): void {
|
|
42
43
|
test('Login into ocp console', async (): Promise<void> => {
|
|
43
|
-
const openshiftConsoleUrl: string = BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.replace(
|
|
44
|
+
const openshiftConsoleUrl: string = BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.replace(
|
|
45
|
+
BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME(),
|
|
46
|
+
'console-openshift-console'
|
|
47
|
+
);
|
|
44
48
|
await this.browserTabsUtil.navigateTo(openshiftConsoleUrl);
|
|
45
49
|
await this.ocpLoginPage.login();
|
|
46
50
|
await this.browserTabsUtil.maximize();
|
|
@@ -50,6 +54,7 @@ export class LoginTests {
|
|
|
50
54
|
logoutFromChe(): void {
|
|
51
55
|
test('Logout', async (): Promise<void> => {
|
|
52
56
|
await this.dashboard.logout();
|
|
57
|
+
registerRunningWorkspace('');
|
|
53
58
|
});
|
|
54
59
|
}
|
|
55
60
|
}
|
package/tsconfig.json
CHANGED
|
@@ -19,12 +19,16 @@ import { injectable } from 'inversify';
|
|
|
19
19
|
import { IContextParams } from './IContextParams';
|
|
20
20
|
import { e2eContainer } from '../configs/inversify.config';
|
|
21
21
|
import { CLASSES, EXTERNAL_CLASSES } from '../configs/inversify.types';
|
|
22
|
+
import getDecorators from 'inversify-inject-decorators';
|
|
23
|
+
|
|
24
|
+
const { lazyInject } = getDecorators(e2eContainer);
|
|
22
25
|
|
|
23
26
|
@injectable()
|
|
24
27
|
export class DevWorkspaceConfigurationHelper {
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
+
@lazyInject(EXTERNAL_CLASSES.Generator)
|
|
29
|
+
private readonly generator!: Generator;
|
|
30
|
+
@lazyInject(CLASSES.ShellExecutor)
|
|
31
|
+
private readonly shellExecutor!: ShellExecutor;
|
|
28
32
|
private readonly params: IContextParams;
|
|
29
33
|
|
|
30
34
|
constructor(params: IContextParams) {
|
|
@@ -52,6 +56,7 @@ export class DevWorkspaceConfigurationHelper {
|
|
|
52
56
|
|
|
53
57
|
async generateDevfileContext(): Promise<DevfileContext> {
|
|
54
58
|
Logger.debug();
|
|
59
|
+
|
|
55
60
|
if (!this.params.projects) {
|
|
56
61
|
this.params.projects = [];
|
|
57
62
|
}
|
|
@@ -67,6 +72,7 @@ export class DevWorkspaceConfigurationHelper {
|
|
|
67
72
|
// write templates and then DevWorkspace in a single file
|
|
68
73
|
getDevWorkspaceConfigurationYamlAsString(context: DevfileContext): string {
|
|
69
74
|
Logger.debug();
|
|
75
|
+
|
|
70
76
|
const allContentArray: any[] = context.devWorkspaceTemplates.map((template: V1alpha2DevWorkspaceTemplate): string =>
|
|
71
77
|
YAML.stringify(template)
|
|
72
78
|
);
|
|
@@ -74,4 +80,31 @@ export class DevWorkspaceConfigurationHelper {
|
|
|
74
80
|
|
|
75
81
|
return allContentArray.join('---\n');
|
|
76
82
|
}
|
|
83
|
+
|
|
84
|
+
getDevWorkspaceConfigurationsAsYaml(allContentString: string): string {
|
|
85
|
+
Logger.debug();
|
|
86
|
+
const content: any = {};
|
|
87
|
+
const contentArray: string[] = allContentString.split('---\n');
|
|
88
|
+
contentArray.forEach((e: any): void => {
|
|
89
|
+
e = YAML.parse(e);
|
|
90
|
+
e.kind === 'DevWorkspace'
|
|
91
|
+
? (content.DevWorkspace = e)
|
|
92
|
+
: e.kind === 'DevWorkspaceTemplate'
|
|
93
|
+
? (content.DevWorkspaceTemplate = e)
|
|
94
|
+
: Logger.error(
|
|
95
|
+
'Problems with configuration parsing, string should be in format "DevWorkspace\\n---\\nDevWorkspaceTemplate"'
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
return content;
|
|
100
|
+
}
|
|
101
|
+
patchDevWorkspaceConfigWithBuildContainerAttribute(devfileContextDevWorkspace: any): void {
|
|
102
|
+
Logger.debug();
|
|
103
|
+
devfileContextDevWorkspace.spec.template.attributes = YAML.parse(`
|
|
104
|
+
controller.devfile.io/devworkspace-config:
|
|
105
|
+
name: devworkspace-config
|
|
106
|
+
namespace: openshift-devspaces
|
|
107
|
+
controller.devfile.io/scc: container-build
|
|
108
|
+
controller.devfile.io/storage-type: per-user`);
|
|
109
|
+
}
|
|
77
110
|
}
|
|
@@ -12,13 +12,17 @@ import { Logger } from './Logger';
|
|
|
12
12
|
import YAML from 'yaml';
|
|
13
13
|
import { API_TEST_CONSTANTS, SUPPORTED_DEVFILE_REGISTRIES } from '../constants/API_TEST_CONSTANTS';
|
|
14
14
|
import { injectable } from 'inversify';
|
|
15
|
+
import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';
|
|
15
16
|
|
|
16
17
|
@injectable()
|
|
17
18
|
export class DevfilesRegistryHelper {
|
|
18
|
-
async getInbuiltDevfilesRegistryContent(): Promise<
|
|
19
|
+
async getInbuiltDevfilesRegistryContent(sampleNamePatterns?: string[]): Promise<any[]> {
|
|
19
20
|
Logger.trace();
|
|
20
21
|
|
|
21
|
-
return
|
|
22
|
+
return this.filterSamples(
|
|
23
|
+
sampleNamePatterns,
|
|
24
|
+
await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.INBUILT_APPLICATION_DEVFILE_REGISTRY_URL())
|
|
25
|
+
);
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
async getGitHubCheDevfileRegistryContent(): Promise<AxiosResponse> {
|
|
@@ -27,13 +31,13 @@ export class DevfilesRegistryHelper {
|
|
|
27
31
|
return await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL);
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
async collectPathsToDevfilesFromRegistry(): Promise<object[]> {
|
|
34
|
+
async collectPathsToDevfilesFromRegistry(isInbuilt: boolean = true, sampleNamePatterns?: string[]): Promise<object[]> {
|
|
31
35
|
Logger.debug();
|
|
32
36
|
|
|
33
37
|
const devfileSamples: object[] = [];
|
|
34
38
|
const sampleNames: string[] = [];
|
|
35
|
-
switch (
|
|
36
|
-
case
|
|
39
|
+
switch (isInbuilt) {
|
|
40
|
+
case false:
|
|
37
41
|
{
|
|
38
42
|
const content: any[any] = await this.getGitHubCheDevfileRegistryContent();
|
|
39
43
|
content.forEach((e: any): void => {
|
|
@@ -55,14 +59,17 @@ export class DevfilesRegistryHelper {
|
|
|
55
59
|
Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
56
60
|
}
|
|
57
61
|
break;
|
|
58
|
-
case
|
|
62
|
+
case true:
|
|
59
63
|
{
|
|
60
|
-
const content: any[any] = await this.getInbuiltDevfilesRegistryContent();
|
|
61
|
-
|
|
64
|
+
const content: any[any] = await this.getInbuiltDevfilesRegistryContent(sampleNamePatterns);
|
|
62
65
|
for (const sample of content) {
|
|
66
|
+
const linkToDevWorkspaceYaml: any =
|
|
67
|
+
BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL +
|
|
68
|
+
'/devfile-registry' +
|
|
69
|
+
sample.links.devWorkspaces['che-incubator/che-code/latest'];
|
|
63
70
|
devfileSamples.push({
|
|
64
71
|
name: sample.displayName,
|
|
65
|
-
|
|
72
|
+
devWorkspaceConfigurationString: await this.getContent(linkToDevWorkspaceYaml)
|
|
66
73
|
});
|
|
67
74
|
}
|
|
68
75
|
Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
@@ -76,6 +83,18 @@ export class DevfilesRegistryHelper {
|
|
|
76
83
|
return devfileSamples;
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
async getEditorContent(entry: string): Promise<any> {
|
|
87
|
+
return await this.getContent(`${BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL}/${entry}`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private filterSamples(sampleNamePatterns: string[] | undefined, content: any): Promise<any[]> {
|
|
91
|
+
if (sampleNamePatterns) {
|
|
92
|
+
const commonSampleNamePattern: RegExp = new RegExp(sampleNamePatterns.join('|'), 'i');
|
|
93
|
+
content = content.filter((e: any): boolean => commonSampleNamePattern.test(e.displayName));
|
|
94
|
+
}
|
|
95
|
+
return content;
|
|
96
|
+
}
|
|
97
|
+
|
|
79
98
|
private async getContent(url: string, headers?: object): Promise<AxiosResponse> {
|
|
80
99
|
Logger.trace(`${url}`);
|
|
81
100
|
|
|
@@ -20,7 +20,7 @@ export interface IKubernetesCommandLineToolsExecutor {
|
|
|
20
20
|
|
|
21
21
|
applyAndWaitDevWorkspace(yamlConfiguration: string): ShellString;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
execInContainerCommand(commandToExecute: string, container: string): ShellString;
|
|
24
24
|
|
|
25
25
|
applyYamlConfigurationAsStringOutput(yamlConfiguration: string): ShellString;
|
|
26
26
|
|
|
@@ -46,14 +46,14 @@ export class KubernetesCommandLineToolsExecutor implements IKubernetesCommandLin
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
get namespace(): string | undefined {
|
|
49
|
-
this._namespace
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
if (!this._namespace) {
|
|
50
|
+
const applicationName: string = BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME();
|
|
51
|
+
if (applicationName === 'default') {
|
|
52
|
+
this._namespace = applicationName;
|
|
53
|
+
} else {
|
|
54
|
+
this._namespace = OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME + '-' + applicationName;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
57
|
return this._namespace;
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -114,7 +114,7 @@ export class KubernetesCommandLineToolsExecutor implements IKubernetesCommandLin
|
|
|
114
114
|
return this.waitDevWorkspace();
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
execInContainerCommand(commandToExecute: string, container: string = KubernetesCommandLineToolsExecutor.container): ShellString {
|
|
118
118
|
Logger.debug(`${this.kubernetesCommandLineTool}`);
|
|
119
119
|
|
|
120
120
|
return this.shellExecutor.executeCommand(
|
|
@@ -217,22 +217,22 @@ export class ContainerTerminal extends KubernetesCommandLineToolsExecutor {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
ls(path: string = ''): ShellString {
|
|
220
|
-
return this.
|
|
220
|
+
return this.execInContainerCommand('ls ' + path);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
pwd(): ShellString {
|
|
224
|
-
return this.
|
|
224
|
+
return this.execInContainerCommand('pwd');
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
cd(path: string): ShellString {
|
|
228
|
-
return this.
|
|
228
|
+
return this.execInContainerCommand('cd ' + path);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
gitClone(repository: string): ShellString {
|
|
232
|
-
return this.
|
|
232
|
+
return this.execInContainerCommand('git clone ' + repository);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
removeFolder(path: string): ShellString {
|
|
236
|
-
return this.
|
|
236
|
+
return this.execInContainerCommand('rm -rf ' + path);
|
|
237
237
|
}
|
|
238
238
|
}
|