@theia/playwright 1.67.0-next.56 → 1.67.0-next.59
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/lib/index.d.ts +37 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +55 -0
- package/lib/index.js.map +1 -0
- package/lib/tests/theia-app.test.d.ts +2 -0
- package/lib/tests/theia-app.test.d.ts.map +1 -0
- package/lib/tests/theia-app.test.js +30 -0
- package/lib/tests/theia-app.test.js.map +1 -0
- package/lib/tests/theia-application-shell.test.d.ts +2 -0
- package/lib/tests/theia-application-shell.test.d.ts.map +1 -0
- package/lib/tests/theia-application-shell.test.js +59 -0
- package/lib/tests/theia-application-shell.test.js.map +1 -0
- package/lib/tests/theia-explorer-view.test.d.ts +2 -0
- package/lib/tests/theia-explorer-view.test.d.ts.map +1 -0
- package/lib/tests/theia-explorer-view.test.js +186 -0
- package/lib/tests/theia-explorer-view.test.js.map +1 -0
- package/lib/tests/theia-getting-started.test.d.ts +2 -0
- package/lib/tests/theia-getting-started.test.d.ts.map +1 -0
- package/lib/tests/theia-getting-started.test.js +46 -0
- package/lib/tests/theia-getting-started.test.js.map +1 -0
- package/lib/tests/theia-main-menu.test.d.ts +2 -0
- package/lib/tests/theia-main-menu.test.d.ts.map +1 -0
- package/lib/tests/theia-main-menu.test.js +111 -0
- package/lib/tests/theia-main-menu.test.js.map +1 -0
- package/lib/tests/theia-notebook-editor.test.d.ts +2 -0
- package/lib/tests/theia-notebook-editor.test.d.ts.map +1 -0
- package/lib/tests/theia-notebook-editor.test.js +301 -0
- package/lib/tests/theia-notebook-editor.test.js.map +1 -0
- package/lib/tests/theia-output-view.test.d.ts +2 -0
- package/lib/tests/theia-output-view.test.d.ts.map +1 -0
- package/lib/tests/theia-output-view.test.js +79 -0
- package/lib/tests/theia-output-view.test.js.map +1 -0
- package/lib/tests/theia-preference-view.test.d.ts +2 -0
- package/lib/tests/theia-preference-view.test.d.ts.map +1 -0
- package/lib/tests/theia-preference-view.test.js +102 -0
- package/lib/tests/theia-preference-view.test.js.map +1 -0
- package/lib/tests/theia-problems-view.test.d.ts +2 -0
- package/lib/tests/theia-problems-view.test.d.ts.map +1 -0
- package/lib/tests/theia-problems-view.test.js +55 -0
- package/lib/tests/theia-problems-view.test.js.map +1 -0
- package/lib/tests/theia-quick-command.test.d.ts +2 -0
- package/lib/tests/theia-quick-command.test.d.ts.map +1 -0
- package/lib/tests/theia-quick-command.test.js +75 -0
- package/lib/tests/theia-quick-command.test.js.map +1 -0
- package/lib/tests/theia-sample-app.test.d.ts +2 -0
- package/lib/tests/theia-sample-app.test.d.ts.map +1 -0
- package/lib/tests/theia-sample-app.test.js +58 -0
- package/lib/tests/theia-sample-app.test.js.map +1 -0
- package/lib/tests/theia-status-bar.test.d.ts +2 -0
- package/lib/tests/theia-status-bar.test.d.ts.map +1 -0
- package/lib/tests/theia-status-bar.test.js +45 -0
- package/lib/tests/theia-status-bar.test.js.map +1 -0
- package/lib/tests/theia-terminal-view.test.d.ts +2 -0
- package/lib/tests/theia-terminal-view.test.d.ts.map +1 -0
- package/lib/tests/theia-terminal-view.test.js +80 -0
- package/lib/tests/theia-terminal-view.test.js.map +1 -0
- package/lib/tests/theia-text-editor.test.d.ts +2 -0
- package/lib/tests/theia-text-editor.test.d.ts.map +1 -0
- package/lib/tests/theia-text-editor.test.js +159 -0
- package/lib/tests/theia-text-editor.test.js.map +1 -0
- package/lib/tests/theia-toolbar.test.d.ts +2 -0
- package/lib/tests/theia-toolbar.test.d.ts.map +1 -0
- package/lib/tests/theia-toolbar.test.js +62 -0
- package/lib/tests/theia-toolbar.test.js.map +1 -0
- package/lib/tests/theia-workspace.test.d.ts +2 -0
- package/lib/tests/theia-workspace.test.d.ts.map +1 -0
- package/lib/tests/theia-workspace.test.js +77 -0
- package/lib/tests/theia-workspace.test.js.map +1 -0
- package/lib/theia-about-dialog.d.ts +5 -0
- package/lib/theia-about-dialog.d.ts.map +1 -0
- package/lib/theia-about-dialog.js +27 -0
- package/lib/theia-about-dialog.js.map +1 -0
- package/lib/theia-app-loader.d.ts +20 -0
- package/lib/theia-app-loader.d.ts.map +1 -0
- package/lib/theia-app-loader.js +124 -0
- package/lib/theia-app-loader.js.map +1 -0
- package/lib/theia-app.d.ts +51 -0
- package/lib/theia-app.d.ts.map +1 -0
- package/lib/theia-app.js +154 -0
- package/lib/theia-app.js.map +1 -0
- package/lib/theia-context-menu.d.ts +9 -0
- package/lib/theia-context-menu.d.ts.map +1 -0
- package/lib/theia-context-menu.js +38 -0
- package/lib/theia-context-menu.js.map +1 -0
- package/lib/theia-dialog.d.ts +29 -0
- package/lib/theia-dialog.d.ts.map +1 -0
- package/lib/theia-dialog.js +100 -0
- package/lib/theia-dialog.js.map +1 -0
- package/lib/theia-editor.d.ts +10 -0
- package/lib/theia-editor.d.ts.map +1 -0
- package/lib/theia-editor.js +69 -0
- package/lib/theia-editor.js.map +1 -0
- package/lib/theia-explorer-view.d.ts +48 -0
- package/lib/theia-explorer-view.d.ts.map +1 -0
- package/lib/theia-explorer-view.js +274 -0
- package/lib/theia-explorer-view.js.map +1 -0
- package/lib/theia-main-menu.d.ts +17 -0
- package/lib/theia-main-menu.d.ts.map +1 -0
- package/lib/theia-main-menu.js +73 -0
- package/lib/theia-main-menu.js.map +1 -0
- package/lib/theia-menu-item.d.ts +15 -0
- package/lib/theia-menu-item.d.ts.map +1 -0
- package/lib/theia-menu-item.js +67 -0
- package/lib/theia-menu-item.js.map +1 -0
- package/lib/theia-menu.d.ts +17 -0
- package/lib/theia-menu.d.ts.map +1 -0
- package/lib/theia-menu.js +106 -0
- package/lib/theia-menu.js.map +1 -0
- package/lib/theia-monaco-editor.d.ts +63 -0
- package/lib/theia-monaco-editor.d.ts.map +1 -0
- package/lib/theia-monaco-editor.js +155 -0
- package/lib/theia-monaco-editor.js.map +1 -0
- package/lib/theia-notebook-cell.d.ts +104 -0
- package/lib/theia-notebook-cell.d.ts.map +1 -0
- package/lib/theia-notebook-cell.js +228 -0
- package/lib/theia-notebook-cell.js.map +1 -0
- package/lib/theia-notebook-editor.d.ts +50 -0
- package/lib/theia-notebook-editor.d.ts.map +1 -0
- package/lib/theia-notebook-editor.js +153 -0
- package/lib/theia-notebook-editor.js.map +1 -0
- package/lib/theia-notebook-toolbar.d.ts +13 -0
- package/lib/theia-notebook-toolbar.d.ts.map +1 -0
- package/lib/theia-notebook-toolbar.js +47 -0
- package/lib/theia-notebook-toolbar.js.map +1 -0
- package/lib/theia-notification-indicator.d.ts +8 -0
- package/lib/theia-notification-indicator.d.ts.map +1 -0
- package/lib/theia-notification-indicator.js +45 -0
- package/lib/theia-notification-indicator.js.map +1 -0
- package/lib/theia-notification-overlay.d.ts +23 -0
- package/lib/theia-notification-overlay.d.ts.map +1 -0
- package/lib/theia-notification-overlay.js +80 -0
- package/lib/theia-notification-overlay.js.map +1 -0
- package/lib/theia-output-channel.d.ts +25 -0
- package/lib/theia-output-channel.d.ts.map +1 -0
- package/lib/theia-output-channel.js +72 -0
- package/lib/theia-output-channel.js.map +1 -0
- package/lib/theia-output-view.d.ts +10 -0
- package/lib/theia-output-view.d.ts.map +1 -0
- package/lib/theia-output-view.js +82 -0
- package/lib/theia-output-view.js.map +1 -0
- package/lib/theia-page-object.d.ts +8 -0
- package/lib/theia-page-object.d.ts.map +1 -0
- package/lib/theia-page-object.js +28 -0
- package/lib/theia-page-object.js.map +1 -0
- package/lib/theia-preference-view.d.ts +91 -0
- package/lib/theia-preference-view.d.ts.map +1 -0
- package/lib/theia-preference-view.js +224 -0
- package/lib/theia-preference-view.js.map +1 -0
- package/lib/theia-problem-indicator.d.ts +9 -0
- package/lib/theia-problem-indicator.d.ts.map +1 -0
- package/lib/theia-problem-indicator.js +39 -0
- package/lib/theia-problem-indicator.js.map +1 -0
- package/lib/theia-problem-view.d.ts +6 -0
- package/lib/theia-problem-view.d.ts.map +1 -0
- package/lib/theia-problem-view.js +31 -0
- package/lib/theia-problem-view.js.map +1 -0
- package/lib/theia-quick-command-palette.d.ts +14 -0
- package/lib/theia-quick-command-palette.d.ts.map +1 -0
- package/lib/theia-quick-command-palette.js +87 -0
- package/lib/theia-quick-command-palette.js.map +1 -0
- package/lib/theia-rename-dialog.d.ts +6 -0
- package/lib/theia-rename-dialog.d.ts.map +1 -0
- package/lib/theia-rename-dialog.js +35 -0
- package/lib/theia-rename-dialog.js.map +1 -0
- package/lib/theia-status-bar.d.ts +14 -0
- package/lib/theia-status-bar.d.ts.map +1 -0
- package/lib/theia-status-bar.js +40 -0
- package/lib/theia-status-bar.js.map +1 -0
- package/lib/theia-status-indicator.d.ts +11 -0
- package/lib/theia-status-indicator.d.ts.map +1 -0
- package/lib/theia-status-indicator.js +49 -0
- package/lib/theia-status-indicator.js.map +1 -0
- package/lib/theia-terminal.d.ts +14 -0
- package/lib/theia-terminal.d.ts.map +1 -0
- package/lib/theia-terminal.js +60 -0
- package/lib/theia-terminal.js.map +1 -0
- package/lib/theia-text-editor.d.ts +27 -0
- package/lib/theia-text-editor.d.ts.map +1 -0
- package/lib/theia-text-editor.js +124 -0
- package/lib/theia-text-editor.js.map +1 -0
- package/lib/theia-toggle-bottom-indicator.d.ts +5 -0
- package/lib/theia-toggle-bottom-indicator.d.ts.map +1 -0
- package/lib/theia-toggle-bottom-indicator.js +27 -0
- package/lib/theia-toggle-bottom-indicator.js.map +1 -0
- package/lib/theia-toolbar-item.d.ts +11 -0
- package/lib/theia-toolbar-item.d.ts.map +1 -0
- package/lib/theia-toolbar-item.js +41 -0
- package/lib/theia-toolbar-item.js.map +1 -0
- package/lib/theia-toolbar.d.ts +20 -0
- package/lib/theia-toolbar.d.ts.map +1 -0
- package/lib/theia-toolbar.js +91 -0
- package/lib/theia-toolbar.js.map +1 -0
- package/lib/theia-tree-node.d.ts +20 -0
- package/lib/theia-tree-node.d.ts.map +1 -0
- package/lib/theia-tree-node.js +73 -0
- package/lib/theia-tree-node.js.map +1 -0
- package/lib/theia-view.d.ts +33 -0
- package/lib/theia-view.d.ts.map +1 -0
- package/lib/theia-view.js +150 -0
- package/lib/theia-view.js.map +1 -0
- package/lib/theia-welcome-view.d.ts +6 -0
- package/lib/theia-welcome-view.d.ts.map +1 -0
- package/lib/theia-welcome-view.js +31 -0
- package/lib/theia-welcome-view.js.map +1 -0
- package/lib/theia-workspace.d.ts +27 -0
- package/lib/theia-workspace.d.ts.map +1 -0
- package/lib/theia-workspace.js +84 -0
- package/lib/theia-workspace.js.map +1 -0
- package/lib/util.d.ts +18 -0
- package/lib/util.d.ts.map +1 -0
- package/lib/util.js +86 -0
- package/lib/util.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 logi.cals GmbH, EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const test_1 = require("@playwright/test");
|
|
19
|
+
const theia_app_loader_1 = require("../theia-app-loader");
|
|
20
|
+
const theia_problem_view_1 = require("../theia-problem-view");
|
|
21
|
+
test_1.test.describe('Theia Problems View', () => {
|
|
22
|
+
let app;
|
|
23
|
+
test_1.test.beforeAll(async ({ playwright, browser }) => {
|
|
24
|
+
app = await theia_app_loader_1.TheiaAppLoader.load({ playwright, browser });
|
|
25
|
+
});
|
|
26
|
+
test_1.test.afterAll(async () => {
|
|
27
|
+
await app.page.close();
|
|
28
|
+
});
|
|
29
|
+
(0, test_1.test)('should be visible and active after being opened', async () => {
|
|
30
|
+
const problemsView = await app.openView(theia_problem_view_1.TheiaProblemsView);
|
|
31
|
+
(0, test_1.expect)(await problemsView.isTabVisible()).toBe(true);
|
|
32
|
+
(0, test_1.expect)(await problemsView.isDisplayed()).toBe(true);
|
|
33
|
+
(0, test_1.expect)(await problemsView.isActive()).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
(0, test_1.test)("should be opened at the bottom and have the title 'Problems'", async () => {
|
|
36
|
+
const problemsView = await app.openView(theia_problem_view_1.TheiaProblemsView);
|
|
37
|
+
(0, test_1.expect)(await problemsView.isInSidePanel()).toBe(false);
|
|
38
|
+
(0, test_1.expect)(await problemsView.side()).toBe('bottom');
|
|
39
|
+
(0, test_1.expect)(await problemsView.title()).toBe('Problems');
|
|
40
|
+
});
|
|
41
|
+
(0, test_1.test)('should be closable', async () => {
|
|
42
|
+
const problemsView = await app.openView(theia_problem_view_1.TheiaProblemsView);
|
|
43
|
+
(0, test_1.expect)(await problemsView.isClosable()).toBe(true);
|
|
44
|
+
await problemsView.close();
|
|
45
|
+
(0, test_1.expect)(await problemsView.isTabVisible()).toBe(false);
|
|
46
|
+
(0, test_1.expect)(await problemsView.isDisplayed()).toBe(false);
|
|
47
|
+
(0, test_1.expect)(await problemsView.isActive()).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
(0, test_1.test)("should not throw an error if 'close' is called twice", async () => {
|
|
50
|
+
const problemsView = await app.openView(theia_problem_view_1.TheiaProblemsView);
|
|
51
|
+
await problemsView.close();
|
|
52
|
+
await problemsView.close();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=theia-problems-view.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-problems-view.test.js","sourceRo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CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-quick-command.test.d.ts","sourceRoot":"","sources":["../../src/tests/theia-quick-command.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 logi.cals GmbH, EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const test_1 = require("@playwright/test");
|
|
19
|
+
const theia_app_loader_1 = require("../theia-app-loader");
|
|
20
|
+
const theia_about_dialog_1 = require("../theia-about-dialog");
|
|
21
|
+
const theia_explorer_view_1 = require("../theia-explorer-view");
|
|
22
|
+
const theia_notification_indicator_1 = require("../theia-notification-indicator");
|
|
23
|
+
const theia_notification_overlay_1 = require("../theia-notification-overlay");
|
|
24
|
+
test_1.test.describe('Theia Quick Command', () => {
|
|
25
|
+
let app;
|
|
26
|
+
let quickCommand;
|
|
27
|
+
test_1.test.beforeAll(async ({ playwright, browser }) => {
|
|
28
|
+
app = await theia_app_loader_1.TheiaAppLoader.load({ playwright, browser });
|
|
29
|
+
quickCommand = app.quickCommandPalette;
|
|
30
|
+
});
|
|
31
|
+
test_1.test.afterAll(async () => {
|
|
32
|
+
await app.page.close();
|
|
33
|
+
});
|
|
34
|
+
(0, test_1.test)('should show quick command palette', async () => {
|
|
35
|
+
await quickCommand.open();
|
|
36
|
+
(0, test_1.expect)(await quickCommand.isOpen()).toBe(true);
|
|
37
|
+
await quickCommand.hide();
|
|
38
|
+
(0, test_1.expect)(await quickCommand.isOpen()).toBe(false);
|
|
39
|
+
await quickCommand.open();
|
|
40
|
+
(0, test_1.expect)(await quickCommand.isOpen()).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
(0, test_1.test)('should trigger \'About\' command after typing', async () => {
|
|
43
|
+
await quickCommand.type('About');
|
|
44
|
+
await quickCommand.trigger('About Theia');
|
|
45
|
+
(0, test_1.expect)(await quickCommand.isOpen()).toBe(false);
|
|
46
|
+
const aboutDialog = new theia_about_dialog_1.TheiaAboutDialog(app);
|
|
47
|
+
(0, test_1.expect)(await aboutDialog.isVisible()).toBe(true);
|
|
48
|
+
await aboutDialog.close();
|
|
49
|
+
(0, test_1.expect)(await aboutDialog.isVisible()).toBe(false);
|
|
50
|
+
await quickCommand.type('Select All');
|
|
51
|
+
await quickCommand.trigger('Select All');
|
|
52
|
+
(0, test_1.expect)(await quickCommand.isOpen()).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
(0, test_1.test)('should trigger \'Toggle Explorer View\' command after typing', async () => {
|
|
55
|
+
await quickCommand.type('Toggle Exp');
|
|
56
|
+
await quickCommand.trigger('View: Toggle Explorer');
|
|
57
|
+
(0, test_1.expect)(await quickCommand.isOpen()).toBe(false);
|
|
58
|
+
const explorerView = new theia_explorer_view_1.TheiaExplorerView(app);
|
|
59
|
+
(0, test_1.expect)(await explorerView.isDisplayed()).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
(0, test_1.test)('should trigger \'Quick Input: Test Positive Integer\' command by confirming via Enter', async () => {
|
|
62
|
+
await quickCommand.type('Test Positive', true);
|
|
63
|
+
(0, test_1.expect)(await quickCommand.isOpen()).toBe(true);
|
|
64
|
+
await quickCommand.type('6', true);
|
|
65
|
+
const notificationIndicator = new theia_notification_indicator_1.TheiaNotificationIndicator(app);
|
|
66
|
+
const notification = new theia_notification_overlay_1.TheiaNotificationOverlay(app, notificationIndicator);
|
|
67
|
+
(0, test_1.expect)(await notification.isEntryVisible('Positive Integer: 6')).toBe(true);
|
|
68
|
+
});
|
|
69
|
+
(0, test_1.test)('retrieve and check visible items', async () => {
|
|
70
|
+
await quickCommand.type('close all tabs', false);
|
|
71
|
+
const listItems = await Promise.all((await quickCommand.visibleItems()).map(async (item) => item.textContent()));
|
|
72
|
+
(0, test_1.expect)(listItems).toContain('View: Close All Tabs in Main Area');
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=theia-quick-command.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-quick-command.test.js","sourceRoot":"","sources":["../../src/tests/theia-quick-command.test.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,2CAAgD;AAChD,0DAAqD;AACrD,8DAAyD;AAEzD,gEAA2D;AAC3D,kFAA6E;AAC7E,8EAAyE;AAGzE,WAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IAEtC,IAAI,GAAa,CAAC;IAClB,IAAI,YAAsC,CAAC;IAE3C,WAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;QAC7C,GAAG,GAAG,MAAM,iCAAc,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;QACzD,YAAY,GAAG,GAAG,CAAC,mBAAmB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C;IAEH,IAAA,WAAI,EAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,YAAY,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QACjD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAC,IAAI,EAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAC/G,IAAA,aAAM,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-sample-app.test.d.ts","sourceRoot":"","sources":["../../src/tests/theia-sample-app.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const test_1 = require("@playwright/test");
|
|
19
|
+
const theia_app_1 = require("../theia-app");
|
|
20
|
+
const theia_app_loader_1 = require("../theia-app-loader");
|
|
21
|
+
const theia_toolbar_1 = require("../theia-toolbar");
|
|
22
|
+
const theia_workspace_1 = require("../theia-workspace");
|
|
23
|
+
class TheiaSampleApp extends theia_app_1.TheiaApp {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.toolbar = new theia_toolbar_1.TheiaToolbar(this);
|
|
27
|
+
}
|
|
28
|
+
async waitForInitialized() {
|
|
29
|
+
await this.toolbar.show();
|
|
30
|
+
}
|
|
31
|
+
async toggleToolbar() {
|
|
32
|
+
await this.toolbar.toggle();
|
|
33
|
+
}
|
|
34
|
+
async isToolbarVisible() {
|
|
35
|
+
return this.toolbar.isShown();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
test_1.test.describe('Theia Sample Application', () => {
|
|
39
|
+
let app;
|
|
40
|
+
test_1.test.beforeAll(async ({ playwright, browser }) => {
|
|
41
|
+
app = await theia_app_loader_1.TheiaAppLoader.load({ playwright, browser }, new theia_workspace_1.TheiaWorkspace(), TheiaSampleApp);
|
|
42
|
+
});
|
|
43
|
+
test_1.test.afterAll(async () => {
|
|
44
|
+
await app.page.close();
|
|
45
|
+
});
|
|
46
|
+
(0, test_1.test)('should start with visible toolbar', async () => {
|
|
47
|
+
(0, test_1.expect)(await app.isToolbarVisible()).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
(0, test_1.test)('should toggle toolbar', async () => {
|
|
50
|
+
await app.toggleToolbar();
|
|
51
|
+
(0, test_1.expect)(await app.isToolbarVisible()).toBe(false);
|
|
52
|
+
await app.toggleToolbar();
|
|
53
|
+
(0, test_1.expect)(await app.isToolbarVisible()).toBe(true);
|
|
54
|
+
await app.toggleToolbar();
|
|
55
|
+
(0, test_1.expect)(await app.isToolbarVisible()).toBe(false);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=theia-sample-app.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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C,mCAAmC,EAAE,KAAK,IAAI,EAAE;QACjD,IAAA,aAAM,EAAC,MAAM,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,IAAA,WAAI,EAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAC1B,IAAA,aAAM,EAAC,MAAM,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEjD,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAC1B,IAAA,aAAM,EAAC,MAAM,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhD,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAC1B,IAAA,aAAM,EAAC,MAAM,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-status-bar.test.d.ts","sourceRoot":"","sources":["../../src/tests/theia-status-bar.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 logi.cals GmbH, EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const test_1 = require("@playwright/test");
|
|
19
|
+
const theia_app_loader_1 = require("../theia-app-loader");
|
|
20
|
+
const theia_notification_indicator_1 = require("../theia-notification-indicator");
|
|
21
|
+
const theia_problem_indicator_1 = require("../theia-problem-indicator");
|
|
22
|
+
const theia_toggle_bottom_indicator_1 = require("../theia-toggle-bottom-indicator");
|
|
23
|
+
test_1.test.describe('Theia Status Bar', () => {
|
|
24
|
+
let app;
|
|
25
|
+
let statusBar;
|
|
26
|
+
test_1.test.beforeAll(async ({ playwright, browser }) => {
|
|
27
|
+
app = await theia_app_loader_1.TheiaAppLoader.load({ playwright, browser });
|
|
28
|
+
statusBar = app.statusBar;
|
|
29
|
+
});
|
|
30
|
+
test_1.test.afterAll(async () => {
|
|
31
|
+
await app.page.close();
|
|
32
|
+
});
|
|
33
|
+
(0, test_1.test)('should show status bar', async () => {
|
|
34
|
+
(0, test_1.expect)(await statusBar.isVisible()).toBe(true);
|
|
35
|
+
});
|
|
36
|
+
(0, test_1.test)('should contain status bar elements', async () => {
|
|
37
|
+
const problemIndicator = await statusBar.statusIndicator(theia_problem_indicator_1.TheiaProblemIndicator);
|
|
38
|
+
const notificationIndicator = await statusBar.statusIndicator(theia_notification_indicator_1.TheiaNotificationIndicator);
|
|
39
|
+
const toggleBottomIndicator = await statusBar.statusIndicator(theia_toggle_bottom_indicator_1.TheiaToggleBottomIndicator);
|
|
40
|
+
(0, test_1.expect)(await problemIndicator.isVisible()).toBe(true);
|
|
41
|
+
(0, test_1.expect)(await notificationIndicator.isVisible()).toBe(true);
|
|
42
|
+
(0, test_1.expect)(await toggleBottomIndicator.isVisible()).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=theia-status-bar.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-status-bar.test.js","sourceRoot":"","sources":["../../src/tests/theia-status-bar.test.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,2CAAgD;AAEhD,0DAAqD;AACrD,kFAA6E;AAC7E,wEAAmE;AAEnE,oFAA8E;AAE9E,WAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAEnC,IAAI,GAAa,CAAC;IAClB,IAAI,SAAyB,CAAC;IAE9B,WAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;QAC7C,GAAG,GAAG,MAAM,iCAAc,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;QACzD,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,WAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;QACrB,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,IAAA,WAAI,EAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,IAAA,aAAM,EAAC,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,IAAA,WAAI,EAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,gBAAgB,GAAG,MAAM,SAAS,CAAC,eAAe,CAAC,+CAAqB,CAAC,CAAC;QAChF,MAAM,qBAAqB,GAAG,MAAM,SAAS,CAAC,eAAe,CAAC,yDAA0B,CAAC,CAAC;QAC1F,MAAM,qBAAqB,GAAG,MAAM,SAAS,CAAC,eAAe,CAAC,0DAA0B,CAAC,CAAC;QAC1F,IAAA,aAAM,EAAC,MAAM,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,IAAA,aAAM,EAAC,MAAM,qBAAqB,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAA,aAAM,EAAC,MAAM,qBAAqB,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-terminal-view.test.d.ts","sourceRoot":"","sources":["../../src/tests/theia-terminal-view.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const test_1 = require("@playwright/test");
|
|
19
|
+
const path = require("path");
|
|
20
|
+
const theia_app_loader_1 = require("../theia-app-loader");
|
|
21
|
+
const theia_workspace_1 = require("../theia-workspace");
|
|
22
|
+
const theia_terminal_1 = require("../theia-terminal");
|
|
23
|
+
let app;
|
|
24
|
+
test_1.test.describe('Theia Terminal View', () => {
|
|
25
|
+
test_1.test.beforeAll(async ({ playwright, browser }) => {
|
|
26
|
+
const ws = new theia_workspace_1.TheiaWorkspace([path.resolve(__dirname, '../../src/tests/resources/sample-files1')]);
|
|
27
|
+
app = await theia_app_loader_1.TheiaAppLoader.load({ playwright, browser }, ws);
|
|
28
|
+
});
|
|
29
|
+
test_1.test.afterAll(async () => {
|
|
30
|
+
await app.page.close();
|
|
31
|
+
});
|
|
32
|
+
(0, test_1.test)('should be possible to open a new terminal', async () => {
|
|
33
|
+
const terminal = await app.openTerminal(theia_terminal_1.TheiaTerminal);
|
|
34
|
+
(0, test_1.expect)(await terminal.isTabVisible()).toBe(true);
|
|
35
|
+
(0, test_1.expect)(await terminal.isDisplayed()).toBe(true);
|
|
36
|
+
(0, test_1.expect)(await terminal.isActive()).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
(0, test_1.test)('should be possible to open two terminals, switch among them, and close them', async () => {
|
|
39
|
+
const terminal1 = await app.openTerminal(theia_terminal_1.TheiaTerminal);
|
|
40
|
+
const terminal2 = await app.openTerminal(theia_terminal_1.TheiaTerminal);
|
|
41
|
+
const allTerminals = [terminal1, terminal2];
|
|
42
|
+
// all terminal tabs should be visible
|
|
43
|
+
for (const terminal of allTerminals) {
|
|
44
|
+
(0, test_1.expect)(await terminal.isTabVisible()).toBe(true);
|
|
45
|
+
}
|
|
46
|
+
// activate one terminal after the other and check that only this terminal is active
|
|
47
|
+
for (const terminal of allTerminals) {
|
|
48
|
+
await terminal.activate();
|
|
49
|
+
(0, test_1.expect)(await terminal1.isActive()).toBe(terminal1 === terminal);
|
|
50
|
+
(0, test_1.expect)(await terminal2.isActive()).toBe(terminal2 === terminal);
|
|
51
|
+
}
|
|
52
|
+
// close all terminals
|
|
53
|
+
for (const terminal of allTerminals) {
|
|
54
|
+
await terminal.activate();
|
|
55
|
+
await terminal.close();
|
|
56
|
+
}
|
|
57
|
+
// check that all terminals are closed
|
|
58
|
+
for (const terminal of allTerminals) {
|
|
59
|
+
(0, test_1.expect)(await terminal.isTabVisible()).toBe(false);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
(0, test_1.test)('should allow to write and read terminal contents', async () => {
|
|
63
|
+
const terminal = await app.openTerminal(theia_terminal_1.TheiaTerminal);
|
|
64
|
+
await terminal.write('hello');
|
|
65
|
+
const contents = await terminal.contents();
|
|
66
|
+
(0, test_1.expect)(contents).toContain('hello');
|
|
67
|
+
});
|
|
68
|
+
(0, test_1.test)('should allow to submit a command and read output', async () => {
|
|
69
|
+
const terminal = await app.openTerminal(theia_terminal_1.TheiaTerminal);
|
|
70
|
+
if (process.platform === 'win32') {
|
|
71
|
+
await terminal.submit('dir');
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
await terminal.submit('ls');
|
|
75
|
+
}
|
|
76
|
+
const contents = await terminal.contents();
|
|
77
|
+
(0, test_1.expect)(contents).toContain('sample.txt');
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=theia-terminal-view.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-terminal-view.test.js","sourceRoot":"","sources":["../../src/tests/theia-terminal-view.test.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,2CAAgD;AAChD,6BAA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CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,IAAA,WAAI,EAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,8BAAa,CAAC,CAAC;QACvD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC/B,MAAM,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACJ,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC3C,IAAA,aAAM,EAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-text-editor.test.d.ts","sourceRoot":"","sources":["../../src/tests/theia-text-editor.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 logi.cals GmbH, EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const test_1 = require("@playwright/test");
|
|
19
|
+
const path = require("path");
|
|
20
|
+
const theia_app_loader_1 = require("../theia-app-loader");
|
|
21
|
+
const theia_preference_view_1 = require("../theia-preference-view");
|
|
22
|
+
const theia_text_editor_1 = require("../theia-text-editor");
|
|
23
|
+
const theia_workspace_1 = require("../theia-workspace");
|
|
24
|
+
test_1.test.describe('Theia Text Editor', () => {
|
|
25
|
+
let app;
|
|
26
|
+
test_1.test.beforeAll(async ({ playwright, browser }) => {
|
|
27
|
+
const ws = new theia_workspace_1.TheiaWorkspace([path.resolve(__dirname, '../../src/tests/resources/sample-files1')]);
|
|
28
|
+
app = await theia_app_loader_1.TheiaAppLoader.load({ playwright, browser }, ws);
|
|
29
|
+
// set auto-save preference to off
|
|
30
|
+
const preferenceView = await app.openPreferences(theia_preference_view_1.TheiaPreferenceView);
|
|
31
|
+
await preferenceView.setOptionsPreferenceById(theia_preference_view_1.PreferenceIds.Editor.AutoSave, theia_preference_view_1.DefaultPreferences.Editor.AutoSave.Off);
|
|
32
|
+
await preferenceView.close();
|
|
33
|
+
});
|
|
34
|
+
test_1.test.afterAll(async () => {
|
|
35
|
+
await app.page.close();
|
|
36
|
+
});
|
|
37
|
+
(0, test_1.test)('should be visible and active after opening "sample.txt"', async () => {
|
|
38
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
39
|
+
(0, test_1.expect)(await sampleTextEditor.isTabVisible()).toBe(true);
|
|
40
|
+
(0, test_1.expect)(await sampleTextEditor.isDisplayed()).toBe(true);
|
|
41
|
+
(0, test_1.expect)(await sampleTextEditor.isActive()).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
(0, test_1.test)('should be possible to open "sample.txt" when already opened and then close it', async () => {
|
|
44
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
45
|
+
(0, test_1.expect)(await sampleTextEditor.isTabVisible()).toBe(true);
|
|
46
|
+
await sampleTextEditor.close();
|
|
47
|
+
(0, test_1.expect)(await sampleTextEditor.isTabVisible()).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
(0, test_1.test)('should be possible to open four text editors, switch among them, and close them', async () => {
|
|
50
|
+
const textEditor1_1_1 = await app.openEditor('sampleFolder/sampleFolder1/sampleFolder1-1/sampleFile1-1-1.txt', theia_text_editor_1.TheiaTextEditor);
|
|
51
|
+
const textEditor1_1_2 = await app.openEditor('sampleFolder/sampleFolder1/sampleFolder1-1/sampleFile1-1-2.txt', theia_text_editor_1.TheiaTextEditor);
|
|
52
|
+
const textEditor1_2_1 = await app.openEditor('sampleFolder/sampleFolder1/sampleFolder1-2/sampleFile1-2-1.txt', theia_text_editor_1.TheiaTextEditor);
|
|
53
|
+
const textEditor1_2_2 = await app.openEditor('sampleFolder/sampleFolder1/sampleFolder1-2/sampleFile1-2-2.txt', theia_text_editor_1.TheiaTextEditor);
|
|
54
|
+
const allEditors = [textEditor1_1_1, textEditor1_1_2, textEditor1_2_1, textEditor1_2_2];
|
|
55
|
+
// all editor tabs should be visible
|
|
56
|
+
for (const editor of allEditors) {
|
|
57
|
+
(0, test_1.expect)(await editor.isTabVisible()).toBe(true);
|
|
58
|
+
}
|
|
59
|
+
// activate one editor after the other and check that only this editor is active
|
|
60
|
+
for (const editor of allEditors) {
|
|
61
|
+
await editor.activate();
|
|
62
|
+
(0, test_1.expect)(await textEditor1_1_1.isActive()).toBe(textEditor1_1_1 === editor);
|
|
63
|
+
(0, test_1.expect)(await textEditor1_1_2.isActive()).toBe(textEditor1_1_2 === editor);
|
|
64
|
+
(0, test_1.expect)(await textEditor1_2_1.isActive()).toBe(textEditor1_2_1 === editor);
|
|
65
|
+
(0, test_1.expect)(await textEditor1_2_2.isActive()).toBe(textEditor1_2_2 === editor);
|
|
66
|
+
}
|
|
67
|
+
// close all editors
|
|
68
|
+
for (const editor of allEditors) {
|
|
69
|
+
await editor.activate();
|
|
70
|
+
await editor.close();
|
|
71
|
+
}
|
|
72
|
+
// check that all editors are closed
|
|
73
|
+
for (const editor of allEditors) {
|
|
74
|
+
(0, test_1.expect)(await editor.isTabVisible()).toBe(false);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
(0, test_1.test)('should return the contents of lines by line number', async () => {
|
|
78
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
79
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(2)).toBe('content line 2');
|
|
80
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(3)).toBe('content line 3');
|
|
81
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(4)).toBe('content line 4');
|
|
82
|
+
await sampleTextEditor.close();
|
|
83
|
+
});
|
|
84
|
+
(0, test_1.test)('should return the contents of lines containing text', async () => {
|
|
85
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
86
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineContainingText('line 2')).toBe('content line 2');
|
|
87
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineContainingText('line 3')).toBe('content line 3');
|
|
88
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineContainingText('line 4')).toBe('content line 4');
|
|
89
|
+
await sampleTextEditor.close();
|
|
90
|
+
});
|
|
91
|
+
(0, test_1.test)('should be dirty after changing the file contents and clean after save', async () => {
|
|
92
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
93
|
+
await sampleTextEditor.replaceLineWithLineNumber('this is just a sample file', 1);
|
|
94
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(true);
|
|
95
|
+
await sampleTextEditor.save();
|
|
96
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(false);
|
|
97
|
+
await sampleTextEditor.close();
|
|
98
|
+
});
|
|
99
|
+
(0, test_1.test)('should replace the line with line number 2 with new text "new -- content line 2 -- new"', async () => {
|
|
100
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
101
|
+
await sampleTextEditor.replaceLineWithLineNumber('new -- content line 2 -- new', 2);
|
|
102
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(2)).toBe('new -- content line 2 -- new');
|
|
103
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(true);
|
|
104
|
+
await sampleTextEditor.save();
|
|
105
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(false);
|
|
106
|
+
await sampleTextEditor.close();
|
|
107
|
+
});
|
|
108
|
+
(0, test_1.test)('should replace the line with containing text "content line 2" with "even newer -- content line 2 -- even newer"', async () => {
|
|
109
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
110
|
+
await sampleTextEditor.replaceLineContainingText('even newer -- content line 2 -- even newer', 'content line 2');
|
|
111
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(2)).toBe('even newer -- content line 2 -- even newer');
|
|
112
|
+
await sampleTextEditor.saveAndClose();
|
|
113
|
+
});
|
|
114
|
+
(0, test_1.test)('should delete the line with containing text "content line 2"', async () => {
|
|
115
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
116
|
+
await sampleTextEditor.deleteLineContainingText('content line 2');
|
|
117
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(2)).toBe('content line 3');
|
|
118
|
+
await sampleTextEditor.saveAndClose();
|
|
119
|
+
});
|
|
120
|
+
(0, test_1.test)('should delete the line with line number 2', async () => {
|
|
121
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
122
|
+
const lineBelowSecond = await sampleTextEditor.textContentOfLineByLineNumber(3);
|
|
123
|
+
await sampleTextEditor.deleteLineByLineNumber(2);
|
|
124
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(2)).toBe(lineBelowSecond);
|
|
125
|
+
await sampleTextEditor.saveAndClose();
|
|
126
|
+
});
|
|
127
|
+
(0, test_1.test)('should have more lines after adding text in new line after line containing text "sample file"', async () => {
|
|
128
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
129
|
+
const numberOfLinesBefore = await sampleTextEditor.numberOfLines();
|
|
130
|
+
await sampleTextEditor.addTextToNewLineAfterLineContainingText('sample file', 'new content for line 2');
|
|
131
|
+
const numberOfLinesAfter = await sampleTextEditor.numberOfLines();
|
|
132
|
+
(0, test_1.expect)(numberOfLinesBefore).not.toBeUndefined();
|
|
133
|
+
(0, test_1.expect)(numberOfLinesAfter).not.toBeUndefined();
|
|
134
|
+
(0, test_1.expect)(numberOfLinesAfter).toBeGreaterThan(numberOfLinesBefore);
|
|
135
|
+
await sampleTextEditor.saveAndClose();
|
|
136
|
+
});
|
|
137
|
+
(0, test_1.test)('should undo and redo text changes with correctly updated dirty states', async () => {
|
|
138
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
139
|
+
await sampleTextEditor.replaceLineWithLineNumber('change', 1);
|
|
140
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(1)).toBe('change');
|
|
141
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(true);
|
|
142
|
+
await sampleTextEditor.undo(2);
|
|
143
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(1)).toBe('this is just a sample file');
|
|
144
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(false);
|
|
145
|
+
await sampleTextEditor.redo(2);
|
|
146
|
+
(0, test_1.expect)(await sampleTextEditor.textContentOfLineByLineNumber(1)).toBe('change');
|
|
147
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(true);
|
|
148
|
+
await sampleTextEditor.saveAndClose();
|
|
149
|
+
});
|
|
150
|
+
(0, test_1.test)('should close without saving', async () => {
|
|
151
|
+
const sampleTextEditor = await app.openEditor('sample.txt', theia_text_editor_1.TheiaTextEditor);
|
|
152
|
+
await sampleTextEditor.replaceLineWithLineNumber('change again', 1);
|
|
153
|
+
(0, test_1.expect)(await sampleTextEditor.isDirty()).toBe(true);
|
|
154
|
+
(0, test_1.expect)(await sampleTextEditor.isTabVisible()).toBe(true);
|
|
155
|
+
await sampleTextEditor.closeWithoutSave();
|
|
156
|
+
(0, test_1.expect)(await sampleTextEditor.isTabVisible()).toBe(false);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
//# sourceMappingURL=theia-text-editor.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theia-text-editor.test.js","sourceRoot":"","sources":["../../src/tests/theia-text-editor.test.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,2CAAgD;AAChD,6BAA6B;AAE7B,0DAAqD;AACrD,oEAAkG;AAClG,4DAAuD;AACvD,wDAAoD;AAEpD,WAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAEpC,IAAI,GAAa,CAAC;IAElB,WAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE;QAC7C,MAAM,EAAE,GAAG,IAAI,gCAAc,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,yCAAyC,CAAC,CAAC,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