@eclipse-che/che-e2e 7.75.0-next-b6eb83e → 7.75.0-next-2113c0d
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/.eslintrc.js +1 -1
- package/README.md +1 -0
- package/configs/mocharc.ts +2 -1
- package/configs/reporters-config.json +6 -0
- package/constants/PLUGIN_TEST_CONSTANTS.ts +3 -1
- package/constants/TIMEOUT_CONSTANTS.ts +8 -2
- package/dist/configs/mocharc.js +2 -1
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/PLUGIN_TEST_CONSTANTS.js +2 -1
- package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -1
- package/dist/constants/TIMEOUT_CONSTANTS.js +6 -2
- package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/specs/MochaHooks.js +16 -4
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +3 -6
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +1 -2
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +67 -73
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +1 -5
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +1 -24
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +1 -24
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/WorkpaseUsingParent.spec.js +2 -2
- package/dist/specs/miscellaneous/WorkpaseUsingParent.spec.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +10 -14
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +4 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +1 -1
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +2 -2
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +2 -3
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/package.json +8 -1
- package/pageobjects/ide/CheCodeLocatorLoader.ts +1 -1
- package/specs/MochaHooks.ts +15 -2
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +64 -71
- package/specs/factory/Factory.spec.ts +1 -6
- package/specs/factory/NoSetupRepoFactory.spec.ts +1 -26
- package/specs/factory/RefusedOAuthFactory.spec.ts +1 -26
- package/tests-library/ProjectAndFileTests.ts +17 -15
- package/tests-library/WorkspaceHandlingTests.ts +1 -1
- package/tsconfig.json +2 -2
- package/utils/DriverHelper.ts +1 -1
|
@@ -39,7 +39,7 @@ export class CheCodeLocatorLoader extends LocatorLoader {
|
|
|
39
39
|
locators: {
|
|
40
40
|
WelcomeContent: {
|
|
41
41
|
text: By.xpath('//*[@class="dialog-message-text" and contains(text(), "trust")]'),
|
|
42
|
-
button: By.xpath('//a[
|
|
42
|
+
button: By.xpath('//div[@class="monaco-dialog-box"]//a[@class="monaco-button monaco-text-button"]')
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
extras: {
|
package/specs/MochaHooks.ts
CHANGED
|
@@ -18,15 +18,17 @@ import { e2eContainer } from '../configs/inversify.config';
|
|
|
18
18
|
import { DriverHelper } from '../utils/DriverHelper';
|
|
19
19
|
import { ITestWorkspaceUtil } from '../utils/workspace/ITestWorkspaceUtil';
|
|
20
20
|
import { Logger } from '../utils/Logger';
|
|
21
|
+
import { allure } from 'allure-mocha/runtime';
|
|
21
22
|
import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';
|
|
22
|
-
import { CHROME_DRIVER_CONSTANTS } from '../constants/CHROME_DRIVER_CONSTANTS';
|
|
23
23
|
import { MONACO_CONSTANTS } from '../constants/MONACO_CONSTANTS';
|
|
24
|
+
import { CHROME_DRIVER_CONSTANTS } from '../constants/CHROME_DRIVER_CONSTANTS';
|
|
24
25
|
|
|
25
26
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
26
27
|
let latestWorkspace: string = '';
|
|
27
28
|
|
|
28
29
|
export function registerRunningWorkspace(workspaceName: string): void {
|
|
29
|
-
Logger.debug(`with workspaceName:${workspaceName}`);
|
|
30
|
+
workspaceName !== '' ? Logger.debug(`with workspaceName:${workspaceName}`) : Logger.debug('delete workspace name');
|
|
31
|
+
|
|
30
32
|
latestWorkspace = workspaceName;
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -63,6 +65,16 @@ exports.mochaHooks = {
|
|
|
63
65
|
}
|
|
64
66
|
],
|
|
65
67
|
afterEach: [
|
|
68
|
+
async function (this: Mocha.Context): Promise<void> {
|
|
69
|
+
if (this.currentTest?.state === 'failed') {
|
|
70
|
+
try {
|
|
71
|
+
const screenshot: string = await driverHelper.getDriver().takeScreenshot();
|
|
72
|
+
allure.attachment('Screenshot', Buffer.from(screenshot, 'base64'), 'image/png');
|
|
73
|
+
} catch (e) {
|
|
74
|
+
allure.attachment('No screenshot', 'Could not take a screenshot', 'text/plain');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
66
78
|
// stop and remove running workspace
|
|
67
79
|
function deleteWorkspaceOnFailedTest(this: Mocha.Context): void {
|
|
68
80
|
if (this.currentTest?.state === 'failed') {
|
|
@@ -75,6 +87,7 @@ exports.mochaHooks = {
|
|
|
75
87
|
}
|
|
76
88
|
],
|
|
77
89
|
afterAll: [
|
|
90
|
+
// stop and remove running workspace
|
|
78
91
|
async function stopTheDriver(): Promise<void> {
|
|
79
92
|
if (!BASE_TEST_CONSTANTS.TS_DEBUG_MODE && CHROME_DRIVER_CONSTANTS.TS_USE_WEB_DRIVER_FOR_TEST) {
|
|
80
93
|
// ensure that fired events done
|
|
@@ -16,10 +16,8 @@ import {
|
|
|
16
16
|
ExtensionsViewItem,
|
|
17
17
|
ExtensionsViewSection,
|
|
18
18
|
Locators,
|
|
19
|
-
ModalDialog,
|
|
20
19
|
SideBarView,
|
|
21
20
|
TextEditor,
|
|
22
|
-
ViewItem,
|
|
23
21
|
ViewSection
|
|
24
22
|
} from 'monaco-page-objects';
|
|
25
23
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
@@ -35,36 +33,36 @@ import { expect } from 'chai';
|
|
|
35
33
|
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
36
34
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
37
35
|
import { PLUGIN_TEST_CONSTANTS } from '../../constants/PLUGIN_TEST_CONSTANTS';
|
|
38
|
-
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
39
36
|
|
|
40
37
|
const samples: string[] = PLUGIN_TEST_CONSTANTS.TS_SAMPLE_LIST.split(',');
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
for (const sample of samples) {
|
|
40
|
+
suite(`Check if recommended extensions installed for ${sample}`, function (): void {
|
|
41
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
42
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
43
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
44
|
+
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
45
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
46
|
+
const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader);
|
|
47
|
+
const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators;
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
let projectSection: ViewSection;
|
|
50
|
+
let extensionSection: ExtensionsViewSection;
|
|
51
|
+
let extensionsView: SideBarView | undefined;
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
const [pathToExtensionsListFileName, extensionsListFileName]: string[] = ['.vscode', 'extensions.json'];
|
|
54
|
+
let recommendedExtensions: any = {
|
|
55
|
+
recommendations: []
|
|
56
|
+
};
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
loginTests.loginIntoChe();
|
|
61
59
|
|
|
62
|
-
for (const sample of samples) {
|
|
63
60
|
test(`Create and open new workspace, stack:${sample}`, async function (): Promise<void> {
|
|
64
61
|
await workspaceHandlingTests.createAndOpenWorkspace(sample);
|
|
65
62
|
});
|
|
66
63
|
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
67
64
|
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
65
|
+
expect(WorkspaceHandlingTests.getWorkspaceName(), 'Workspace name was not fetched from the loading page').not.undefined;
|
|
68
66
|
});
|
|
69
67
|
|
|
70
68
|
test('Registering the running workspace', function (): void {
|
|
@@ -75,31 +73,20 @@ suite(`Check if recommended extensions installed for ${samples}`, function (): v
|
|
|
75
73
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
76
74
|
});
|
|
77
75
|
|
|
78
|
-
test('
|
|
79
|
-
[projectSection] = await new SideBarView().getContent().getSections();
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const buttonYesITrustTheAuthors: string = 'Yes, I trust the authors';
|
|
86
|
-
await driverHelper.waitVisibility(
|
|
87
|
-
webCheCodeLocators.WelcomeContent.button,
|
|
88
|
-
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
|
|
89
|
-
);
|
|
90
|
-
const trustedProjectDialog: ModalDialog = new ModalDialog();
|
|
91
|
-
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
92
|
-
await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
|
|
93
|
-
} catch (e) {
|
|
94
|
-
Logger.debug(`Welcome modal dialog was not shown: ${e}`);
|
|
95
|
-
}
|
|
76
|
+
test('Check the project files were imported', async function (): Promise<void> {
|
|
77
|
+
const [projectSection]: ViewSection[] = await new SideBarView().getContent().getSections();
|
|
78
|
+
expect(await projectSection.findItem(pathToExtensionsListFileName), 'Files not imported').not.undefined;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
82
|
+
await projectAndFileTests.performTrustAuthorDialog();
|
|
96
83
|
});
|
|
97
84
|
|
|
98
85
|
test(`Get recommended extensions list from ${extensionsListFileName}`, async function (): Promise<void> {
|
|
99
86
|
Logger.debug('projectSection.findItem(item))?.select(): expand .vscode folder and open extensions.json.');
|
|
100
|
-
await (
|
|
101
|
-
|
|
102
|
-
await driverHelper.
|
|
87
|
+
[projectSection] = await new SideBarView().getContent().getSections();
|
|
88
|
+
await (await projectSection.findItem(pathToExtensionsListFileName))?.select();
|
|
89
|
+
await driverHelper.waitVisibility(webCheCodeLocators.DefaultTreeItem.ctor(extensionsListFileName));
|
|
103
90
|
await (await projectSection.findItem(extensionsListFileName))?.select();
|
|
104
91
|
Logger.debug(`EditorView().openEditor(${extensionsListFileName})`);
|
|
105
92
|
const editor: TextEditor = (await new EditorView().openEditor(extensionsListFileName)) as TextEditor;
|
|
@@ -113,69 +100,77 @@ suite(`Check if recommended extensions installed for ${samples}`, function (): v
|
|
|
113
100
|
return { publisher, name };
|
|
114
101
|
}
|
|
115
102
|
);
|
|
116
|
-
Logger.
|
|
103
|
+
Logger.debug(`Recommended extension for this workspace:\n${JSON.stringify(recommendedExtensions.recommendations)}.`);
|
|
104
|
+
expect(recommendedExtensions.recommendations, 'Recommendations not found').not.empty;
|
|
117
105
|
});
|
|
118
106
|
|
|
119
107
|
test('Open "Extensions" view section', async function (): Promise<void> {
|
|
120
108
|
Logger.debug('ActivityBar().getViewControl("Extensions"))?.openView(): open Extensions view.');
|
|
121
109
|
extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
|
|
110
|
+
expect(extensionsView, 'Can`t find Extension section').not.undefined;
|
|
122
111
|
});
|
|
123
112
|
|
|
124
113
|
test('Let extensions complete installation', async function (): Promise<void> {
|
|
125
|
-
|
|
114
|
+
this.test?.retries(0);
|
|
115
|
+
Logger.debug(
|
|
126
116
|
`Time for extensions installation TimeoutConstants.TS_COMMON_PLUGIN_TEST_TIMEOUT=${TIMEOUT_CONSTANTS.TS_COMMON_PLUGIN_TEST_TIMEOUT}`
|
|
127
117
|
);
|
|
128
118
|
await driverHelper.wait(TIMEOUT_CONSTANTS.TS_COMMON_PLUGIN_TEST_TIMEOUT);
|
|
129
119
|
});
|
|
130
120
|
|
|
131
121
|
test('Check if extensions are installed and enabled', async function (): Promise<void> {
|
|
132
|
-
|
|
122
|
+
// timeout 15 seconds per extensions
|
|
123
|
+
this.timeout(TIMEOUT_CONSTANTS.TS_FIND_EXTENSION_TEST_TIMEOUT * recommendedExtensions.recommendations.length);
|
|
133
124
|
Logger.debug('ActivityBar().getViewControl("Extensions"))?.openView(): open Extensions view.');
|
|
134
125
|
extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
|
|
135
126
|
|
|
136
127
|
Logger.debug('extensionsView?.getContent().getSections(): get current section.');
|
|
137
128
|
[extensionSection] = (await extensionsView?.getContent().getSections()) as ExtensionsViewSection[];
|
|
138
|
-
|
|
129
|
+
expect(extensionSection, 'Can`t find Extension section').not.undefined;
|
|
130
|
+
await driverHelper.waitVisibility(
|
|
139
131
|
webCheCodeLocators.ExtensionsViewSection.itemTitle,
|
|
140
132
|
TIMEOUT_CONSTANTS.TS_EDITOR_TAB_INTERACTION_TIMEOUT
|
|
141
133
|
);
|
|
142
134
|
|
|
143
135
|
for (const extension of recommendedExtensions.recommendations) {
|
|
144
|
-
Logger.info(`Check if ${JSON.stringify(extension)} are installed.`);
|
|
145
|
-
|
|
146
136
|
Logger.debug(`extensionSection.findItem(${extension.name}).`);
|
|
147
137
|
await extensionSection.findItem(extension.name);
|
|
148
138
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
139
|
+
const isReloadRequired: boolean = await driverHelper.isVisible(
|
|
140
|
+
(webCheCodeLocators.ExtensionsViewSection as any).requireReloadButton
|
|
141
|
+
);
|
|
142
|
+
Logger.debug(`Is extensions require reload the editor: ${isReloadRequired}`);
|
|
143
|
+
|
|
144
|
+
if (isReloadRequired) {
|
|
145
|
+
Logger.debug('Refreshing the page..');
|
|
152
146
|
await browserTabsUtil.refreshPage();
|
|
153
147
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
154
|
-
|
|
148
|
+
await driverHelper.waitVisibility(
|
|
149
|
+
webCheCodeLocators.ActivityBar.viewContainer,
|
|
150
|
+
TIMEOUT_CONSTANTS.TS_EDITOR_TAB_INTERACTION_TIMEOUT
|
|
151
|
+
);
|
|
152
|
+
Logger.debug('ActivityBar().getViewControl("Extensions"))?.openView(): reopen Extensions view.');
|
|
155
153
|
extensionsView = await (await new ActivityBar().getViewControl('Extensions'))?.openView();
|
|
156
|
-
|
|
157
|
-
[extensionSection] = (await extensionsView?.getContent().getSections()) as ExtensionsViewSection[];
|
|
158
|
-
await driverHelper.waitAllPresence(
|
|
154
|
+
await driverHelper.waitVisibility(
|
|
159
155
|
webCheCodeLocators.ExtensionsViewSection.itemTitle,
|
|
160
156
|
TIMEOUT_CONSTANTS.TS_EDITOR_TAB_INTERACTION_TIMEOUT
|
|
161
157
|
);
|
|
158
|
+
expect(extensionsView, 'Can`t find Extension View section').not.undefined;
|
|
159
|
+
[extensionSection] = (await extensionsView?.getContent().getSections()) as ExtensionsViewSection[];
|
|
160
|
+
expect(extensionSection, 'Can`t find Extension section').not.undefined;
|
|
162
161
|
Logger.debug(`extensionSection.findItem(${extension.name}).`);
|
|
163
162
|
await extensionSection.findItem(extension.name);
|
|
164
163
|
}
|
|
165
164
|
|
|
166
|
-
Logger.debug('extensionsView
|
|
165
|
+
Logger.debug('extensionsView.getContent().getSections(): switch to marketplace section.');
|
|
167
166
|
const [marketplaceSection]: ExtensionsViewSection[] = (await extensionsView
|
|
168
167
|
?.getContent()
|
|
169
168
|
.getSections()) as ExtensionsViewSection[];
|
|
170
|
-
await driverHelper.waitVisibility(
|
|
171
|
-
webCheCodeLocators.ExtensionsViewSection.items,
|
|
172
|
-
TIMEOUT_CONSTANTS.TS_EDITOR_TAB_INTERACTION_TIMEOUT
|
|
173
|
-
);
|
|
174
169
|
|
|
175
|
-
Logger.debug('marketplaceSection.getVisibleItems()
|
|
170
|
+
Logger.debug('marketplaceSection.getVisibleItems()');
|
|
176
171
|
const allFinedItems: ExtensionsViewItem[] = await marketplaceSection.getVisibleItems();
|
|
177
|
-
|
|
178
|
-
let itemWithRightNameAndPublisher: ExtensionsViewItem | undefined;
|
|
172
|
+
expect(allFinedItems, 'Extensions not found').not.empty;
|
|
173
|
+
let itemWithRightNameAndPublisher: ExtensionsViewItem | undefined = undefined;
|
|
179
174
|
for (const item of allFinedItems) {
|
|
180
175
|
Logger.debug(`Try to find extension published by ${extension.publisher}.`);
|
|
181
176
|
if ((await item.getAuthor()) === extension.publisher) {
|
|
@@ -183,16 +178,14 @@ suite(`Check if recommended extensions installed for ${samples}`, function (): v
|
|
|
183
178
|
Logger.debug(`Extension was found: ${await itemWithRightNameAndPublisher?.getTitle()}`);
|
|
184
179
|
break;
|
|
185
180
|
}
|
|
186
|
-
|
|
187
|
-
Logger.error(`Extension with publisher as ${extension.publisher} was not found.`);
|
|
188
|
-
}
|
|
181
|
+
expect(itemWithRightNameAndPublisher, `Extension ${extension.name} not found`).not.undefined;
|
|
189
182
|
}
|
|
190
183
|
|
|
191
184
|
Logger.debug('itemWithRightNameAndPublisher?.isInstalled()');
|
|
192
185
|
const isInstalled: boolean = (await itemWithRightNameAndPublisher?.isInstalled()) as boolean;
|
|
193
186
|
|
|
194
187
|
Logger.debug(`itemWithRightNameAndPublisher?.isInstalled(): ${isInstalled}.`);
|
|
195
|
-
expect(isInstalled).
|
|
188
|
+
expect(isInstalled, `Extension ${extension.name} not installed`).is.true;
|
|
196
189
|
|
|
197
190
|
Logger.debug('itemWithRightNameAndPublisher.manage(): get context menu.');
|
|
198
191
|
const extensionManageMenu: ContextMenu = await (itemWithRightNameAndPublisher as ExtensionsViewItem).manage();
|
|
@@ -200,13 +193,13 @@ suite(`Check if recommended extensions installed for ${samples}`, function (): v
|
|
|
200
193
|
Logger.debug('extensionManageMenu.getItems(): get menu items.');
|
|
201
194
|
const extensionMenuItems: ContextMenuItem[] = await extensionManageMenu.getItems();
|
|
202
195
|
let extensionMenuItemLabels: string = '';
|
|
196
|
+
Logger.trace('extensionMenuItems -> item.getLabel(): get menu items names.');
|
|
203
197
|
for (const item of extensionMenuItems) {
|
|
204
|
-
Logger.trace('extensionMenuItems -> item.getLabel(): get menu items names.');
|
|
205
198
|
extensionMenuItemLabels += (await item.getLabel()) + ' ';
|
|
206
199
|
}
|
|
207
200
|
|
|
208
201
|
Logger.debug(`extensionMenuItemLabels: ${extensionMenuItemLabels}.`);
|
|
209
|
-
expect(extensionMenuItemLabels).contains('Disable').and.not.contains('Enable');
|
|
202
|
+
expect(extensionMenuItemLabels, `Extension ${extension.name} not enabled`).contains('Disable').and.not.contains('Enable');
|
|
210
203
|
}
|
|
211
204
|
});
|
|
212
205
|
|
|
@@ -218,7 +211,7 @@ suite(`Check if recommended extensions installed for ${samples}`, function (): v
|
|
|
218
211
|
test('Delete the workspace', async function (): Promise<void> {
|
|
219
212
|
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
220
213
|
});
|
|
221
|
-
}
|
|
222
214
|
|
|
223
|
-
|
|
224
|
-
});
|
|
215
|
+
loginTests.logoutFromChe();
|
|
216
|
+
});
|
|
217
|
+
}
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
ContextMenu,
|
|
17
17
|
EditorView,
|
|
18
18
|
Locators,
|
|
19
|
-
ModalDialog,
|
|
20
19
|
NewScmView,
|
|
21
20
|
SideBarView,
|
|
22
21
|
SingleScmProvider,
|
|
@@ -104,11 +103,7 @@ suite(
|
|
|
104
103
|
});
|
|
105
104
|
|
|
106
105
|
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
107
|
-
|
|
108
|
-
const trustedProjectDialog: ModalDialog = new ModalDialog();
|
|
109
|
-
await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.button);
|
|
110
|
-
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
111
|
-
await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
|
|
106
|
+
await projectAndFileTests.performTrustAuthorDialog();
|
|
112
107
|
});
|
|
113
108
|
|
|
114
109
|
test('Make changes to the file', async function (): Promise<void> {
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
ActivityBar,
|
|
15
15
|
ContextMenu,
|
|
16
16
|
EditorView,
|
|
17
|
-
error,
|
|
18
17
|
InputBox,
|
|
19
18
|
Locators,
|
|
20
19
|
ModalDialog,
|
|
@@ -37,13 +36,11 @@ import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
|
37
36
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
38
37
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
39
38
|
import { Workspaces } from '../../pageobjects/dashboard/Workspaces';
|
|
40
|
-
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
41
39
|
import { Logger } from '../../utils/Logger';
|
|
42
40
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
43
41
|
import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
44
42
|
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
45
43
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
46
|
-
import WebDriverError = error.WebDriverError;
|
|
47
44
|
|
|
48
45
|
suite(
|
|
49
46
|
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without OAuth setup`,
|
|
@@ -124,29 +121,7 @@ suite(
|
|
|
124
121
|
});
|
|
125
122
|
|
|
126
123
|
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
127
|
-
|
|
128
|
-
try {
|
|
129
|
-
await driverHelper.waitAndClick(webCheCodeLocators.Workbench.notificationItem);
|
|
130
|
-
} catch (e) {
|
|
131
|
-
Logger.info(`Click on ${webCheCodeLocators.Workbench.notificationItem} to get "Welcome Content" dialog ${e as string}`);
|
|
132
|
-
}
|
|
133
|
-
// "Welcome Content" dialog can be shown before of after dialog with an error for private repo
|
|
134
|
-
try {
|
|
135
|
-
const buttonYesITrustTheAuthors: string = 'Yes, I trust the authors';
|
|
136
|
-
await driverHelper.waitVisibility(
|
|
137
|
-
webCheCodeLocators.WelcomeContent.text,
|
|
138
|
-
TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM
|
|
139
|
-
);
|
|
140
|
-
const welcomeContentDialog: ModalDialog = new ModalDialog();
|
|
141
|
-
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
142
|
-
await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
|
|
143
|
-
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
144
|
-
} catch (e) {
|
|
145
|
-
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
146
|
-
if (!FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
147
|
-
throw new WebDriverError(e as string);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
124
|
+
await projectAndFileTests.performTrustAuthorDialog();
|
|
150
125
|
});
|
|
151
126
|
|
|
152
127
|
test('Check if the project files were imported', async function (): Promise<void> {
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
ActivityBar,
|
|
15
15
|
ContextMenu,
|
|
16
16
|
EditorView,
|
|
17
|
-
error,
|
|
18
17
|
InputBox,
|
|
19
18
|
Locators,
|
|
20
19
|
ModalDialog,
|
|
@@ -37,12 +36,10 @@ import { DriverHelper } from '../../utils/DriverHelper';
|
|
|
37
36
|
import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
|
|
38
37
|
import { StringUtil } from '../../utils/StringUtil';
|
|
39
38
|
import { Logger } from '../../utils/Logger';
|
|
40
|
-
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
41
39
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
42
40
|
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
43
41
|
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
44
42
|
import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
45
|
-
import WebDriverError = error.WebDriverError;
|
|
46
43
|
|
|
47
44
|
suite(
|
|
48
45
|
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access`,
|
|
@@ -107,29 +104,7 @@ suite(
|
|
|
107
104
|
});
|
|
108
105
|
|
|
109
106
|
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
110
|
-
|
|
111
|
-
try {
|
|
112
|
-
await driverHelper.waitAndClick(webCheCodeLocators.Workbench.notificationItem);
|
|
113
|
-
} catch (e) {
|
|
114
|
-
Logger.info(`Click on ${webCheCodeLocators.Workbench.notificationItem} to get "Welcome Content" dialog ${e as string}`);
|
|
115
|
-
}
|
|
116
|
-
// "Welcome Content" dialog can be shown before of after dialog with an error for private repo
|
|
117
|
-
try {
|
|
118
|
-
const buttonYesITrustTheAuthors: string = 'Yes, I trust the authors';
|
|
119
|
-
await driverHelper.waitVisibility(
|
|
120
|
-
webCheCodeLocators.WelcomeContent.text,
|
|
121
|
-
TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM
|
|
122
|
-
);
|
|
123
|
-
const welcomeContentDialog: ModalDialog = new ModalDialog();
|
|
124
|
-
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
125
|
-
await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
|
|
126
|
-
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
127
|
-
} catch (e) {
|
|
128
|
-
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
129
|
-
if (!FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
130
|
-
throw new WebDriverError(e as string);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
107
|
+
await projectAndFileTests.performTrustAuthorDialog();
|
|
133
108
|
});
|
|
134
109
|
|
|
135
110
|
if (FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
@@ -10,30 +10,29 @@
|
|
|
10
10
|
|
|
11
11
|
import 'reflect-metadata';
|
|
12
12
|
import { inject, injectable } from 'inversify';
|
|
13
|
-
import { By, until } from 'selenium-webdriver';
|
|
14
13
|
import { DriverHelper } from '../utils/DriverHelper';
|
|
15
14
|
import { CLASSES } from '../configs/inversify.types';
|
|
16
15
|
import { Logger } from '../utils/Logger';
|
|
17
16
|
import { TIMEOUT_CONSTANTS } from '../constants/TIMEOUT_CONSTANTS';
|
|
18
|
-
import { Locators, ModalDialog } from 'monaco-page-objects';
|
|
19
17
|
import { CheCodeLocatorLoader } from '../pageobjects/ide/CheCodeLocatorLoader';
|
|
20
18
|
|
|
21
|
-
const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
|
|
22
|
-
|
|
23
19
|
@injectable()
|
|
24
20
|
export class ProjectAndFileTests {
|
|
25
21
|
constructor(
|
|
26
22
|
@inject(CLASSES.DriverHelper)
|
|
27
|
-
private readonly driverHelper: DriverHelper
|
|
23
|
+
private readonly driverHelper: DriverHelper,
|
|
24
|
+
@inject(CLASSES.CheCodeLocatorLoader)
|
|
25
|
+
private readonly cheCodeLocatorLoader: CheCodeLocatorLoader
|
|
28
26
|
) {}
|
|
29
27
|
|
|
30
28
|
async waitWorkspaceReadinessForCheCodeEditor(): Promise<void> {
|
|
31
29
|
Logger.debug('waiting for editor.');
|
|
32
30
|
try {
|
|
33
31
|
const start: number = new Date().getTime();
|
|
34
|
-
await this.driverHelper
|
|
35
|
-
.
|
|
36
|
-
|
|
32
|
+
await this.driverHelper.waitVisibility(
|
|
33
|
+
this.cheCodeLocatorLoader.webCheCodeLocators.Workbench.constructor,
|
|
34
|
+
TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT
|
|
35
|
+
);
|
|
37
36
|
const end: number = new Date().getTime();
|
|
38
37
|
Logger.debug(`editor was opened in ${end - start} seconds.`);
|
|
39
38
|
} catch (err) {
|
|
@@ -43,17 +42,20 @@ export class ProjectAndFileTests {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
async performTrustAuthorDialog(): Promise<void> {
|
|
45
|
+
Logger.debug();
|
|
46
|
+
|
|
47
|
+
await this.driverHelper.waitAndClick(
|
|
48
|
+
this.cheCodeLocatorLoader.webCheCodeLocators.WelcomeContent.button,
|
|
49
|
+
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
|
|
50
|
+
);
|
|
51
|
+
|
|
46
52
|
try {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
webCheCodeLocators.WelcomeContent.button,
|
|
53
|
+
await this.driverHelper.waitAndClick(
|
|
54
|
+
this.cheCodeLocatorLoader.webCheCodeLocators.WelcomeContent.button,
|
|
50
55
|
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
|
|
51
56
|
);
|
|
52
|
-
const trustedProjectDialog: ModalDialog = new ModalDialog();
|
|
53
|
-
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
54
|
-
await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
|
|
55
57
|
} catch (e) {
|
|
56
|
-
Logger.
|
|
58
|
+
Logger.info('Second welcome content dialog box was not shown');
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -81,7 +81,7 @@ export class WorkspaceHandlingTests {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
async obtainWorkspaceNameFromStartingPage(): Promise<void> {
|
|
84
|
-
const timeout: number = TIMEOUT_CONSTANTS.
|
|
84
|
+
const timeout: number = TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT;
|
|
85
85
|
const polling: number = TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING;
|
|
86
86
|
const attempts: number = Math.ceil(timeout / polling);
|
|
87
87
|
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"skipLibCheck": true,
|
|
4
|
-
"target": "
|
|
4
|
+
"target": "es2021",
|
|
5
5
|
"module": "commonjs",
|
|
6
6
|
"strict": true,
|
|
7
7
|
"esModuleInterop": true,
|
|
8
8
|
"outDir": "dist",
|
|
9
|
-
"lib": ["
|
|
9
|
+
"lib": ["es2021", "dom"],
|
|
10
10
|
"types": ["reflect-metadata", "@types/mocha", "@types/node"],
|
|
11
11
|
"experimentalDecorators": true,
|
|
12
12
|
"emitDecoratorMetadata": true,
|
package/utils/DriverHelper.ts
CHANGED
|
@@ -398,7 +398,7 @@ export class DriverHelper {
|
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
throw new error.TimeoutError(
|
|
401
|
-
`Exceeded maximum
|
|
401
|
+
`Exceeded maximum getting of the '${cssAttribute}' css attribute attempts, from the '${elementLocator}' element`
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
404
|
|