@eclipse-che/che-e2e 7.76.0-next-3240700 → 7.76.0-next-af784fc
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/configs/sh-scripts/runFunctionalTests.sh +3 -0
- package/constants/BASE_TEST_CONSTANTS.ts +6 -0
- package/dist/constants/BASE_TEST_CONSTANTS.js +4 -0
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/specs/MochaHooks.js +23 -5
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +8 -4
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Documentation.spec.js +7 -2
- package/dist/specs/dashboard-samples/Documentation.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +12 -6
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +12 -6
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +12 -6
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +18 -5
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +12 -6
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +11 -7
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +12 -6
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js +12 -7
- package/dist/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.js.map +1 -1
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js +12 -6
- package/dist/specs/miscellaneous/KubedockPodmanTest.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +45 -12
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/specs/miscellaneous/WorkspaceIdleTimeout.spec.js +15 -5
- package/dist/specs/miscellaneous/WorkspaceIdleTimeout.spec.js.map +1 -1
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js +9 -4
- package/dist/specs/miscellaneous/WorkspaceWithParent.spec.js.map +1 -1
- package/dist/suites/disconnected-ocp/UITest.suite.js +1 -1
- package/dist/suites/online-ocp/UITest.suite.js +1 -1
- package/dist/tests-library/LoginTests.js +14 -10
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +2 -5
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +8 -1
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/Logger.js +1 -1
- package/package.json +1 -1
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +1 -1
- package/specs/MochaHooks.ts +26 -5
- package/specs/SmokeTest.spec.ts +8 -4
- package/specs/dashboard-samples/Documentation.spec.ts +8 -3
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +15 -8
- package/specs/dashboard-samples/Quarkus.spec.ts +15 -7
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +15 -7
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +20 -8
- package/specs/factory/Factory.spec.ts +15 -7
- package/specs/factory/NoSetupRepoFactory.spec.ts +14 -10
- package/specs/factory/RefusedOAuthFactory.spec.ts +15 -7
- package/specs/miscellaneous/CreateWorkspaceWithExistedName.spec.ts +15 -8
- package/specs/miscellaneous/KubedockPodmanTest.spec.ts +16 -7
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +51 -14
- package/specs/miscellaneous/WorkspaceIdleTimeout.spec.ts +19 -6
- package/specs/miscellaneous/WorkspaceWithParent.spec.ts +9 -4
- package/suites/disconnected-ocp/UITest.suite.ts +1 -1
- package/suites/online-ocp/UITest.suite.ts +1 -1
- package/tests-library/LoginTests.ts +17 -10
- package/tests-library/WorkspaceHandlingTests.ts +2 -6
- package/utils/BrowserTabsUtil.ts +8 -1
- package/utils/Logger.ts +1 -1
- package/utils/workspace/ITestWorkspaceUtil.ts +7 -7
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
11
11
|
import { ViewSection } from 'monaco-page-objects';
|
|
12
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
12
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
13
13
|
import { expect } from 'chai';
|
|
14
14
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
15
15
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
@@ -19,6 +19,7 @@ import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
|
19
19
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
20
20
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
21
21
|
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
22
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
22
23
|
|
|
23
24
|
const stackName: string = BASE_TEST_CONSTANTS.TS_SELENIUM_DASHBOARD_SAMPLE_NAME || 'Python';
|
|
24
25
|
const projectName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_PROJECT_NAME || 'python-hello-world';
|
|
@@ -29,10 +30,14 @@ suite(`"Start workspace with existed workspace name" test ${BASE_TEST_CONSTANTS.
|
|
|
29
30
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
30
31
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
31
32
|
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
33
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
34
|
+
|
|
32
35
|
let projectSection: ViewSection;
|
|
33
36
|
let existedWorkspaceName: string;
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
39
|
+
await loginTests.loginIntoChe();
|
|
40
|
+
});
|
|
36
41
|
|
|
37
42
|
test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> {
|
|
38
43
|
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
@@ -76,15 +81,17 @@ suite(`"Start workspace with existed workspace name" test ${BASE_TEST_CONSTANTS.
|
|
|
76
81
|
).not.undefined;
|
|
77
82
|
});
|
|
78
83
|
|
|
79
|
-
|
|
80
|
-
await
|
|
84
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
85
|
+
await dashboard.openDashboard();
|
|
81
86
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
82
87
|
});
|
|
83
88
|
|
|
84
|
-
|
|
85
|
-
await
|
|
86
|
-
await
|
|
89
|
+
suiteTeardown(`Stop and delete all created ${stackName} workspaces by API`, async function (): Promise<void> {
|
|
90
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
91
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(existedWorkspaceName);
|
|
87
92
|
});
|
|
88
93
|
|
|
89
|
-
|
|
94
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
95
|
+
registerRunningWorkspace('');
|
|
96
|
+
});
|
|
90
97
|
});
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import { ViewSection } from 'monaco-page-objects';
|
|
11
11
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
12
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
12
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
13
13
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
14
14
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
15
15
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
@@ -19,6 +19,8 @@ import { expect } from 'chai';
|
|
|
19
19
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
20
20
|
import { ShellString } from 'shelljs';
|
|
21
21
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
22
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
23
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
22
24
|
|
|
23
25
|
suite(
|
|
24
26
|
`Check possibility to manage containers within a workspace with kubedock and podman ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
|
|
@@ -27,6 +29,9 @@ suite(
|
|
|
27
29
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
28
30
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
29
31
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
32
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
33
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
34
|
+
|
|
30
35
|
let kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor;
|
|
31
36
|
let workspaceName: string = '';
|
|
32
37
|
|
|
@@ -48,7 +53,9 @@ suite(
|
|
|
48
53
|
|
|
49
54
|
const factoryUrl: string = 'https://github.com/l0rd/dockerfile-hello-world';
|
|
50
55
|
|
|
51
|
-
|
|
56
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
57
|
+
await loginTests.loginIntoChe();
|
|
58
|
+
});
|
|
52
59
|
|
|
53
60
|
test(`Create and open new workspace from factory:${factoryUrl}`, async function (): Promise<void> {
|
|
54
61
|
await workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
|
|
@@ -82,15 +89,17 @@ suite(
|
|
|
82
89
|
expect(output, 'Podman test script failed').contains('Hello from Kubedock!');
|
|
83
90
|
});
|
|
84
91
|
|
|
85
|
-
|
|
86
|
-
await
|
|
92
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
93
|
+
await dashboard.openDashboard();
|
|
87
94
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
88
95
|
});
|
|
89
96
|
|
|
90
|
-
|
|
91
|
-
await
|
|
97
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
98
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
92
99
|
});
|
|
93
100
|
|
|
94
|
-
|
|
101
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
102
|
+
registerRunningWorkspace('');
|
|
103
|
+
});
|
|
95
104
|
}
|
|
96
105
|
);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
11
11
|
import { expect } from 'chai';
|
|
12
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
12
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
13
13
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
14
14
|
import { Logger } from '../../utils/Logger';
|
|
15
15
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
@@ -17,25 +17,33 @@ import { registerRunningWorkspace } from '../MochaHooks';
|
|
|
17
17
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
18
18
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
19
19
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
20
|
+
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
21
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
22
|
+
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
23
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
20
24
|
|
|
21
25
|
suite(`Create predefined workspace and check it ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
22
26
|
const predefinedNamespaceName: string = 'predefined-ns';
|
|
23
27
|
const stackName: string = 'Empty Workspace';
|
|
28
|
+
const userName: string = 'user';
|
|
24
29
|
|
|
30
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
31
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
25
32
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
26
33
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
27
34
|
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
|
|
28
35
|
CLASSES.KubernetesCommandLineToolsExecutor
|
|
29
36
|
);
|
|
30
37
|
const shellExecutor: ShellExecutor = e2eContainer.get(CLASSES.ShellExecutor);
|
|
38
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
31
39
|
|
|
32
40
|
suiteSetup(function (): void {
|
|
33
41
|
// create a predefined namespace for user using shell script and login into user dashboard
|
|
34
|
-
Logger.
|
|
35
|
-
Logger.
|
|
42
|
+
Logger.debug('Test prerequisites:');
|
|
43
|
+
Logger.debug(
|
|
36
44
|
' (1) there is OCP user with username and user password that have been set in the TS_SELENIUM_OCP_USERNAME and TS_SELENIUM_OCP_PASSWORD variables'
|
|
37
45
|
);
|
|
38
|
-
Logger.
|
|
46
|
+
Logger.debug(' (2) "oc" client installed and logged into test OCP cluster with admin rights.');
|
|
39
47
|
kubernetesCommandLineToolsExecutor.loginToOcp('admin');
|
|
40
48
|
const predefinedProjectConfiguration: string =
|
|
41
49
|
'kind: Namespace\n' +
|
|
@@ -52,17 +60,18 @@ suite(`Create predefined workspace and check it ${BASE_TEST_CONSTANTS.TEST_ENVIR
|
|
|
52
60
|
shellExecutor.executeCommand(setEditRightsForUser);
|
|
53
61
|
});
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
64
|
+
if (OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME === userName) {
|
|
65
|
+
await loginTests.loginIntoChe();
|
|
66
|
+
} else {
|
|
67
|
+
try {
|
|
68
|
+
await loginTests.logoutFromChe();
|
|
69
|
+
} catch (e) {
|
|
70
|
+
Logger.trace('user was not logged in.');
|
|
71
|
+
}
|
|
72
|
+
await loginTests.loginIntoChe(userName);
|
|
62
73
|
}
|
|
63
74
|
});
|
|
64
|
-
|
|
65
|
-
loginTests.loginIntoChe('user');
|
|
66
75
|
// create the Empty workspace using CHE Dashboard
|
|
67
76
|
test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> {
|
|
68
77
|
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
@@ -81,5 +90,33 @@ suite(`Create predefined workspace and check it ${BASE_TEST_CONSTANTS.TEST_ENVIR
|
|
|
81
90
|
expect(ocDevWorkspaceOutput).includes(workspaceName);
|
|
82
91
|
});
|
|
83
92
|
|
|
84
|
-
|
|
93
|
+
suiteTeardown(function (): void {
|
|
94
|
+
const workspaceName: string = WorkspaceHandlingTests.getWorkspaceName();
|
|
95
|
+
try {
|
|
96
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
97
|
+
kubernetesCommandLineToolsExecutor.deleteProject(predefinedNamespaceName);
|
|
98
|
+
} catch (e) {
|
|
99
|
+
Logger.error(`Cannot remove the predefined project: ${workspaceName}, please fix it manually: ${e}`);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
suiteTeardown('Re-login with test user', async function (): Promise<void> {
|
|
104
|
+
if (OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME !== userName) {
|
|
105
|
+
await loginTests.logoutFromChe();
|
|
106
|
+
await loginTests.loginIntoChe();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
111
|
+
await dashboard.openDashboard();
|
|
112
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
116
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
120
|
+
registerRunningWorkspace('');
|
|
121
|
+
});
|
|
85
122
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
11
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
11
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
12
12
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
13
13
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
14
14
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
@@ -22,6 +22,8 @@ import { Locators, ModalDialog } from 'monaco-page-objects';
|
|
|
22
22
|
import { expect } from 'chai';
|
|
23
23
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
24
24
|
import { ShellExecutor } from '../../utils/ShellExecutor';
|
|
25
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
26
|
+
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
25
27
|
|
|
26
28
|
suite('"Check workspace idle timeout" test', function (): void {
|
|
27
29
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -36,6 +38,8 @@ suite('"Check workspace idle timeout" test', function (): void {
|
|
|
36
38
|
CLASSES.KubernetesCommandLineToolsExecutor
|
|
37
39
|
);
|
|
38
40
|
const shellExecutor: ShellExecutor = e2eContainer.get(CLASSES.ShellExecutor);
|
|
41
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
42
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
39
43
|
|
|
40
44
|
const stackName: string = 'Empty Workspace';
|
|
41
45
|
const cheClusterName: string = 'devspaces';
|
|
@@ -65,7 +69,9 @@ suite('"Check workspace idle timeout" test', function (): void {
|
|
|
65
69
|
);
|
|
66
70
|
});
|
|
67
71
|
|
|
68
|
-
|
|
72
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
73
|
+
await loginTests.loginIntoChe();
|
|
74
|
+
});
|
|
69
75
|
|
|
70
76
|
test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> {
|
|
71
77
|
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
@@ -85,14 +91,21 @@ suite('"Check workspace idle timeout" test', function (): void {
|
|
|
85
91
|
await dialog.pushButton('Return to dashboard');
|
|
86
92
|
});
|
|
87
93
|
|
|
88
|
-
test('Check that the
|
|
94
|
+
test('Check that the workspace has Stopped state', async function (): Promise<void> {
|
|
89
95
|
await dashboard.waitPage();
|
|
90
96
|
await workspaces.waitWorkspaceWithStoppedStatus(WorkspaceHandlingTests.getWorkspaceName());
|
|
91
97
|
});
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
await dashboard.
|
|
99
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
100
|
+
await dashboard.openDashboard();
|
|
101
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
105
|
+
await testWorkspaceUtil.deleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
95
106
|
});
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
109
|
+
registerRunningWorkspace('');
|
|
110
|
+
});
|
|
98
111
|
});
|
|
@@ -41,7 +41,9 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
|
|
|
41
41
|
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
45
|
+
await loginTests.loginIntoChe();
|
|
46
|
+
});
|
|
45
47
|
|
|
46
48
|
test('Create a workspace using a parent', async function (): Promise<void> {
|
|
47
49
|
const factoryUrl: string = `${BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL}/dashboard/#https://github.com/testsfactory/parentDevfile`;
|
|
@@ -98,10 +100,13 @@ suite(`Workspace using a parent test suite ${BASE_TEST_CONSTANTS.TEST_ENVIRONMEN
|
|
|
98
100
|
expect(envList).contains('DEVFILE_ENV_VAR=true').and.contains('PARENT_ENV_VAR=true');
|
|
99
101
|
});
|
|
100
102
|
|
|
101
|
-
|
|
103
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
104
|
+
await dashboard.openDashboard();
|
|
102
105
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
103
|
-
testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
106
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
104
107
|
});
|
|
105
108
|
|
|
106
|
-
|
|
109
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
110
|
+
registerRunningWorkspace('');
|
|
111
|
+
});
|
|
107
112
|
});
|
|
@@ -12,5 +12,5 @@ import '../../specs/dashboard-samples/RecommendedExtensions.spec';
|
|
|
12
12
|
import '../../specs/dashboard-samples/Documentation.spec';
|
|
13
13
|
import '../../specs/devconsole-intergration/DevConsoleIntegration.spec';
|
|
14
14
|
import '../../specs/miscellaneous/CreateWorkspaceWithExistedName.spec';
|
|
15
|
-
import '../../specs/miscellaneous/PredefinedNamespace.spec';
|
|
16
15
|
import '../../specs/miscellaneous/WorkspaceWithParent.spec';
|
|
16
|
+
import '../../specs/miscellaneous/PredefinedNamespace.spec';
|
|
@@ -15,5 +15,5 @@ import '../../specs/dashboard-samples/Documentation.spec';
|
|
|
15
15
|
import '../../specs/devconsole-intergration/DevConsoleIntegration.spec';
|
|
16
16
|
import '../../specs/miscellaneous/CreateWorkspaceWithExistedName.spec';
|
|
17
17
|
import '../../specs/miscellaneous/KubedockPodmanTest.spec';
|
|
18
|
-
import '../../specs/miscellaneous/PredefinedNamespace.spec';
|
|
19
18
|
import '../../specs/miscellaneous/WorkspaceWithParent.spec';
|
|
19
|
+
import '../../specs/miscellaneous/PredefinedNamespace.spec';
|
|
@@ -15,7 +15,8 @@ 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 {
|
|
18
|
+
import { TIMEOUT_CONSTANTS } from '../constants/TIMEOUT_CONSTANTS';
|
|
19
|
+
import { Logger } from '../utils/Logger';
|
|
19
20
|
|
|
20
21
|
@injectable()
|
|
21
22
|
export class LoginTests {
|
|
@@ -28,19 +29,28 @@ export class LoginTests {
|
|
|
28
29
|
@inject(CLASSES.Dashboard) private readonly dashboard: Dashboard
|
|
29
30
|
) {}
|
|
30
31
|
|
|
31
|
-
loginIntoChe(
|
|
32
|
-
|
|
32
|
+
async loginIntoChe(
|
|
33
|
+
userName?: string,
|
|
34
|
+
password?: string,
|
|
35
|
+
timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT
|
|
36
|
+
): Promise<void> {
|
|
37
|
+
Logger.debug();
|
|
38
|
+
try {
|
|
33
39
|
if (!(await this.browserTabsUtil.getCurrentUrl()).includes(BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL)) {
|
|
34
40
|
await this.browserTabsUtil.navigateTo(BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL);
|
|
35
41
|
}
|
|
42
|
+
await this.dashboard.waitPage(timeout);
|
|
43
|
+
Logger.debug('user already logged in');
|
|
44
|
+
} catch (e) {
|
|
45
|
+
Logger.debug('try to login into application');
|
|
36
46
|
await this.productLoginPage.login(userName, password);
|
|
37
47
|
await this.browserTabsUtil.maximize();
|
|
38
48
|
await this.dashboard.waitStartingPageLoaderDisappearance();
|
|
39
|
-
}
|
|
49
|
+
}
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
loginIntoOcpConsole(): void {
|
|
43
|
-
|
|
53
|
+
suiteSetup('Login into ocp console', async (): Promise<void> => {
|
|
44
54
|
const openshiftConsoleUrl: string = BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL.replace(
|
|
45
55
|
BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME(),
|
|
46
56
|
'console-openshift-console'
|
|
@@ -51,10 +61,7 @@ export class LoginTests {
|
|
|
51
61
|
});
|
|
52
62
|
}
|
|
53
63
|
|
|
54
|
-
logoutFromChe(): void {
|
|
55
|
-
|
|
56
|
-
await this.dashboard.logout();
|
|
57
|
-
registerRunningWorkspace('');
|
|
58
|
-
});
|
|
64
|
+
async logoutFromChe(): Promise<void> {
|
|
65
|
+
await this.dashboard.logout();
|
|
59
66
|
}
|
|
60
67
|
}
|
|
@@ -42,12 +42,8 @@ export class WorkspaceHandlingTests {
|
|
|
42
42
|
return WorkspaceHandlingTests.workspaceName;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
WorkspaceHandlingTests.
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
getWindowHandle(): string {
|
|
50
|
-
return WorkspaceHandlingTests.parentGUID;
|
|
45
|
+
static clearWorkspaceName(): void {
|
|
46
|
+
WorkspaceHandlingTests.workspaceName = 'undefined';
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
async createAndOpenWorkspace(stack: string): Promise<void> {
|
package/utils/BrowserTabsUtil.ts
CHANGED
|
@@ -76,7 +76,14 @@ export class BrowserTabsUtil {
|
|
|
76
76
|
async getCurrentUrl(): Promise<string> {
|
|
77
77
|
Logger.trace();
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
let currentUrl: string = '';
|
|
80
|
+
try {
|
|
81
|
+
currentUrl = await this.driverHelper.getDriver().getCurrentUrl();
|
|
82
|
+
} catch (e) {
|
|
83
|
+
Logger.trace('cannot get current url');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return currentUrl;
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
async waitURL(expectedUrl: string, timeout: number): Promise<void> {
|
package/utils/Logger.ts
CHANGED
|
@@ -150,7 +150,7 @@ export class Logger {
|
|
|
150
150
|
|
|
151
151
|
private static isRootCaller(traceLevel: number = 6): boolean {
|
|
152
152
|
return this.getCallStackArray()
|
|
153
|
-
.slice(traceLevel, traceLevel +
|
|
153
|
+
.slice(traceLevel, traceLevel + 4)
|
|
154
154
|
.reduce((acc, e): boolean => {
|
|
155
155
|
return acc || /MochaHooks|CheReporter/.test(e);
|
|
156
156
|
}, false);
|
|
@@ -11,33 +11,33 @@
|
|
|
11
11
|
import { WorkspaceStatus } from './WorkspaceStatus';
|
|
12
12
|
|
|
13
13
|
export interface ITestWorkspaceUtil {
|
|
14
|
-
waitWorkspaceStatus(
|
|
14
|
+
waitWorkspaceStatus(workspaceName: string, expectedWorkspaceStatus: WorkspaceStatus): Promise<void>;
|
|
15
15
|
|
|
16
|
-
stopWorkspaceByName(workspaceName: string): void
|
|
16
|
+
stopWorkspaceByName(workspaceName: string): Promise<void>;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* delete a workspace without stopping phase (similar with force deleting)
|
|
20
20
|
*/
|
|
21
|
-
deleteWorkspaceByName(workspaceName: string): void
|
|
21
|
+
deleteWorkspaceByName(workspaceName: string): Promise<void>;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* stop workspace before deleting with checking stopping phase
|
|
25
25
|
*/
|
|
26
|
-
stopAndDeleteWorkspaceByName(workspaceName: string): void
|
|
26
|
+
stopAndDeleteWorkspaceByName(workspaceName: string): Promise<void>;
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* stop all run workspaces in the namespace
|
|
30
30
|
*/
|
|
31
|
-
stopAllRunningWorkspaces(
|
|
31
|
+
stopAllRunningWorkspaces(): Promise<void>;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* stop all run workspaces, check statused and remove the workspaces
|
|
35
35
|
*/
|
|
36
|
-
stopAndDeleteAllRunningWorkspaces(
|
|
36
|
+
stopAndDeleteAllRunningWorkspaces(): Promise<void>;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* stop all run workspaces without stopping and waiting for of 'Stopped' phase
|
|
40
40
|
* Similar with 'force' deleting
|
|
41
41
|
*/
|
|
42
|
-
deleteAllWorkspaces(
|
|
42
|
+
deleteAllWorkspaces(): Promise<void>;
|
|
43
43
|
}
|