@eclipse-che/che-e2e 7.56.1-dev-9775650 → 7.56.1-dev-6dff8fe
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/TestConstants.ts +6 -1
- package/build/dockerfiles/Dockerfile +4 -3
- package/dist/TestConstants.js +5 -1
- package/dist/TestConstants.js.map +1 -1
- package/dist/driver/CheReporter.js +10 -31
- package/dist/driver/CheReporter.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/inversify.config.js +3 -0
- package/dist/inversify.config.js.map +1 -1
- package/dist/inversify.types.js +1 -0
- package/dist/inversify.types.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +10 -2
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/ide/theia/Ide.js +1 -1
- package/dist/pageobjects/ide/theia/Ide.js.map +1 -1
- package/dist/tests/MochaHooks.js +75 -0
- package/dist/tests/MochaHooks.js.map +1 -0
- package/dist/tests/devfiles/che-code/EmptyWorkspace.spec.js +11 -24
- package/dist/tests/devfiles/che-code/EmptyWorkspace.spec.js.map +1 -1
- package/dist/tests/devfiles/theia/DotNetCore.spec.js.map +1 -1
- package/dist/tests/e2e/theia/FactoryUrl.spec.js.map +1 -1
- package/dist/tests/e2e/theia/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
- package/dist/tests/e2e/theia/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
- package/dist/tests/e2e/theia/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
- package/dist/tests/e2e_happy_path/theia/DevWorkspaceHappyPath.spec.js +2 -2
- package/dist/tests/e2e_happy_path/theia/DevWorkspaceHappyPath.spec.js.map +1 -1
- package/dist/tests/e2e_happy_path/theia/HappyPath.spec.js +1 -1
- package/dist/tests/e2e_happy_path/theia/HappyPath.spec.js.map +1 -1
- package/dist/testsLibrary/WorkspaceHandlingTests.js +28 -18
- package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
- package/dist/testsLibrary/che-code/ProjectAndFileTestsCheCode.js +54 -0
- package/dist/testsLibrary/che-code/ProjectAndFileTestsCheCode.js.map +1 -0
- package/dist/testsLibrary/theia/LanguageServerTestsTheia.js.map +1 -1
- package/dist/testsLibrary/theia/ProjectAndFileTestsTheia.js.map +1 -1
- package/dist/utils/DriverHelper.js +0 -3
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/VCS/github/GitHubUtil.js +2 -2
- package/dist/utils/VCS/github/GitHubUtil.js.map +1 -1
- package/driver/CheReporter.ts +9 -32
- package/index.ts +1 -0
- package/inversify.config.ts +3 -0
- package/inversify.types.ts +1 -0
- package/mocha-all-devfiles-che-code.json +12 -0
- package/mocha-all-devfiles-theia.json +13 -10
- package/mocha-all-factories-che-code.json +14 -0
- package/mocha-all-factories-theia.json +14 -11
- package/mocha-all-plugins-che-code.json +13 -0
- package/mocha-all-plugins-theia.json +13 -10
- package/mocha-che-code.json +12 -0
- package/mocha-connector-theia.json +10 -7
- package/mocha-devworkspace-happy-path-che-code.json +13 -0
- package/mocha-devworkspace-happy-path-theia.json +12 -9
- package/mocha-factory-che-code.json +13 -0
- package/mocha-factory-theia.json +12 -9
- package/mocha-git-publish-branch-theia.json +12 -9
- package/mocha-git-self-sign-cert-theia.json +12 -9
- package/mocha-git-ssh-theia.json +12 -9
- package/mocha-happy-path-che-code.json +14 -0
- package/mocha-happy-path-theia.json +13 -10
- package/mocha-java-maven.json +11 -7
- package/mocha-java-springboot-che-code.json +12 -0
- package/mocha-java-springboot-theia.json +11 -7
- package/mocha-java-vertx-che-code.json +12 -0
- package/mocha-java-vertx-theia.json +11 -7
- package/mocha-load-theia.json +10 -7
- package/mocha-scala.json +11 -7
- package/mocha-single-devfile.json +9 -6
- package/mocha-theia.json +10 -6
- package/mocha-ws-creation-and-ls-theia.json +10 -7
- package/mocha.intelij.json +11 -7
- package/mocha.ocp.link.json +9 -6
- package/mocha.single.plugin.json +6 -5
- package/package.json +11 -11
- package/pageobjects/dashboard/Workspaces.ts +10 -4
- package/pageobjects/ide/theia/Ide.ts +1 -1
- package/pageobjects/ide/theia/OpenEditors.ts +1 -1
- package/tests/MochaHooks.ts +57 -0
- package/tests/devfiles/che-code/EmptyWorkspace.spec.ts +14 -24
- package/tests/devfiles/theia/DotNetCore.spec.ts +1 -1
- package/tests/e2e/theia/FactoryUrl.spec.ts +1 -1
- package/tests/e2e/theia/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +1 -1
- package/tests/e2e/theia/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +1 -1
- package/tests/e2e/theia/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +1 -1
- package/tests/e2e_happy_path/theia/DevWorkspaceHappyPath.spec.ts +3 -3
- package/tests/e2e_happy_path/theia/HappyPath.spec.ts +1 -1
- package/testsLibrary/WorkspaceHandlingTests.ts +30 -23
- package/testsLibrary/che-code/ProjectAndFileTestsCheCode.ts +34 -0
- package/testsLibrary/theia/LanguageServerTestsTheia.ts +2 -2
- package/testsLibrary/theia/ProjectAndFileTestsTheia.ts +2 -2
- package/tslint.json +16 -13
- package/utils/DriverHelper.ts +0 -4
- package/utils/VCS/github/GitHubUtil.ts +2 -2
- package/utils/workspace/ApiUrlResolver.ts +1 -1
- package/utils/workspace/ITestWorkspaceUtil.ts +12 -12
- package/mocha-all-factories-code.json +0 -11
- package/mocha-all-plugins-code.json +0 -10
- package/mocha-code.json +0 -8
- package/mocha-devworkspace-happy-path-code.json +0 -10
- package/mocha-factory-code.json +0 -10
- package/mocha-happy-path-code.json +0 -11
- package/mocha-java-springboot-code.json +0 -9
- package/mocha-java-vertx-code.json +0 -9
package/mocha.ocp.link.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"timeout": "1200000",
|
|
3
|
+
"reporter": "dist/driver/CheReporter.js",
|
|
4
|
+
"require": "./dist/tests/MochaHooks.js",
|
|
5
|
+
"ui": "tdd",
|
|
6
|
+
"bail": true,
|
|
7
|
+
"full-trace": true,
|
|
8
|
+
"spec": [
|
|
9
|
+
"./dist/tests/login/LinkCheAndOcpUsers.spec.js"
|
|
10
|
+
]
|
|
8
11
|
}
|
package/mocha.single.plugin.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"timeout": "1200000",
|
|
3
|
+
"reporter": "dist/driver/CheReporter.js",
|
|
4
|
+
"require": "./dist/tests/MochaHooks.js",
|
|
5
|
+
"ui": "tdd",
|
|
6
|
+
"bail": true,
|
|
7
|
+
"full-trace": true
|
|
7
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-che/che-e2e",
|
|
3
|
-
"version": "7.56.1-dev-
|
|
3
|
+
"version": "7.56.1-dev-6dff8fe",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"test-all-factories-theia": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-all-factories-theia.json",
|
|
30
30
|
"test-plugin-ci-theia": "export TS_DELETE_PLUGINS_TEST_WORKSPACE=true && npm run init-mocha-opts -- --spec dist/tests/plugins/theia/${USERSTORY}.spec.js",
|
|
31
31
|
"test-all-plugins-theia": "tsc && mocha --config mocha-all-plugins-theia.json",
|
|
32
|
-
"test-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-code.json",
|
|
33
|
-
"test-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-happy-path-code.json",
|
|
34
|
-
"test-devworkspace-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-devworkspace-happy-path-code.json",
|
|
35
|
-
"test-java-vertx-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-vertx-code.json",
|
|
36
|
-
"test-java-springboot-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-springboot-code.json",
|
|
37
|
-
"test-factory-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-factory-code.json",
|
|
38
|
-
"test-all-factories-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-all-factories-code.json",
|
|
32
|
+
"test-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-che-code.json",
|
|
33
|
+
"test-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-happy-path-che-code.json",
|
|
34
|
+
"test-devworkspace-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-devworkspace-happy-path-che-code.json",
|
|
35
|
+
"test-java-vertx-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-vertx-che-code.json",
|
|
36
|
+
"test-java-springboot-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-springboot-che-code.json",
|
|
37
|
+
"test-factory-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-factory-che-code.json",
|
|
38
|
+
"test-all-factories-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-all-factories-che-code.json",
|
|
39
39
|
"test-plugin-ci-code": "export TS_DELETE_PLUGINS_TEST_WORKSPACE=true && npm run init-mocha-opts -- --spec dist/tests/plugins/code/${USERSTORY}.spec.js",
|
|
40
|
-
"test-all-plugins-code": "tsc && mocha --config mocha-all-plugins-code.json"
|
|
40
|
+
"test-all-plugins-code": "tsc && mocha --config mocha-all-plugins-che-code.json"
|
|
41
41
|
},
|
|
42
42
|
"author": "Ihor Okhrimenko (iokhrime@redhat.com)",
|
|
43
43
|
"license": "ISC",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@types/selenium-webdriver": "4.1.3",
|
|
50
50
|
"axios": "^0.25.0",
|
|
51
51
|
"chai": "4.2.0",
|
|
52
|
-
"chromedriver": "^
|
|
52
|
+
"chromedriver": "^107.0.0",
|
|
53
53
|
"mocha": "^9.1.3",
|
|
54
54
|
"rimraf": "2.6.2",
|
|
55
55
|
"selenium-webdriver": "4.4.0",
|
|
56
56
|
"ts-node": "8.0.3",
|
|
57
|
-
"tslint":
|
|
57
|
+
"tslint": "^6.1.3",
|
|
58
58
|
"typed-rest-client": "1.8.5",
|
|
59
59
|
"typescript": "3.9.9",
|
|
60
60
|
"monaco-page-objects": "3.1.0",
|
|
@@ -86,12 +86,11 @@ export class Workspaces {
|
|
|
86
86
|
Logger.debug(`Workspaces.waitActionsPopup of the '${workspaceName}' list item`);
|
|
87
87
|
|
|
88
88
|
await this.driverHelper.waitVisibility(this.getExpandedActionsLocator(workspaceName), timeout);
|
|
89
|
-
await this.driverHelper.wait(
|
|
89
|
+
await this.driverHelper.wait(2000);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
async openActionsPopup(workspaceName: string, timeout: number = TimeoutConstants.TS_CONTEXT_MENU_TIMEOUT) {
|
|
93
93
|
Logger.debug(`Workspaces.openActionsPopup for the '${workspaceName}' list item`);
|
|
94
|
-
|
|
95
94
|
await this.clickActionsButton(workspaceName);
|
|
96
95
|
await this.waitActionsPopup(workspaceName, timeout);
|
|
97
96
|
}
|
|
@@ -104,8 +103,15 @@ export class Workspaces {
|
|
|
104
103
|
|
|
105
104
|
async clickActionsStopWorkspaceButton(workspaceName: string) {
|
|
106
105
|
Logger.debug(`Workspaces.clickActionsStopWorkspaceButton for the '${workspaceName}' list item`);
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
// workaround because of issue CRW-3649
|
|
107
|
+
try {
|
|
108
|
+
await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace'));
|
|
109
|
+
} catch (e) {
|
|
110
|
+
Logger.warn(`Workspaces.clickActionsStopWorkspaceButton for the '${workspaceName}' list item - popup was missed, try to click one more time (issue CRW-3649).`);
|
|
111
|
+
|
|
112
|
+
await this.driverHelper.waitAndClick(this.getActionsLocator(workspaceName));
|
|
113
|
+
await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace'));
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
async waitDeleteWorkspaceConfirmationWindow(timeout: number = TimeoutConstants.TS_DASHBOARD_WORKSPACE_STOP_TIMEOUT) {
|
|
@@ -52,7 +52,7 @@ export class Ide {
|
|
|
52
52
|
} catch (err) {
|
|
53
53
|
if (err instanceof error.StaleElementReferenceError) {
|
|
54
54
|
Logger.warn('StaleElementException occurred during waiting for IDE. Sleeping for 2 secs and retrying.');
|
|
55
|
-
this.driverHelper.wait(2000);
|
|
55
|
+
await this.driverHelper.wait(2000);
|
|
56
56
|
try {
|
|
57
57
|
await this.driverHelper.waitAndSwitchToFrame(By.css(Ide.IDE_IFRAME_CSS), timeout);
|
|
58
58
|
} catch (err) {
|
|
@@ -56,7 +56,7 @@ export class OpenEditors {
|
|
|
56
56
|
Logger.trace('OpenEditors.waitAndClickExpansionToggle expansion toggle clicked.');
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
async isExpansionToggleCollapsed(timeout: number = TimeoutConstants.TS_OPEN_EDITORS_CLICK_ON_ITEM_TIMEOUT)
|
|
59
|
+
async isExpansionToggleCollapsed(timeout: number = TimeoutConstants.TS_OPEN_EDITORS_CLICK_ON_ITEM_TIMEOUT): Promise<boolean> {
|
|
60
60
|
Logger.debug('OpenEditors.isExpansionToggleCollapsed');
|
|
61
61
|
return await this.driverHelper.waitVisibilityBoolean(OpenEditors.OPEN_EDITORS_EXPANSION_TOGGLE_COLLAPSED_LOCATOR, 1, timeout);
|
|
62
62
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
|
|
11
|
+
import 'reflect-metadata';
|
|
12
|
+
import { CLASSES } from '../inversify.types';
|
|
13
|
+
import { EditorType, TestConstants } from '../TestConstants';
|
|
14
|
+
import { AskForConfirmationTypeTheia, PreferencesHandlerTheia, TerminalRendererTypeTheia } from '../utils/theia/PreferencesHandlerTheia';
|
|
15
|
+
import { CheApiRequestHandler } from '../utils/requestHandlers/CheApiRequestHandler';
|
|
16
|
+
import { TimeoutConstants } from '../TimeoutConstants';
|
|
17
|
+
import * as monacoPageObjects from 'monaco-page-objects';
|
|
18
|
+
import * as vscodeExtensionTesterLocators from 'vscode-extension-tester-locators';
|
|
19
|
+
import { e2eContainer } from '../inversify.config';
|
|
20
|
+
import { DriverHelper } from '../utils/DriverHelper';
|
|
21
|
+
|
|
22
|
+
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
23
|
+
const preferencesHandler: PreferencesHandlerTheia = e2eContainer.get(CLASSES.PreferencesHandlerTheia);
|
|
24
|
+
|
|
25
|
+
exports.mochaHooks = {
|
|
26
|
+
beforeAll: [
|
|
27
|
+
async function enableRequestInterceptor() {
|
|
28
|
+
if (TestConstants.TS_SELENIUM_REQUEST_INTERCEPTOR) {
|
|
29
|
+
CheApiRequestHandler.enableRequestInteceptor();
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
async function enableResponseInterceptor() {
|
|
33
|
+
if (TestConstants.TS_SELENIUM_RESPONSE_INTERCEPTOR) {
|
|
34
|
+
CheApiRequestHandler.enableResponseInterceptor();
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
async function setTheiaSpecificPreferences() {
|
|
38
|
+
if (TestConstants.TS_SELENIUM_EDITOR === EditorType.THEIA) {
|
|
39
|
+
await preferencesHandler.setConfirmExit(AskForConfirmationTypeTheia.never);
|
|
40
|
+
await preferencesHandler.setTerminalType(TerminalRendererTypeTheia.dom);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
async function initMonacoPageObjects() {
|
|
44
|
+
if (TestConstants.TS_SELENIUM_EDITOR === EditorType.CHE_CODE) {
|
|
45
|
+
// init vscode-extension-tester monaco-page-objects
|
|
46
|
+
monacoPageObjects.initPageObjects(TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION, TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, vscodeExtensionTesterLocators.getLocatorsPath(), driverHelper.getDriver(), 'google-chrome');
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
async function prolongTimeoutConstantsInDebugMode() {
|
|
50
|
+
if (TestConstants.TS_DEBUG_MODE === true) {
|
|
51
|
+
for (let [timeout, seconds] of Object.entries(TimeoutConstants)) {
|
|
52
|
+
Object.defineProperty(TimeoutConstants, timeout, {value: seconds * 100});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
};
|
|
@@ -7,19 +7,16 @@
|
|
|
7
7
|
*
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
|
-
import 'reflect-metadata';
|
|
11
|
-
import { CLASSES } from '../../../inversify.types';
|
|
12
10
|
import { e2eContainer } from '../../../inversify.config';
|
|
11
|
+
import { ActivityBar, ViewControl, Workbench } from 'monaco-page-objects';
|
|
12
|
+
import { CLASSES } from '../../../inversify.types';
|
|
13
13
|
import { WorkspaceHandlingTests } from '../../../testsLibrary/WorkspaceHandlingTests';
|
|
14
|
-
import CheReporter from '../../../driver/CheReporter';
|
|
15
14
|
import { Logger } from '../../../utils/Logger';
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import { Workbench } from 'monaco-page-objects';
|
|
15
|
+
import CheReporter from '../../../driver/CheReporter';
|
|
16
|
+
import { ProjectAndFileTestsCheCode } from '../../../testsLibrary/che-code/ProjectAndFileTestsCheCode';
|
|
19
17
|
|
|
20
18
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
21
|
-
const
|
|
22
|
-
|
|
19
|
+
const projectAndFileTests: ProjectAndFileTestsCheCode = e2eContainer.get(CLASSES.ProjectAndFileTestsCheCode);
|
|
23
20
|
const stackName: string = 'Empty Workspace';
|
|
24
21
|
|
|
25
22
|
suite(`${stackName} test`, async () => {
|
|
@@ -30,28 +27,21 @@ suite(`${stackName} test`, async () => {
|
|
|
30
27
|
CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
31
28
|
});
|
|
32
29
|
test('Wait workspace readiness', async() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
throw err;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
let workbench = new Workbench();
|
|
43
|
-
let activityBar = workbench.getActivityBar();
|
|
44
|
-
let activityBarControls = await activityBar.getViewControls();
|
|
30
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
31
|
+
|
|
32
|
+
const workbench: Workbench = new Workbench();
|
|
33
|
+
const activityBar: ActivityBar = workbench.getActivityBar();
|
|
34
|
+
const activityBarControls: ViewControl[] = await activityBar.getViewControls();
|
|
35
|
+
|
|
45
36
|
Logger.debug(`Editor sections:`);
|
|
46
|
-
|
|
37
|
+
for (const control of activityBarControls) {
|
|
47
38
|
Logger.debug(`${await control.getTitle()}`);
|
|
48
|
-
}
|
|
39
|
+
}
|
|
49
40
|
});
|
|
50
|
-
// projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, false);
|
|
51
41
|
});
|
|
52
42
|
|
|
53
43
|
suite('Stopping and deleting the workspace', async () => {
|
|
54
|
-
test(`Stop and
|
|
44
|
+
test(`Stop and remove workspace`, async () => {
|
|
55
45
|
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
56
46
|
});
|
|
57
47
|
});
|
|
@@ -27,7 +27,7 @@ const workspaceSampleName: string = 'dotnet-web-simple';
|
|
|
27
27
|
const fileFolderPath: string = `${workspaceSampleName}`;
|
|
28
28
|
const tabTitle: string = 'Program.cs';
|
|
29
29
|
// const codeNavigationClassName: string = '[metadata] Console.cs';
|
|
30
|
-
const stack
|
|
30
|
+
const stack: string = 'ASP.NET Core Web Application';
|
|
31
31
|
const updateDependenciesTaskName: string = 'update dependencies';
|
|
32
32
|
const buildTaskName: string = 'build';
|
|
33
33
|
const runTaskName: string = 'run';
|
|
@@ -21,7 +21,7 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti
|
|
|
21
21
|
const testWorkspaceUtils: ITestWorkspaceUtil = e2eContainer.get<ITestWorkspaceUtil>(TYPES.WorkspaceUtil);
|
|
22
22
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
23
23
|
|
|
24
|
-
const factoryUrl
|
|
24
|
+
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-maven/devfile.yaml`;
|
|
25
25
|
const workspaceSampleName: string = 'console-java-simple';
|
|
26
26
|
const workspaceRootFolderName: string = 'src';
|
|
27
27
|
|
|
@@ -21,7 +21,7 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
|
|
|
21
21
|
const projectAndFileTests: ProjectAndFileTestsTheia = e2eContainer.get(CLASSES.ProjectAndFileTestsTheia);
|
|
22
22
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
23
23
|
|
|
24
|
-
const factoryUrl
|
|
24
|
+
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/master/src`;
|
|
25
25
|
const workspaceSampleName: string = 'console-java-simple';
|
|
26
26
|
const workspaceRootFolderName: string = 'src';
|
|
27
27
|
const fileName: string = 'pom.xml';
|
|
@@ -21,7 +21,7 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
|
|
|
21
21
|
const projectAndFileTests: ProjectAndFileTestsTheia = e2eContainer.get(CLASSES.ProjectAndFileTestsTheia);
|
|
22
22
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
23
23
|
|
|
24
|
-
const factoryUrl
|
|
24
|
+
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple`;
|
|
25
25
|
const workspaceSampleName: string = 'console-java-simple';
|
|
26
26
|
const workspaceRootFolderName: string = 'src';
|
|
27
27
|
const fileFolderPath: string = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
|
|
@@ -21,7 +21,7 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
|
|
|
21
21
|
const projectAndFileTests: ProjectAndFileTestsTheia = e2eContainer.get(CLASSES.ProjectAndFileTestsTheia);
|
|
22
22
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
23
23
|
|
|
24
|
-
let factoryUrl
|
|
24
|
+
let factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11`;
|
|
25
25
|
const workspaceSampleName: string = 'console-java-simple';
|
|
26
26
|
const workspaceRootFolderName: string = 'src';
|
|
27
27
|
const fileFolderPath: string = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
|
|
@@ -55,7 +55,7 @@ const SpringAppLocators = {
|
|
|
55
55
|
|
|
56
56
|
// this test checks only workspace created from "web-nodejs-sample" https://github.com/devfile/devworkspace-operator/blob/main/samples/flattened_theia-next.yaml.
|
|
57
57
|
suite('Workspace creation via factory url', async () => {
|
|
58
|
-
let factoryUrl
|
|
58
|
+
let factoryUrl: string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
|
|
59
59
|
|
|
60
60
|
suite('Open factory URL', async () => {
|
|
61
61
|
// this is DevWorkspace test specific - we create the test ws. using factory instead of chectl
|
|
@@ -106,7 +106,7 @@ suite('Language server validation', async () => {
|
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
test('Error highlighting', async () => {
|
|
109
|
-
await driverHelper.
|
|
109
|
+
await driverHelper.wait(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004
|
|
110
110
|
|
|
111
111
|
const textForErrorDisplaying: string = '$';
|
|
112
112
|
await editor.type(javaFileName, textForErrorDisplaying, 30);
|
|
@@ -242,7 +242,7 @@ async function switchAppWindowAndCheck(contentLocator: By) {
|
|
|
242
242
|
break;
|
|
243
243
|
} else {
|
|
244
244
|
console.log(`----------- The Spring app is not available. Attempt # ${index}. Waiting ${TimeoutConstants.TS_SELENIUM_DIALOG_WIDGET_TIMEOUT}s`);
|
|
245
|
-
await driverHelper.
|
|
245
|
+
await driverHelper.wait(TimeoutConstants.TS_SELENIUM_DIALOG_WIDGET_TIMEOUT);
|
|
246
246
|
await driverHelper.getDriver().navigate().refresh();
|
|
247
247
|
}
|
|
248
248
|
}
|
|
@@ -119,7 +119,7 @@ suite('Language server validation', async () => {
|
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
test('Error highlighting', async () => {
|
|
122
|
-
await driverHelper.
|
|
122
|
+
await driverHelper.wait(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004
|
|
123
123
|
|
|
124
124
|
const textForErrorDisplaying: string = '$';
|
|
125
125
|
await editor.type(javaFileName, textForErrorDisplaying, 30);
|
|
@@ -19,7 +19,7 @@ import { Logger } from '../utils/Logger';
|
|
|
19
19
|
import { ApiUrlResolver } from '../utils/workspace/ApiUrlResolver';
|
|
20
20
|
import { TimeoutConstants } from '../TimeoutConstants';
|
|
21
21
|
import { DriverHelper } from '../utils/DriverHelper';
|
|
22
|
-
import { By } from 'selenium-webdriver';
|
|
22
|
+
import { By, error } from 'selenium-webdriver';
|
|
23
23
|
import { TestConstants } from '../TestConstants';
|
|
24
24
|
|
|
25
25
|
@injectable()
|
|
@@ -33,8 +33,7 @@ export class WorkspaceHandlingTests {
|
|
|
33
33
|
WorkspaceHandlingTests.workspaceName = workspaceName;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
private static
|
|
37
|
-
private static READY_TO_READ_WORKSPACE_NAME_LOCATOR: By = By.xpath(`//div[@class="ui-container"]/div[@class="pf-c-page"]//div[@class="pf-c-content"]/h1[contains(.,'Starting workspace ')]`);
|
|
36
|
+
private static WORKSPACE_NAME_LOCATOR: By = By.xpath(`//h1[contains(.,'Starting workspace ')]`);
|
|
38
37
|
private static workspaceName: string = 'undefined';
|
|
39
38
|
private static parentGUID: string;
|
|
40
39
|
|
|
@@ -80,31 +79,39 @@ export class WorkspaceHandlingTests {
|
|
|
80
79
|
|
|
81
80
|
public obtainWorkspaceNameFromStartingPage(): void {
|
|
82
81
|
test('Obtain workspace name from workspace loader page', async() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
for (let i: number = 0; i < attempts; i++) {
|
|
93
|
-
startingWorkspaceLineContent = await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.START_WORKSPACE_PAGE_NAME_LOCATOR).getAttribute('innerHTML');
|
|
94
|
-
|
|
82
|
+
const timeout: number = TimeoutConstants.TS_IDE_LOAD_TIMEOUT;
|
|
83
|
+
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
84
|
+
const attempts: number = Math.ceil(timeout / polling);
|
|
85
|
+
|
|
86
|
+
for (let i: number = 0; i < attempts; i++) {
|
|
87
|
+
try {
|
|
88
|
+
let startingWorkspaceLineContent: string = await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.WORKSPACE_NAME_LOCATOR).getText();
|
|
89
|
+
Logger.trace(`WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage obtained starting workspace getText():${startingWorkspaceLineContent}`);
|
|
95
90
|
// cutting away leading text
|
|
96
91
|
WorkspaceHandlingTests.workspaceName = startingWorkspaceLineContent.substring('Starting workspace '.length).trim();
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
Logger.trace(`WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage trimmed workspace name from getText():${WorkspaceHandlingTests.workspaceName}`);
|
|
93
|
+
break;
|
|
94
|
+
} catch (err) {
|
|
95
|
+
if (err instanceof error.StaleElementReferenceError) {
|
|
96
|
+
Logger.warn(`WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage Failed to obtain name from workspace start page, element possibly detached from DOM. Retrying.`);
|
|
97
|
+
await this.driverHelper.wait(polling);
|
|
98
|
+
continue;
|
|
100
99
|
}
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
if (err instanceof error.NoSuchElementError) {
|
|
101
|
+
Logger.warn(`WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage Failed to obtain name from workspace start page, element not visible yet. Retrying.`);
|
|
102
|
+
await this.driverHelper.wait(polling);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
Logger.error(`WorkspaceHandlingTests.obtainWorkspaceNameFromStartingPage Obtaining workspace name failed with an unexpected error:${err}`);
|
|
106
|
+
throw err;
|
|
103
107
|
}
|
|
104
|
-
} catch (err) {
|
|
105
|
-
Logger.error(`Failed to obtain workspace name from workspace loader page: ${err}`);
|
|
106
|
-
throw err;
|
|
107
108
|
}
|
|
109
|
+
if (WorkspaceHandlingTests.workspaceName !== '' && WorkspaceHandlingTests.workspaceName !== undefined) {
|
|
110
|
+
Logger.info(`Obtained workspace name from workspace loader page: ${WorkspaceHandlingTests.workspaceName}`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
Logger.error(`WorkspaceHandlingTests.obtainWorkspaceNameFromSartingPage failed to obtain workspace name:${WorkspaceHandlingTests.workspaceName}`);
|
|
114
|
+
throw new error.InvalidArgumentError(`WorkspaceHandlingTests.obtainWorkspaceNameFromSartingPage failed to obtain workspace name:${WorkspaceHandlingTests.workspaceName}`);
|
|
108
115
|
});
|
|
109
116
|
}
|
|
110
117
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
|
|
11
|
+
import 'reflect-metadata';
|
|
12
|
+
import { inject, injectable } from 'inversify';
|
|
13
|
+
import { By, until } from 'selenium-webdriver';
|
|
14
|
+
import { DriverHelper } from '../../utils/DriverHelper';
|
|
15
|
+
import { CLASSES } from '../../inversify.types';
|
|
16
|
+
|
|
17
|
+
@injectable()
|
|
18
|
+
export class ProjectAndFileTestsCheCode {
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {}
|
|
22
|
+
|
|
23
|
+
public async waitWorkspaceReadinessForCheCodeEditor(): Promise<void> {
|
|
24
|
+
try {
|
|
25
|
+
await this.driverHelper.getDriver().wait(until.elementLocated(By.className('monaco-workbench')));
|
|
26
|
+
} catch (err) {
|
|
27
|
+
if ((err as Error).name === 'WebDriverError') {
|
|
28
|
+
await new Promise(res => setTimeout(res, 3000));
|
|
29
|
+
} else {
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -97,7 +97,7 @@ export class LanguageServerTestsTheia {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
public goToDefinition(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout
|
|
100
|
+
public goToDefinition(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout: number = TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT) {
|
|
101
101
|
test('Go to Definition', async () => {
|
|
102
102
|
try {
|
|
103
103
|
await this.editor.moveCursorToLineAndChar(openedFile, line, char);
|
|
@@ -123,7 +123,7 @@ export class LanguageServerTestsTheia {
|
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
public goToImplementations(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout
|
|
126
|
+
public goToImplementations(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout: number = TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT) {
|
|
127
127
|
test('Go to Implementations', async () => {
|
|
128
128
|
try {
|
|
129
129
|
await this.editor.moveCursorToLineAndChar(openedFile, line, char);
|
|
@@ -55,7 +55,7 @@ export class ProjectAndFileTestsTheia {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
public waitWorkspaceReadiness(sampleName
|
|
58
|
+
public waitWorkspaceReadiness(sampleName: string, folder: string, checkNotification: boolean = true, restartWorkspaceDialogIsExpected: boolean = false) {
|
|
59
59
|
test('Wait for workspace readiness', async () => {
|
|
60
60
|
await this.ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
|
|
61
61
|
|
|
@@ -72,7 +72,7 @@ export class ProjectAndFileTestsTheia {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
public waitWorkspaceReadinessNoSubfolder(sampleName
|
|
75
|
+
public waitWorkspaceReadinessNoSubfolder(sampleName: string, checkNotification: boolean = true) {
|
|
76
76
|
test('Wait for workspace readiness', async () => {
|
|
77
77
|
await this.ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
|
|
78
78
|
if (checkNotification) {
|
package/tslint.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"forin": true,
|
|
27
27
|
"indent": [
|
|
28
28
|
true,
|
|
29
|
-
|
|
29
|
+
"spaces"
|
|
30
30
|
],
|
|
31
31
|
"interface-name": true,
|
|
32
32
|
"jsdoc-format": true,
|
|
@@ -59,15 +59,18 @@
|
|
|
59
59
|
"no-eval": true,
|
|
60
60
|
"no-string-literal": true,
|
|
61
61
|
"no-switch-case-fall-through": true,
|
|
62
|
-
"trailing-comma": [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
"trailing-comma": [
|
|
63
|
+
true,
|
|
64
|
+
{
|
|
65
|
+
"singleline": "never",
|
|
66
|
+
"multiline": {
|
|
67
|
+
"objects": "ignore",
|
|
68
|
+
"arrays": "always",
|
|
69
|
+
"functions": "never",
|
|
70
|
+
"typeLiterals": "ignore"
|
|
71
|
+
}
|
|
69
72
|
}
|
|
70
|
-
|
|
73
|
+
],
|
|
71
74
|
"no-trailing-whitespace": true,
|
|
72
75
|
"no-unused-expression": true,
|
|
73
76
|
"no-unused-variable": true,
|
|
@@ -92,11 +95,11 @@
|
|
|
92
95
|
],
|
|
93
96
|
"typedef": [
|
|
94
97
|
true,
|
|
95
|
-
"call-signature",
|
|
96
|
-
"member-variable-declaration",
|
|
98
|
+
// "call-signature",
|
|
99
|
+
// "member-variable-declaration",
|
|
97
100
|
"parameter",
|
|
98
|
-
"property-declaration"
|
|
99
|
-
"variable-declaration"
|
|
101
|
+
"property-declaration"
|
|
102
|
+
// "variable-declaration"
|
|
100
103
|
],
|
|
101
104
|
"typedef-whitespace": [
|
|
102
105
|
true,
|
package/utils/DriverHelper.ts
CHANGED
|
@@ -82,7 +82,7 @@ export class GitHubUtil {
|
|
|
82
82
|
const arrayOfPublicKeys = JSON.parse(stringified);
|
|
83
83
|
for (let entry of arrayOfPublicKeys) {
|
|
84
84
|
if (entry.title === keyName) {
|
|
85
|
-
this.removePublicSshKey(authToken, entry.id);
|
|
85
|
+
await this.removePublicSshKey(authToken, entry.id);
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -97,7 +97,7 @@ export class GitHubUtil {
|
|
|
97
97
|
try {
|
|
98
98
|
const idList: string[] = await this.getPublicSshKeys(authToken);
|
|
99
99
|
for (let id of idList) {
|
|
100
|
-
this.removePublicSshKey(authToken, id);
|
|
100
|
+
await this.removePublicSshKey(authToken, id);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
} catch (error) {
|
|
@@ -34,7 +34,7 @@ export class ApiUrlResolver {
|
|
|
34
34
|
return ApiUrlResolver.KUBERNETES_API_URL;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
private async obtainUserNamespace()
|
|
37
|
+
private async obtainUserNamespace(): Promise<string> {
|
|
38
38
|
Logger.debug(`ApiUrlResolver.obtainUserNamespace ${this.userNamespace}`);
|
|
39
39
|
if (this.userNamespace.length === 0) {
|
|
40
40
|
Logger.trace(`ApiUrlResolver.obtainUserNamespace USER_NAMESPACE.length = 0, calling kubernetes API`);
|