@eclipse-che/che-e2e 7.76.0 → 7.77.0
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/mocharc.ts +4 -2
- package/configs/reporters.config.js +54 -0
- package/configs/sh-scripts/runDevfileAcceptanceTests.sh +81 -0
- package/configs/sh-scripts/runFunctionalTests.sh +9 -6
- package/constants/BASE_TEST_CONSTANTS.ts +21 -3
- package/constants/FACTORY_TEST_CONSTANTS.ts +3 -1
- package/constants/MOCHA_CONSTANTS.ts +5 -2
- package/constants/REPORTER_CONSTANTS.ts +99 -3
- package/constants/TIMEOUT_CONSTANTS.ts +10 -22
- package/dist/configs/mocharc.js +4 -2
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/BASE_TEST_CONSTANTS.js +16 -2
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -1
- package/dist/constants/FACTORY_TEST_CONSTANTS.js +3 -1
- package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -1
- package/dist/constants/MOCHA_CONSTANTS.js +3 -2
- package/dist/constants/MOCHA_CONSTANTS.js.map +1 -1
- package/dist/constants/REPORTER_CONSTANTS.js +71 -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/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +22 -3
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +4 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +49 -11
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +9 -5
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +3 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +0 -3
- package/dist/specs/api/EmptyWorkspaceAPI.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 +12 -8
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +33 -31
- 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/specs/web-terminal/WebTerminalTest.spec.js +22 -0
- package/dist/specs/web-terminal/WebTerminalTest.spec.js.map +1 -1
- package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js +13 -0
- package/dist/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.js.map +1 -0
- 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 +15 -11
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +0 -2
- package/dist/tests-library/ProjectAndFileTests.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/DevWorkspaceConfigurationHelper.js +2 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +40 -37
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +4 -0
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +9 -8
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +45 -11
- package/dist/utils/Logger.js.map +1 -1
- package/package.json +11 -10
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +1 -1
- package/pageobjects/git-providers/OauthPage.ts +24 -3
- package/pageobjects/ide/CheCodeLocatorLoader.ts +4 -1
- package/pageobjects/openshift/OcpMainPage.ts +1 -1
- package/specs/MochaHooks.ts +51 -10
- package/specs/SmokeTest.spec.ts +9 -5
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +5 -1
- package/specs/api/EmptyWorkspaceAPI.spec.ts +0 -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 +15 -11
- package/specs/factory/RefusedOAuthFactory.spec.ts +42 -35
- 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/specs/web-terminal/WebTerminalTest.spec.ts +33 -0
- package/suites/devfile-acceptance-test-suite/DynamicallyGeneratingAPITest.suite.ts +10 -0
- package/suites/disconnected-ocp/UITest.suite.ts +1 -1
- package/suites/online-ocp/UITest.suite.ts +1 -1
- package/tests-library/LoginTests.ts +21 -11
- package/tests-library/ProjectAndFileTests.ts +0 -6
- package/tests-library/WorkspaceHandlingTests.ts +2 -6
- package/tsconfig.json +1 -1
- package/utils/BrowserTabsUtil.ts +8 -1
- package/utils/DevWorkspaceConfigurationHelper.ts +4 -1
- package/utils/DevfilesRegistryHelper.ts +41 -39
- package/utils/DriverHelper.ts +6 -0
- package/utils/KubernetesCommandLineToolsExecutor.ts +8 -8
- package/utils/Logger.ts +50 -12
- package/utils/workspace/ITestWorkspaceUtil.ts +7 -7
- package/configs/reporters-config.json +0 -6
package/specs/MochaHooks.ts
CHANGED
|
@@ -25,18 +25,30 @@ import { CHROME_DRIVER_CONSTANTS } from '../constants/CHROME_DRIVER_CONSTANTS';
|
|
|
25
25
|
import { decorate, injectable, unmanaged } from 'inversify';
|
|
26
26
|
import { Main } from '@eclipse-che/che-devworkspace-generator/lib/main';
|
|
27
27
|
import { LocatorLoader } from 'monaco-page-objects/out/locators/loader';
|
|
28
|
+
import { REPORTER_CONSTANTS } from '../constants/REPORTER_CONSTANTS';
|
|
29
|
+
import { WorkspaceHandlingTests } from '../tests-library/WorkspaceHandlingTests';
|
|
28
30
|
|
|
29
31
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
30
32
|
let latestWorkspace: string = '';
|
|
33
|
+
export let rpApi: any = undefined;
|
|
31
34
|
|
|
32
35
|
export function registerRunningWorkspace(workspaceName: string): void {
|
|
33
|
-
workspaceName !== ''
|
|
36
|
+
workspaceName !== ''
|
|
37
|
+
? Logger.debug(`with workspaceName:${workspaceName}`)
|
|
38
|
+
: ((): void => {
|
|
39
|
+
Logger.debug('delete workspace name');
|
|
40
|
+
WorkspaceHandlingTests.clearWorkspaceName();
|
|
41
|
+
})();
|
|
34
42
|
|
|
35
43
|
latestWorkspace = workspaceName;
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
exports.mochaHooks = {
|
|
39
47
|
beforeAll: [
|
|
48
|
+
function initRPApi(): any {
|
|
49
|
+
rpApi = require('@reportportal/agent-js-mocha/lib/publicReportingAPI.js');
|
|
50
|
+
},
|
|
51
|
+
|
|
40
52
|
function decorateExternalClasses(): void {
|
|
41
53
|
decorate(injectable(), Main);
|
|
42
54
|
decorate(injectable(), LocatorLoader);
|
|
@@ -69,15 +81,15 @@ exports.mochaHooks = {
|
|
|
69
81
|
if (BASE_TEST_CONSTANTS.TS_DEBUG_MODE) {
|
|
70
82
|
for (const [timeout, seconds] of Object.entries(TIMEOUT_CONSTANTS)) {
|
|
71
83
|
Object.defineProperty(TIMEOUT_CONSTANTS, timeout, {
|
|
72
|
-
value: seconds *
|
|
84
|
+
value: seconds * 2
|
|
73
85
|
});
|
|
74
86
|
}
|
|
75
87
|
}
|
|
76
88
|
}
|
|
77
89
|
],
|
|
78
90
|
afterEach: [
|
|
79
|
-
async function (this: Mocha.Context): Promise<void> {
|
|
80
|
-
if (this.currentTest?.state === 'failed') {
|
|
91
|
+
async function saveAllureAttachments(this: Mocha.Context): Promise<void> {
|
|
92
|
+
if (REPORTER_CONSTANTS.SAVE_ALLURE_REPORT_DATA && this.currentTest?.state === 'failed') {
|
|
81
93
|
try {
|
|
82
94
|
const screenshot: string = await driverHelper.getDriver().takeScreenshot();
|
|
83
95
|
allure.attachment('Screenshot', Buffer.from(screenshot, 'base64'), 'image/png');
|
|
@@ -86,25 +98,54 @@ exports.mochaHooks = {
|
|
|
86
98
|
}
|
|
87
99
|
}
|
|
88
100
|
},
|
|
101
|
+
async function saveReportportalAttachments(this: Mocha.Context): Promise<void> {
|
|
102
|
+
if (REPORTER_CONSTANTS.SAVE_RP_REPORT_DATA && this.currentTest?.state === 'failed') {
|
|
103
|
+
try {
|
|
104
|
+
const screenshot: string = await driverHelper.getDriver().takeScreenshot();
|
|
105
|
+
const attachment: { name: string; type: string; content: string } = {
|
|
106
|
+
name: 'screenshot.png',
|
|
107
|
+
type: 'image/png',
|
|
108
|
+
content: screenshot
|
|
109
|
+
};
|
|
110
|
+
rpApi.error('Screenshot on fail: ', attachment);
|
|
111
|
+
} catch (e) {
|
|
112
|
+
rpApi.error('Could not attach the screenshot');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
89
116
|
// stop and remove running workspace
|
|
90
|
-
function deleteWorkspaceOnFailedTest(this: Mocha.Context): void {
|
|
117
|
+
async function deleteWorkspaceOnFailedTest(this: Mocha.Context): Promise<void> {
|
|
91
118
|
if (this.currentTest?.state === 'failed') {
|
|
92
|
-
if (BASE_TEST_CONSTANTS.DELETE_WORKSPACE_ON_FAILED_TEST) {
|
|
93
|
-
Logger.
|
|
119
|
+
if (BASE_TEST_CONSTANTS.DELETE_WORKSPACE_ON_FAILED_TEST && CHROME_DRIVER_CONSTANTS.TS_USE_WEB_DRIVER_FOR_TEST) {
|
|
120
|
+
Logger.trace(
|
|
121
|
+
'Property DELETE_WORKSPACE_ON_FAILED_TEST is true - trying to stop and delete running workspace with API.'
|
|
122
|
+
);
|
|
94
123
|
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
95
|
-
testWorkspaceUtil.stopAndDeleteWorkspaceByName(latestWorkspace);
|
|
124
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(latestWorkspace);
|
|
96
125
|
}
|
|
97
126
|
}
|
|
98
127
|
}
|
|
99
128
|
],
|
|
100
129
|
afterAll: [
|
|
101
130
|
// stop and remove running workspace
|
|
131
|
+
async function deleteAllWorkspacesOnFinish(): Promise<void> {
|
|
132
|
+
try {
|
|
133
|
+
if (BASE_TEST_CONSTANTS.DELETE_ALL_WORKSPACES_ON_RUN_FINISH && CHROME_DRIVER_CONSTANTS.TS_USE_WEB_DRIVER_FOR_TEST) {
|
|
134
|
+
Logger.trace(
|
|
135
|
+
'Property DELETE_WORKSPACE_ON_FAILED_TEST is true - trying to stop and delete all running workspace after test run with API.'
|
|
136
|
+
);
|
|
137
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
138
|
+
await testWorkspaceUtil.stopAndDeleteAllRunningWorkspaces();
|
|
139
|
+
}
|
|
140
|
+
} catch (e) {
|
|
141
|
+
Logger.trace('Running workspaces not found');
|
|
142
|
+
}
|
|
143
|
+
},
|
|
102
144
|
async function stopTheDriver(): Promise<void> {
|
|
103
145
|
if (!BASE_TEST_CONSTANTS.TS_DEBUG_MODE && CHROME_DRIVER_CONSTANTS.TS_USE_WEB_DRIVER_FOR_TEST) {
|
|
104
146
|
// ensure that fired events done
|
|
105
147
|
await driverHelper.wait(5000);
|
|
106
|
-
await driverHelper.
|
|
107
|
-
Logger.info('Chrome driver session stopped.');
|
|
148
|
+
await driverHelper.quit();
|
|
108
149
|
}
|
|
109
150
|
}
|
|
110
151
|
]
|
package/specs/SmokeTest.spec.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
|
|
|
20
20
|
import { expect } from 'chai';
|
|
21
21
|
import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';
|
|
22
22
|
|
|
23
|
-
suite(
|
|
23
|
+
suite(`The SmokeTest userstory ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
24
24
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
25
25
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
26
26
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
@@ -29,7 +29,9 @@ suite('The SmokeTest userstory', function (): void {
|
|
|
29
29
|
FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/che-incubator/quarkus-api-example.git';
|
|
30
30
|
let projectSection: ViewSection;
|
|
31
31
|
suite(`Create workspace from factory:${factoryUrl}`, function (): void {
|
|
32
|
-
|
|
32
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
33
|
+
await loginTests.loginIntoChe();
|
|
34
|
+
});
|
|
33
35
|
test(`Create and open new workspace from factory:${factoryUrl}`, async function (): Promise<void> {
|
|
34
36
|
await workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
|
|
35
37
|
});
|
|
@@ -54,13 +56,15 @@ suite('The SmokeTest userstory', function (): void {
|
|
|
54
56
|
'Project files were not imported'
|
|
55
57
|
).not.undefined;
|
|
56
58
|
});
|
|
57
|
-
test('Stop the workspace', async function (): Promise<void> {
|
|
59
|
+
test('Stop the workspace by UI', async function (): Promise<void> {
|
|
58
60
|
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
59
61
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
60
62
|
});
|
|
61
|
-
test('Delete the workspace', async function (): Promise<void> {
|
|
63
|
+
test('Delete the workspace by UI', async function (): Promise<void> {
|
|
62
64
|
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
63
65
|
});
|
|
64
|
-
|
|
66
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
67
|
+
registerRunningWorkspace('');
|
|
68
|
+
});
|
|
65
69
|
});
|
|
66
70
|
});
|
|
@@ -19,6 +19,7 @@ import { CLASSES } from '../../configs/inversify.types';
|
|
|
19
19
|
import { DevfilesRegistryHelper } from '../../utils/DevfilesRegistryHelper';
|
|
20
20
|
import { MOCHA_CONSTANTS } from '../../constants/MOCHA_CONSTANTS';
|
|
21
21
|
import { API_TEST_CONSTANTS } from '../../constants/API_TEST_CONSTANTS';
|
|
22
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* dynamically generating tests
|
|
@@ -28,7 +29,10 @@ void (async function (): Promise<void> {
|
|
|
28
29
|
const devfilesRegistryHelper: DevfilesRegistryHelper = e2eContainer.get(CLASSES.DevfilesRegistryHelper);
|
|
29
30
|
|
|
30
31
|
let devfileSamples: any = [];
|
|
31
|
-
if (
|
|
32
|
+
if (
|
|
33
|
+
MOCHA_CONSTANTS.MOCHA_DELAYED_SUITE &&
|
|
34
|
+
!API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL().includes(BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL)
|
|
35
|
+
) {
|
|
32
36
|
devfileSamples = await devfilesRegistryHelper.collectPathsToDevfilesFromRegistry(false);
|
|
33
37
|
}
|
|
34
38
|
for (const devfileSample of devfileSamples) {
|
|
@@ -71,10 +71,6 @@ suite('Empty workspace API test', function (): void {
|
|
|
71
71
|
BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME
|
|
72
72
|
);
|
|
73
73
|
});
|
|
74
|
-
|
|
75
|
-
suiteTeardown('Delete cloned project', function (): void {
|
|
76
|
-
containerTerminal.removeFolder(`${clonedProjectName}`);
|
|
77
|
-
});
|
|
78
74
|
});
|
|
79
75
|
|
|
80
76
|
suiteTeardown('Delete workspace', function (): void {
|
|
@@ -65,14 +65,16 @@ suite(`Check links to documentation page in Dashboard ${BASE_TEST_CONSTANTS.TEST
|
|
|
65
65
|
({ webSocketTroubleshooting, workspace, devfile, general, storageTypes } = docs);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
69
|
+
await loginTests.loginIntoChe();
|
|
70
|
+
});
|
|
71
|
+
|
|
68
72
|
test('Check if product.json config contains correct application version', function (): void {
|
|
69
73
|
[productVersion, links[1].href, devfile, workspace, general, storageTypes, webSocketTroubleshooting].forEach((e): void => {
|
|
70
74
|
expect(e, 'Fetched links not matches with tested product version').contains(testingVersion);
|
|
71
75
|
});
|
|
72
76
|
});
|
|
73
77
|
|
|
74
|
-
loginTests.loginIntoChe();
|
|
75
|
-
|
|
76
78
|
test('Check if documentation section "About" present on Dashboard', async function (): Promise<void> {
|
|
77
79
|
await dashboard.openAboutMenu();
|
|
78
80
|
});
|
|
@@ -135,7 +137,10 @@ suite(`Check links to documentation page in Dashboard ${BASE_TEST_CONSTANTS.TEST
|
|
|
135
137
|
});
|
|
136
138
|
}
|
|
137
139
|
|
|
138
|
-
|
|
140
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
141
|
+
await dashboard.openDashboard();
|
|
142
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
143
|
+
});
|
|
139
144
|
|
|
140
145
|
suiteTeardown('Delete default DevWorkspace', function (): void {
|
|
141
146
|
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
11
11
|
import { ActivityBar, ViewControl, Workbench } from 'monaco-page-objects';
|
|
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 { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
@@ -17,6 +17,8 @@ import { LoginTests } from '../../tests-library/LoginTests';
|
|
|
17
17
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
18
18
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
19
19
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
20
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
21
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
20
22
|
|
|
21
23
|
const stackName: string = 'Empty Workspace';
|
|
22
24
|
|
|
@@ -25,9 +27,12 @@ suite(`${stackName} test ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function ():
|
|
|
25
27
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
26
28
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
27
29
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
30
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
31
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
34
|
+
await loginTests.loginIntoChe();
|
|
35
|
+
});
|
|
31
36
|
test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> {
|
|
32
37
|
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
33
38
|
});
|
|
@@ -53,14 +58,16 @@ suite(`${stackName} test ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function ():
|
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
60
|
|
|
56
|
-
|
|
57
|
-
await
|
|
61
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
62
|
+
await dashboard.openDashboard();
|
|
58
63
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
59
64
|
});
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
await
|
|
66
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
67
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
63
68
|
});
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
71
|
+
registerRunningWorkspace('');
|
|
72
|
+
});
|
|
66
73
|
});
|
|
@@ -12,12 +12,14 @@ import { ViewSection } from 'monaco-page-objects';
|
|
|
12
12
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
13
13
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
14
14
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
15
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
15
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
16
16
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
17
17
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
18
18
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
19
19
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
20
20
|
import { expect } from 'chai';
|
|
21
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
22
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
21
23
|
|
|
22
24
|
const stackName: string = 'Java 11 with Quarkus';
|
|
23
25
|
|
|
@@ -26,11 +28,15 @@ suite(`The ${stackName} userstory ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, func
|
|
|
26
28
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
27
29
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
28
30
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
31
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
32
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
29
33
|
|
|
30
34
|
let projectSection: ViewSection;
|
|
31
35
|
const projectName: string = 'quarkus-quickstarts';
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
38
|
+
await loginTests.loginIntoChe();
|
|
39
|
+
});
|
|
34
40
|
|
|
35
41
|
test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> {
|
|
36
42
|
await workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
@@ -64,14 +70,16 @@ suite(`The ${stackName} userstory ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, func
|
|
|
64
70
|
).not.undefined;
|
|
65
71
|
});
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
await
|
|
73
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
74
|
+
await dashboard.openDashboard();
|
|
69
75
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
70
76
|
});
|
|
71
77
|
|
|
72
|
-
|
|
73
|
-
await
|
|
78
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
79
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
74
80
|
});
|
|
75
81
|
|
|
76
|
-
|
|
82
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
83
|
+
registerRunningWorkspace('');
|
|
84
|
+
});
|
|
77
85
|
});
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
24
24
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
25
25
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
26
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
26
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
27
27
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
28
28
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
29
29
|
import { Logger } from '../../utils/Logger';
|
|
@@ -34,6 +34,8 @@ 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
36
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
37
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
38
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
37
39
|
|
|
38
40
|
const samples: string[] = PLUGIN_TEST_CONSTANTS.TS_SAMPLE_LIST.split(',');
|
|
39
41
|
|
|
@@ -46,6 +48,8 @@ for (const sample of samples) {
|
|
|
46
48
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
47
49
|
const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader);
|
|
48
50
|
const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators;
|
|
51
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
52
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
49
53
|
|
|
50
54
|
let projectSection: ViewSection;
|
|
51
55
|
let extensionSection: ExtensionsViewSection;
|
|
@@ -56,7 +60,9 @@ for (const sample of samples) {
|
|
|
56
60
|
recommendations: []
|
|
57
61
|
};
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
64
|
+
await loginTests.loginIntoChe();
|
|
65
|
+
});
|
|
60
66
|
|
|
61
67
|
test(`Create and open new workspace, stack:${sample}`, async function (): Promise<void> {
|
|
62
68
|
await workspaceHandlingTests.createAndOpenWorkspace(sample);
|
|
@@ -202,15 +208,17 @@ for (const sample of samples) {
|
|
|
202
208
|
}
|
|
203
209
|
});
|
|
204
210
|
|
|
205
|
-
|
|
206
|
-
await
|
|
211
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
212
|
+
await dashboard.openDashboard();
|
|
207
213
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
208
214
|
});
|
|
209
215
|
|
|
210
|
-
|
|
211
|
-
await
|
|
216
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
217
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
212
218
|
});
|
|
213
219
|
|
|
214
|
-
|
|
220
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
221
|
+
registerRunningWorkspace('');
|
|
222
|
+
});
|
|
215
223
|
});
|
|
216
224
|
}
|
|
@@ -12,7 +12,7 @@ import { ViewSection } from 'monaco-page-objects';
|
|
|
12
12
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
13
13
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
14
14
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
15
|
-
import { CLASSES
|
|
15
|
+
import { CLASSES } from '../../configs/inversify.types';
|
|
16
16
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
17
17
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
18
18
|
import { expect } from 'chai';
|
|
@@ -22,19 +22,20 @@ import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesComman
|
|
|
22
22
|
import { StringUtil } from '../../utils/StringUtil';
|
|
23
23
|
import { OcpApplicationPage } from '../../pageobjects/openshift/OcpApplicationPage';
|
|
24
24
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
25
|
-
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
26
25
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
26
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
27
|
+
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
27
28
|
|
|
28
29
|
suite(`DevConsole Integration ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
|
|
29
30
|
let ocpImportPage: OcpImportFromGitPage;
|
|
30
31
|
let ocpApplicationPage: OcpApplicationPage;
|
|
31
32
|
|
|
32
33
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
34
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
33
35
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
34
36
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
35
37
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
36
38
|
const ocpMainPage: OcpMainPage = e2eContainer.get(CLASSES.OcpMainPage);
|
|
37
|
-
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
38
39
|
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
|
|
39
40
|
CLASSES.KubernetesCommandLineToolsExecutor
|
|
40
41
|
);
|
|
@@ -72,7 +73,13 @@ suite(`DevConsole Integration ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function
|
|
|
72
73
|
await ocpApplicationPage.waitAndOpenEditSourceCodeIcon();
|
|
73
74
|
});
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
test('Login', async function (): Promise<void> {
|
|
77
|
+
try {
|
|
78
|
+
await dashboard.waitLoader(TIMEOUT_CONSTANTS.TS_WAIT_LOADER_PRESENCE_TIMEOUT);
|
|
79
|
+
} catch (e) {
|
|
80
|
+
await loginTests.loginIntoChe();
|
|
81
|
+
}
|
|
82
|
+
});
|
|
76
83
|
|
|
77
84
|
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
78
85
|
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
@@ -99,14 +106,19 @@ suite(`DevConsole Integration ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function
|
|
|
99
106
|
).not.undefined;
|
|
100
107
|
});
|
|
101
108
|
|
|
102
|
-
|
|
109
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
110
|
+
await dashboard.openDashboard();
|
|
103
111
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
104
|
-
testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
105
112
|
});
|
|
106
113
|
|
|
107
|
-
loginTests.logoutFromChe();
|
|
108
|
-
|
|
109
114
|
suiteTeardown('Delete project using ocp', function (): void {
|
|
115
|
+
kubernetesCommandLineToolsExecutor.workspaceName =
|
|
116
|
+
WorkspaceHandlingTests.getWorkspaceName() !== '' ? WorkspaceHandlingTests.getWorkspaceName() : 'spring-music';
|
|
117
|
+
kubernetesCommandLineToolsExecutor.deleteDevWorkspace();
|
|
110
118
|
kubernetesCommandLineToolsExecutor.deleteProject(projectName);
|
|
111
119
|
});
|
|
120
|
+
|
|
121
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
122
|
+
registerRunningWorkspace('');
|
|
123
|
+
});
|
|
112
124
|
});
|
|
@@ -29,7 +29,7 @@ import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader
|
|
|
29
29
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
30
30
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
31
31
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
32
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
32
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
33
33
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
34
34
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
35
35
|
import { Logger } from '../../utils/Logger';
|
|
@@ -37,6 +37,8 @@ import { LoginTests } from '../../tests-library/LoginTests';
|
|
|
37
37
|
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
38
38
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
39
39
|
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
40
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
41
|
+
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
40
42
|
|
|
41
43
|
suite(
|
|
42
44
|
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`,
|
|
@@ -49,6 +51,8 @@ suite(
|
|
|
49
51
|
const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader);
|
|
50
52
|
const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators;
|
|
51
53
|
const oauthPage: OauthPage = e2eContainer.get(CLASSES.OauthPage);
|
|
54
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
55
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
52
56
|
|
|
53
57
|
let projectSection: ViewSection;
|
|
54
58
|
let scmProvider: SingleScmProvider;
|
|
@@ -64,7 +68,9 @@ suite(
|
|
|
64
68
|
const pushItemLabel: string = 'Push';
|
|
65
69
|
let testRepoProjectName: string;
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
72
|
+
await loginTests.loginIntoChe();
|
|
73
|
+
});
|
|
68
74
|
test('Navigate to the factory URL', async function (): Promise<void> {
|
|
69
75
|
await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
|
|
70
76
|
});
|
|
@@ -189,15 +195,17 @@ suite(
|
|
|
189
195
|
expect(isCommitButtonDisabled).to.equal('true');
|
|
190
196
|
});
|
|
191
197
|
|
|
192
|
-
|
|
193
|
-
await
|
|
198
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
199
|
+
await dashboard.openDashboard();
|
|
194
200
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
195
201
|
});
|
|
196
202
|
|
|
197
|
-
|
|
198
|
-
await
|
|
203
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
204
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
199
205
|
});
|
|
200
206
|
|
|
201
|
-
|
|
207
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
208
|
+
registerRunningWorkspace('');
|
|
209
|
+
});
|
|
202
210
|
}
|
|
203
211
|
);
|
|
@@ -28,7 +28,7 @@ import { StringUtil } from '../../utils/StringUtil';
|
|
|
28
28
|
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
|
|
29
29
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
30
30
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
31
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
31
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
32
32
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
33
33
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
34
34
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
@@ -39,6 +39,7 @@ import { LoginTests } from '../../tests-library/LoginTests';
|
|
|
39
39
|
import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
40
40
|
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
41
41
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
42
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
42
43
|
|
|
43
44
|
suite(
|
|
44
45
|
`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}`,
|
|
@@ -52,6 +53,7 @@ suite(
|
|
|
52
53
|
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
53
54
|
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces);
|
|
54
55
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
56
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
55
57
|
|
|
56
58
|
let projectSection: ViewSection;
|
|
57
59
|
let scmProvider: SingleScmProvider;
|
|
@@ -69,7 +71,9 @@ suite(
|
|
|
69
71
|
let testRepoProjectName: string;
|
|
70
72
|
const isPrivateRepo: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
suiteSetup('Login', async function (): Promise<void> {
|
|
75
|
+
await loginTests.loginIntoChe();
|
|
76
|
+
});
|
|
73
77
|
|
|
74
78
|
test('Get number of previously created workspaces', async function (): Promise<void> {
|
|
75
79
|
await dashboard.clickWorkspacesButton();
|
|
@@ -82,7 +86,7 @@ suite(
|
|
|
82
86
|
});
|
|
83
87
|
|
|
84
88
|
if (FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
85
|
-
test(`Check that workspace cannot be created without OAuth for ${isPrivateRepo} repo`, async function (): Promise<void> {
|
|
89
|
+
test(`Check that workspace cannot be created without PAT/OAuth for ${isPrivateRepo} repo`, async function (): Promise<void> {
|
|
86
90
|
await dashboard.waitLoader();
|
|
87
91
|
const loaderAlert: string = await dashboard.getLoaderAlert();
|
|
88
92
|
expect(loaderAlert).to.contain('Cause: Could not reach devfile at');
|
|
@@ -95,8 +99,6 @@ suite(
|
|
|
95
99
|
const allCreatedWorkspacesNames: string[] = await workspaces.getAllCreatedWorkspacesNames();
|
|
96
100
|
expect(allCreatedWorkspacesNames).has.length(numberOfCreatedWorkspaces);
|
|
97
101
|
});
|
|
98
|
-
|
|
99
|
-
loginTests.logoutFromChe();
|
|
100
102
|
} else {
|
|
101
103
|
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
102
104
|
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
@@ -241,16 +243,18 @@ suite(
|
|
|
241
243
|
expect(isCommitButtonDisabled).to.be.true;
|
|
242
244
|
});
|
|
243
245
|
|
|
244
|
-
|
|
245
|
-
await
|
|
246
|
+
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> {
|
|
247
|
+
await dashboard.openDashboard();
|
|
246
248
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
247
249
|
});
|
|
248
250
|
|
|
249
|
-
|
|
250
|
-
await
|
|
251
|
+
suiteTeardown('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
252
|
+
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
251
253
|
});
|
|
252
|
-
|
|
253
|
-
loginTests.logoutFromChe();
|
|
254
254
|
}
|
|
255
|
+
|
|
256
|
+
suiteTeardown('Unregister running workspace', function (): void {
|
|
257
|
+
registerRunningWorkspace('');
|
|
258
|
+
});
|
|
255
259
|
}
|
|
256
260
|
);
|