@eclipse-che/che-e2e 7.118.0 → 7.119.0-next-c0a0e9b
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/dist/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.js +36 -23
- package/dist/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.js.map +1 -1
- package/package.json +2 -3
- package/specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts +56 -25
|
@@ -15,7 +15,6 @@ const WorkspaceHandlingTests_1 = require("../../tests-library/WorkspaceHandlingT
|
|
|
15
15
|
const chai_1 = require("chai");
|
|
16
16
|
const Logger_1 = require("../../utils/Logger");
|
|
17
17
|
const BASE_TEST_CONSTANTS_1 = require("../../constants/BASE_TEST_CONSTANTS");
|
|
18
|
-
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
19
18
|
suite('Check Visual Studio Code (desktop) (SSH) with all samples', function () {
|
|
20
19
|
this.timeout(6000000);
|
|
21
20
|
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
|
|
@@ -25,11 +24,9 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function () {
|
|
|
25
24
|
const driverHelper = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.DriverHelper);
|
|
26
25
|
const vsCodeDesktopSshEditor = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]';
|
|
27
26
|
const useExtensionSwitcher = '//label[@class="switch"]';
|
|
28
|
-
const useExtensionPageId = '//div[@id="docs-parent"]';
|
|
29
27
|
const titlexPath = '//div[@class="header-title"]';
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const sshKonfigxPath = '//*[@id="config"]';
|
|
28
|
+
let currentTabHandle = 'undefined';
|
|
29
|
+
const pollingForCheckTitle = 100;
|
|
33
30
|
const samplesForCheck = [
|
|
34
31
|
'Empty Workspace',
|
|
35
32
|
'JBoss EAP 8.0',
|
|
@@ -56,38 +53,50 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function () {
|
|
|
56
53
|
});
|
|
57
54
|
async function clickOnElementByXpath(xpath) {
|
|
58
55
|
Logger_1.Logger.debug();
|
|
59
|
-
await driverHelper
|
|
56
|
+
await driverHelper
|
|
57
|
+
.getDriver()
|
|
58
|
+
.executeScript(`document.evaluate('${xpath}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`);
|
|
59
|
+
}
|
|
60
|
+
function clearCurrentTabHandle() {
|
|
61
|
+
currentTabHandle = 'undefined';
|
|
60
62
|
}
|
|
61
63
|
async function testWorkspaceStartup(sampleNameOrUrl, isUrl) {
|
|
62
64
|
await dashboard.openDashboard();
|
|
65
|
+
currentTabHandle = await browserTabsUtil.getCurrentWindowHandle();
|
|
63
66
|
await dashboard.clickCreateWorkspaceButton();
|
|
64
67
|
if (isUrl) {
|
|
65
|
-
await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndGitUrl(vsCodeDesktopSshEditor, sampleNameOrUrl, titlexPath);
|
|
68
|
+
await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndGitUrl(vsCodeDesktopSshEditor, sampleNameOrUrl, titlexPath, pollingForCheckTitle);
|
|
66
69
|
}
|
|
67
70
|
else {
|
|
68
|
-
await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(vsCodeDesktopSshEditor, sampleNameOrUrl, titlexPath);
|
|
71
|
+
await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(vsCodeDesktopSshEditor, sampleNameOrUrl, titlexPath, pollingForCheckTitle);
|
|
69
72
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
+
// read page
|
|
74
|
+
const pageTextBeforeUseExtensionSwitcher = await driverHelper.getDriver().executeScript('return document.body.innerText;');
|
|
75
|
+
// click on "Use Extension" switcher
|
|
73
76
|
await clickOnElementByXpath(useExtensionSwitcher);
|
|
74
|
-
//
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
(0, chai_1.expect)(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
(0, chai_1.expect)(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(
|
|
77
|
+
// read page
|
|
78
|
+
const pageTextAfterUseExtensionSwitcher = await driverHelper.getDriver().executeScript('return document.body.innerText;');
|
|
79
|
+
// checks for "Install extensions" state
|
|
80
|
+
(0, chai_1.expect)(pageTextBeforeUseExtensionSwitcher).contains('Install the following VS Code extensions');
|
|
81
|
+
Logger_1.Logger.info('"Install the following VS Code extensions" was found in page before "Use Extension" clicked');
|
|
82
|
+
(0, chai_1.expect)(pageTextBeforeUseExtensionSwitcher).contains('Workspace ' + WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName() + ' is running');
|
|
83
|
+
Logger_1.Logger.info('Workspace name "' + WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName() + ' is running" was found before "Use Extension" clicked');
|
|
84
|
+
// checks for SSH state
|
|
85
|
+
(0, chai_1.expect)(pageTextAfterUseExtensionSwitcher).contains('Workspace ' + WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName() + ' is running');
|
|
86
|
+
Logger_1.Logger.info('Workspace name "' + WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName() + ' is running" was found after "Use Extension" clicked');
|
|
87
|
+
(0, chai_1.expect)(pageTextAfterUseExtensionSwitcher).contains('oc port-forward -n admin-devspaces');
|
|
88
|
+
Logger_1.Logger.info('"oc port-forward -n admin-devspaces" was found after "Use Extension" clicked');
|
|
89
|
+
(0, chai_1.expect)(pageTextAfterUseExtensionSwitcher)
|
|
90
|
+
.contains('-----BEGIN OPENSSH PRIVATE KEY-----')
|
|
91
|
+
.and.contains('-----END OPENSSH PRIVATE KEY-----');
|
|
92
|
+
Logger_1.Logger.info('SSH private key (BEGIN and END markers) was found after "Use Extension" clicked');
|
|
93
|
+
(0, chai_1.expect)(pageTextAfterUseExtensionSwitcher)
|
|
86
94
|
.contains('HostName')
|
|
87
95
|
.and.contains('User')
|
|
88
96
|
.and.contains('Port')
|
|
89
97
|
.and.contains('IdentityFile')
|
|
90
98
|
.and.contains('UserKnownHostsFile');
|
|
99
|
+
Logger_1.Logger.info('SSH config parameters (HostName, User, Port, IdentityFile, UserKnownHostsFile) were found after "Use Extension" clicked');
|
|
91
100
|
}
|
|
92
101
|
samplesForCheck.forEach((sampleName) => {
|
|
93
102
|
test('Test start of VSCode (desktop) (SSH) with default Samples', async function () {
|
|
@@ -111,6 +120,9 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function () {
|
|
|
111
120
|
}
|
|
112
121
|
teardown('Delete DevWorkspace', async function () {
|
|
113
122
|
Logger_1.Logger.info('Delete DevWorkspace. After each test.');
|
|
123
|
+
if (currentTabHandle !== 'undefined') {
|
|
124
|
+
await browserTabsUtil.switchToWindow(currentTabHandle);
|
|
125
|
+
}
|
|
114
126
|
await dashboard.openDashboard();
|
|
115
127
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
116
128
|
if (WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName() !== 'undefined') {
|
|
@@ -118,6 +130,7 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function () {
|
|
|
118
130
|
await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName());
|
|
119
131
|
}
|
|
120
132
|
WorkspaceHandlingTests_1.WorkspaceHandlingTests.clearWorkspaceName();
|
|
133
|
+
clearCurrentTabHandle();
|
|
121
134
|
});
|
|
122
135
|
});
|
|
123
136
|
//# sourceMappingURL=StartWorkspaceUsingVSCodeDesktopSshEditor.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartWorkspaceUsingVSCodeDesktopSshEditor.spec.js","sourceRoot":"","sources":["../../../specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;AAExE,qEAA8D;AAC9D,mEAAwD;AAIxD,uFAAoF;AACpF,+BAA8B;AAC9B,+CAA4C;AAC5C,6EAA0E;
|
|
1
|
+
{"version":3,"file":"StartWorkspaceUsingVSCodeDesktopSshEditor.spec.js","sourceRoot":"","sources":["../../../specs/dashboard-samples/StartWorkspaceUsingVSCodeDesktopSshEditor.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;AAExE,qEAA8D;AAC9D,mEAAwD;AAIxD,uFAAoF;AACpF,+BAA8B;AAC9B,+CAA4C;AAC5C,6EAA0E;AAG1E,KAAK,CAAC,2DAA2D,EAAE;IAClE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,MAAM,sBAAsB,GAA2B,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,sBAAsB,CAAC,CAAC;IACxG,MAAM,UAAU,GAAe,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,UAAU,CAAC,CAAC;IACpE,MAAM,SAAS,GAAc,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,SAAS,CAAC,CAAC;IACjE,MAAM,eAAe,GAAoB,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,eAAe,CAAC,CAAC;IACnF,MAAM,YAAY,GAAiB,+BAAY,CAAC,GAAG,CAAC,yBAAO,CAAC,YAAY,CAAC,CAAC;IAE1E,MAAM,sBAAsB,GAAW,oEAAoE,CAAC;IAC5G,MAAM,oBAAoB,GAAW,0BAA0B,CAAC;IAChE,MAAM,UAAU,GAAW,8BAA8B,CAAC;IAE1D,IAAI,gBAAgB,GAAW,WAAW,CAAC;IAC3C,MAAM,oBAAoB,GAAW,GAAG,CAAC;IAEzC,MAAM,eAAe,GAAa;QACjC,iBAAiB;QACjB,eAAe;QACf,aAAa;Q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CAAC;SACtF;QAED,+CAAsB,CAAC,kBAAkB,EAAE,CAAC;QAC5C,qBAAqB,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-che/che-e2e",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.119.0-next-c0a0e9b",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -66,8 +66,7 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@eclipse-che/api": "latest",
|
|
68
68
|
"inversify": "6.0.1",
|
|
69
|
-
"reflect-metadata": "0.1.13"
|
|
70
|
-
"@eclipse-che/che-devworkspace-generator": "7.118.0"
|
|
69
|
+
"reflect-metadata": "0.1.13"
|
|
71
70
|
},
|
|
72
71
|
"resolutions": {
|
|
73
72
|
"minimist": "^1.2.5"
|
|
@@ -18,7 +18,6 @@ import { expect } from 'chai';
|
|
|
18
18
|
import { Logger } from '../../utils/Logger';
|
|
19
19
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
20
20
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
21
|
-
import { By } from 'selenium-webdriver';
|
|
22
21
|
|
|
23
22
|
suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void {
|
|
24
23
|
this.timeout(6000000);
|
|
@@ -29,14 +28,11 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function ():
|
|
|
29
28
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
30
29
|
|
|
31
30
|
const vsCodeDesktopSshEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]';
|
|
32
|
-
|
|
33
31
|
const useExtensionSwitcher: string = '//label[@class="switch"]';
|
|
34
|
-
const useExtensionPageId: string = '//div[@id="docs-parent"]';
|
|
35
|
-
|
|
36
32
|
const titlexPath: string = '//div[@class="header-title"]';
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
33
|
+
|
|
34
|
+
let currentTabHandle: string = 'undefined';
|
|
35
|
+
const pollingForCheckTitle: number = 100;
|
|
40
36
|
|
|
41
37
|
const samplesForCheck: string[] = [
|
|
42
38
|
'Empty Workspace',
|
|
@@ -68,48 +64,79 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function ():
|
|
|
68
64
|
|
|
69
65
|
async function clickOnElementByXpath(xpath: string): Promise<void> {
|
|
70
66
|
Logger.debug();
|
|
71
|
-
await driverHelper
|
|
67
|
+
await driverHelper
|
|
68
|
+
.getDriver()
|
|
69
|
+
.executeScript(
|
|
70
|
+
`document.evaluate('${xpath}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function clearCurrentTabHandle(): void {
|
|
75
|
+
currentTabHandle = 'undefined';
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
async function testWorkspaceStartup(sampleNameOrUrl: string, isUrl: boolean): Promise<void> {
|
|
75
79
|
await dashboard.openDashboard();
|
|
80
|
+
currentTabHandle = await browserTabsUtil.getCurrentWindowHandle();
|
|
76
81
|
await dashboard.clickCreateWorkspaceButton();
|
|
77
82
|
|
|
78
83
|
if (isUrl) {
|
|
79
84
|
await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndGitUrl(
|
|
80
85
|
vsCodeDesktopSshEditor,
|
|
81
86
|
sampleNameOrUrl,
|
|
82
|
-
titlexPath
|
|
87
|
+
titlexPath,
|
|
88
|
+
pollingForCheckTitle
|
|
83
89
|
);
|
|
84
90
|
} else {
|
|
85
91
|
await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(
|
|
86
92
|
vsCodeDesktopSshEditor,
|
|
87
93
|
sampleNameOrUrl,
|
|
88
|
-
titlexPath
|
|
94
|
+
titlexPath,
|
|
95
|
+
pollingForCheckTitle
|
|
89
96
|
);
|
|
90
97
|
}
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
// read page
|
|
100
|
+
const pageTextBeforeUseExtensionSwitcher: string = await driverHelper.getDriver().executeScript('return document.body.innerText;');
|
|
101
|
+
|
|
102
|
+
// click on "Use Extension" switcher
|
|
95
103
|
await clickOnElementByXpath(useExtensionSwitcher);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
expect(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
expect(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
|
|
105
|
+
// read page
|
|
106
|
+
const pageTextAfterUseExtensionSwitcher: string = await driverHelper.getDriver().executeScript('return document.body.innerText;');
|
|
107
|
+
|
|
108
|
+
// checks for "Install extensions" state
|
|
109
|
+
expect(pageTextBeforeUseExtensionSwitcher).contains('Install the following VS Code extensions');
|
|
110
|
+
Logger.info('"Install the following VS Code extensions" was found in page before "Use Extension" clicked');
|
|
111
|
+
|
|
112
|
+
expect(pageTextBeforeUseExtensionSwitcher).contains('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running');
|
|
113
|
+
Logger.info(
|
|
114
|
+
'Workspace name "' + WorkspaceHandlingTests.getWorkspaceName() + ' is running" was found before "Use Extension" clicked'
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
// checks for SSH state
|
|
118
|
+
expect(pageTextAfterUseExtensionSwitcher).contains('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running');
|
|
119
|
+
Logger.info(
|
|
120
|
+
'Workspace name "' + WorkspaceHandlingTests.getWorkspaceName() + ' is running" was found after "Use Extension" clicked'
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
expect(pageTextAfterUseExtensionSwitcher).contains('oc port-forward -n admin-devspaces');
|
|
124
|
+
Logger.info('"oc port-forward -n admin-devspaces" was found after "Use Extension" clicked');
|
|
125
|
+
|
|
126
|
+
expect(pageTextAfterUseExtensionSwitcher)
|
|
127
|
+
.contains('-----BEGIN OPENSSH PRIVATE KEY-----')
|
|
128
|
+
.and.contains('-----END OPENSSH PRIVATE KEY-----');
|
|
129
|
+
Logger.info('SSH private key (BEGIN and END markers) was found after "Use Extension" clicked');
|
|
130
|
+
|
|
131
|
+
expect(pageTextAfterUseExtensionSwitcher)
|
|
108
132
|
.contains('HostName')
|
|
109
133
|
.and.contains('User')
|
|
110
134
|
.and.contains('Port')
|
|
111
135
|
.and.contains('IdentityFile')
|
|
112
136
|
.and.contains('UserKnownHostsFile');
|
|
137
|
+
Logger.info(
|
|
138
|
+
'SSH config parameters (HostName, User, Port, IdentityFile, UserKnownHostsFile) were found after "Use Extension" clicked'
|
|
139
|
+
);
|
|
113
140
|
}
|
|
114
141
|
|
|
115
142
|
samplesForCheck.forEach((sampleName): void => {
|
|
@@ -135,6 +162,9 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function ():
|
|
|
135
162
|
|
|
136
163
|
teardown('Delete DevWorkspace', async function (): Promise<void> {
|
|
137
164
|
Logger.info('Delete DevWorkspace. After each test.');
|
|
165
|
+
if (currentTabHandle !== 'undefined') {
|
|
166
|
+
await browserTabsUtil.switchToWindow(currentTabHandle);
|
|
167
|
+
}
|
|
138
168
|
|
|
139
169
|
await dashboard.openDashboard();
|
|
140
170
|
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
@@ -145,5 +175,6 @@ suite('Check Visual Studio Code (desktop) (SSH) with all samples', function ():
|
|
|
145
175
|
}
|
|
146
176
|
|
|
147
177
|
WorkspaceHandlingTests.clearWorkspaceName();
|
|
178
|
+
clearCurrentTabHandle();
|
|
148
179
|
});
|
|
149
180
|
});
|