@theia/playwright 1.43.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/tests/theia-app.test.js +7 -7
- package/lib/tests/theia-app.test.js.map +1 -1
- package/lib/tests/theia-explorer-view.test.js +40 -23
- package/lib/tests/theia-explorer-view.test.js.map +1 -1
- package/lib/tests/theia-main-menu.test.js +33 -14
- package/lib/tests/theia-main-menu.test.js.map +1 -1
- package/lib/tests/theia-output-view.test.js +13 -11
- package/lib/tests/theia-output-view.test.js.map +1 -1
- package/lib/tests/theia-preference-view.test.js +14 -12
- package/lib/tests/theia-preference-view.test.js.map +1 -1
- package/lib/tests/theia-problems-view.test.js +12 -10
- package/lib/tests/theia-problems-view.test.js.map +1 -1
- package/lib/tests/theia-quick-command.test.js +13 -11
- package/lib/tests/theia-quick-command.test.js.map +1 -1
- package/lib/tests/theia-sample-app.test.js +11 -7
- package/lib/tests/theia-sample-app.test.js.map +1 -1
- package/lib/tests/theia-status-bar.test.js +11 -8
- package/lib/tests/theia-status-bar.test.js.map +1 -1
- package/lib/tests/theia-terminal-view.test.js +11 -9
- package/lib/tests/theia-terminal-view.test.js.map +1 -1
- package/lib/tests/theia-text-editor.test.js +21 -19
- package/lib/tests/theia-text-editor.test.js.map +1 -1
- package/lib/tests/theia-toolbar.test.js +10 -8
- package/lib/tests/theia-toolbar.test.js.map +1 -1
- package/lib/tests/theia-workspace.test.js +34 -12
- package/lib/tests/theia-workspace.test.js.map +1 -1
- 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 +130 -0
- package/lib/theia-app-loader.js.map +1 -0
- package/lib/theia-app.d.ts +11 -11
- package/lib/theia-app.d.ts.map +1 -1
- package/lib/theia-app.js +21 -33
- package/lib/theia-app.js.map +1 -1
- package/lib/theia-explorer-view.d.ts.map +1 -1
- package/lib/theia-explorer-view.js +1 -0
- package/lib/theia-explorer-view.js.map +1 -1
- package/lib/theia-preference-view.d.ts +8 -0
- package/lib/theia-preference-view.d.ts.map +1 -1
- package/lib/theia-preference-view.js +8 -0
- package/lib/theia-preference-view.js.map +1 -1
- package/package.json +6 -4
- package/src/index.ts +1 -0
- package/src/tests/theia-app.test.ts +7 -8
- package/src/tests/theia-explorer-view.test.ts +30 -8
- package/src/tests/theia-main-menu.test.ts +31 -8
- package/src/tests/theia-output-view.test.ts +10 -10
- package/src/tests/theia-preference-view.test.ts +10 -6
- package/src/tests/theia-problems-view.test.ts +10 -6
- package/src/tests/theia-quick-command.test.ts +11 -7
- package/src/tests/theia-sample-app.test.ts +11 -6
- package/src/tests/theia-status-bar.test.ts +11 -6
- package/src/tests/theia-terminal-view.test.ts +8 -4
- package/src/tests/theia-text-editor.test.ts +11 -7
- package/src/tests/theia-toolbar.test.ts +8 -4
- package/src/tests/theia-workspace.test.ts +38 -12
- package/src/theia-app-loader.ts +167 -0
- package/src/theia-app.ts +26 -29
- package/src/theia-explorer-view.ts +1 -0
- package/src/theia-preference-view.ts +8 -0
- package/lib/tests/fixtures/theia-fixture.d.ts +0 -4
- package/lib/tests/fixtures/theia-fixture.d.ts.map +0 -1
- package/lib/tests/fixtures/theia-fixture.js +0 -24
- package/lib/tests/fixtures/theia-fixture.js.map +0 -1
- package/src/tests/fixtures/theia-fixture.ts +0 -25
|
@@ -14,24 +14,37 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
18
19
|
import { TheiaApp } from '../theia-app';
|
|
20
|
+
import { PreferenceIds, TheiaPreferenceView } from '../theia-preference-view';
|
|
19
21
|
import { DOT_FILES_FILTER, TheiaExplorerView } from '../theia-explorer-view';
|
|
20
22
|
import { TheiaWorkspace } from '../theia-workspace';
|
|
21
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
22
|
-
|
|
23
|
-
let app: TheiaApp;
|
|
24
|
-
let explorer: TheiaExplorerView;
|
|
25
23
|
|
|
26
24
|
test.describe('Theia Explorer View', () => {
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
let app: TheiaApp;
|
|
27
|
+
let explorer: TheiaExplorerView;
|
|
28
|
+
|
|
29
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
29
30
|
const ws = new TheiaWorkspace(['src/tests/resources/sample-files1']);
|
|
30
|
-
app = await
|
|
31
|
+
app = await TheiaAppLoader.load({ playwright, browser }, ws);
|
|
32
|
+
|
|
33
|
+
if (app.isElectron) {
|
|
34
|
+
// set trash preference to off
|
|
35
|
+
const preferenceView = await app.openPreferences(TheiaPreferenceView);
|
|
36
|
+
await preferenceView.setBooleanPreferenceById(PreferenceIds.Files.EnableTrash, false);
|
|
37
|
+
await preferenceView.close();
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
explorer = await app.openView(TheiaExplorerView);
|
|
32
41
|
await explorer.waitForVisibleFileNodes();
|
|
33
42
|
});
|
|
34
43
|
|
|
44
|
+
test.afterAll(async () => {
|
|
45
|
+
await app.page.close();
|
|
46
|
+
});
|
|
47
|
+
|
|
35
48
|
test('should be visible and active after being opened', async () => {
|
|
36
49
|
expect(await explorer.isTabVisible()).toBe(true);
|
|
37
50
|
expect(await explorer.isDisplayed()).toBe(true);
|
|
@@ -131,7 +144,9 @@ test.describe('Theia Explorer View', () => {
|
|
|
131
144
|
const menuItems = await menu.visibleMenuItems();
|
|
132
145
|
expect(menuItems).toContain('Open');
|
|
133
146
|
expect(menuItems).toContain('Delete');
|
|
134
|
-
|
|
147
|
+
if (!app.isElectron) {
|
|
148
|
+
expect(menuItems).toContain('Download');
|
|
149
|
+
}
|
|
135
150
|
|
|
136
151
|
await menu.close();
|
|
137
152
|
expect(await menu.isOpen()).toBe(false);
|
|
@@ -186,4 +201,11 @@ test.describe('Theia Explorer View', () => {
|
|
|
186
201
|
expect(updatedFileStatElements.length).toBe(fileStatElements.length - 1);
|
|
187
202
|
});
|
|
188
203
|
|
|
204
|
+
test('open "sample.txt" via the context menu', async () => {
|
|
205
|
+
expect(await explorer.existsFileNode('sample.txt')).toBe(true);
|
|
206
|
+
await explorer.clickContextMenuItem('sample.txt', ['Open']);
|
|
207
|
+
const span = await app.page.waitForSelector('span:has-text("content line 2")');
|
|
208
|
+
expect(await span.isVisible()).toBe(true);
|
|
209
|
+
});
|
|
210
|
+
|
|
189
211
|
});
|
|
@@ -14,21 +14,27 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
18
|
-
import { OSUtil } from '../util';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
19
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
20
|
+
import { TheiaAboutDialog } from '../theia-about-dialog';
|
|
20
21
|
import { TheiaMenuBar } from '../theia-main-menu';
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
let menuBar: TheiaMenuBar;
|
|
22
|
+
import { OSUtil } from '../util';
|
|
24
23
|
|
|
25
24
|
test.describe('Theia Main Menu', () => {
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
let app: TheiaApp;
|
|
27
|
+
let menuBar: TheiaMenuBar;
|
|
28
|
+
|
|
29
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
30
|
+
app = await TheiaAppLoader.load({ playwright, browser });
|
|
29
31
|
menuBar = app.menuBar;
|
|
30
32
|
});
|
|
31
33
|
|
|
34
|
+
test.afterAll(async () => {
|
|
35
|
+
await app.page.close();
|
|
36
|
+
});
|
|
37
|
+
|
|
32
38
|
test('should show the main menu bar', async () => {
|
|
33
39
|
const menuBarItems = await menuBar.visibleMenuBarItems();
|
|
34
40
|
expect(menuBarItems).toContain('File');
|
|
@@ -57,7 +63,7 @@ test.describe('Theia Main Menu', () => {
|
|
|
57
63
|
expect(label).toBe('New Text File');
|
|
58
64
|
|
|
59
65
|
const shortCut = await menuItem?.shortCut();
|
|
60
|
-
expect(shortCut).toBe(OSUtil.isMacOS ? '⌥ N' : 'Alt+N');
|
|
66
|
+
expect(shortCut).toBe(OSUtil.isMacOS ? '⌥ N' : app.isElectron ? 'Ctrl+N' : 'Alt+N');
|
|
61
67
|
|
|
62
68
|
const hasSubmenu = await menuItem?.hasSubmenu();
|
|
63
69
|
expect(hasSubmenu).toBe(false);
|
|
@@ -86,4 +92,21 @@ test.describe('Theia Main Menu', () => {
|
|
|
86
92
|
expect(await mainMenu.isOpen()).toBe(false);
|
|
87
93
|
});
|
|
88
94
|
|
|
95
|
+
test('open about dialog using menu', async () => {
|
|
96
|
+
await (await menuBar.openMenu('Help')).clickMenuItem('About');
|
|
97
|
+
const aboutDialog = new TheiaAboutDialog(app);
|
|
98
|
+
expect(await aboutDialog.isVisible()).toBe(true);
|
|
99
|
+
await aboutDialog.page.getByRole('button', { name: 'OK' }).click();
|
|
100
|
+
expect(await aboutDialog.isVisible()).toBe(false);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test('open file via file menu and cancel', async () => {
|
|
104
|
+
const openFileEntry = app.isElectron ? 'Open File...' : 'Open...';
|
|
105
|
+
await (await menuBar.openMenu('File')).clickMenuItem(openFileEntry);
|
|
106
|
+
const fileDialog = await app.page.waitForSelector('div[class="dialogBlock"]');
|
|
107
|
+
expect(await fileDialog.isVisible()).toBe(true);
|
|
108
|
+
await app.page.locator('#theia-dialog-shell').getByRole('button', { name: 'Cancel' }).click();
|
|
109
|
+
expect(await fileDialog.isVisible()).toBe(false);
|
|
110
|
+
});
|
|
111
|
+
|
|
89
112
|
});
|
|
@@ -14,20 +14,21 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
18
|
-
import { TheiaOutputViewChannel } from '
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
|
+
import { TheiaOutputViewChannel } from '../theia-output-channel';
|
|
19
19
|
import { TheiaApp } from '../theia-app';
|
|
20
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
20
21
|
import { TheiaOutputView } from '../theia-output-view';
|
|
21
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
22
|
-
|
|
23
|
-
let app: TheiaApp;
|
|
24
|
-
let outputView: TheiaOutputView;
|
|
25
|
-
let testChannel: TheiaOutputViewChannel;
|
|
26
22
|
|
|
23
|
+
let app: TheiaApp; let outputView: TheiaOutputView; let testChannel: TheiaOutputViewChannel;
|
|
27
24
|
test.describe('Theia Output View', () => {
|
|
28
25
|
|
|
29
|
-
test.beforeAll(async () => {
|
|
30
|
-
app = await
|
|
26
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
27
|
+
app = await TheiaAppLoader.load({ playwright, browser });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test.afterAll(async () => {
|
|
31
|
+
await app.page.close();
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
test('should open the output view and check if is visible and active', async () => {
|
|
@@ -82,4 +83,3 @@ test.describe('Theia Output View', () => {
|
|
|
82
83
|
});
|
|
83
84
|
|
|
84
85
|
});
|
|
85
|
-
|
|
@@ -14,17 +14,21 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
19
20
|
import { DefaultPreferences, PreferenceIds, TheiaPreferenceView } from '../theia-preference-view';
|
|
20
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
21
|
-
|
|
22
|
-
let app: TheiaApp;
|
|
23
21
|
|
|
24
22
|
test.describe('Preference View', () => {
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
let app: TheiaApp;
|
|
25
|
+
|
|
26
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
27
|
+
app = await TheiaAppLoader.load({ playwright, browser });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test.afterAll(async () => {
|
|
31
|
+
await app.page.close();
|
|
28
32
|
});
|
|
29
33
|
|
|
30
34
|
test('should be visible and active after being opened', async () => {
|
|
@@ -14,17 +14,21 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
19
20
|
import { TheiaProblemsView } from '../theia-problem-view';
|
|
20
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
21
|
-
|
|
22
|
-
let app: TheiaApp;
|
|
23
21
|
|
|
24
22
|
test.describe('Theia Problems View', () => {
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
let app: TheiaApp;
|
|
25
|
+
|
|
26
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
27
|
+
app = await TheiaAppLoader.load({ playwright, browser });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test.afterAll(async () => {
|
|
31
|
+
await app.page.close();
|
|
28
32
|
});
|
|
29
33
|
|
|
30
34
|
test('should be visible and active after being opened', async () => {
|
|
@@ -14,25 +14,29 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
18
19
|
import { TheiaAboutDialog } from '../theia-about-dialog';
|
|
19
20
|
import { TheiaApp } from '../theia-app';
|
|
20
21
|
import { TheiaExplorerView } from '../theia-explorer-view';
|
|
21
22
|
import { TheiaNotificationIndicator } from '../theia-notification-indicator';
|
|
22
23
|
import { TheiaNotificationOverlay } from '../theia-notification-overlay';
|
|
23
24
|
import { TheiaQuickCommandPalette } from '../theia-quick-command-palette';
|
|
24
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
25
|
-
|
|
26
|
-
let app: TheiaApp;
|
|
27
|
-
let quickCommand: TheiaQuickCommandPalette;
|
|
28
25
|
|
|
29
26
|
test.describe('Theia Quick Command', () => {
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
let app: TheiaApp;
|
|
29
|
+
let quickCommand: TheiaQuickCommandPalette;
|
|
30
|
+
|
|
31
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
32
|
+
app = await TheiaAppLoader.load({ playwright, browser });
|
|
33
33
|
quickCommand = app.quickCommandPalette;
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
+
test.afterAll(async () => {
|
|
37
|
+
await app.page.close();
|
|
38
|
+
});
|
|
39
|
+
|
|
36
40
|
test('should show quick command palette', async () => {
|
|
37
41
|
await quickCommand.open();
|
|
38
42
|
expect(await quickCommand.isOpen()).toBe(true);
|
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
19
20
|
import { TheiaToolbar } from '../theia-toolbar';
|
|
20
|
-
import
|
|
21
|
+
import { TheiaWorkspace } from '../theia-workspace';
|
|
21
22
|
|
|
22
23
|
class TheiaSampleApp extends TheiaApp {
|
|
23
24
|
protected toolbar = new TheiaToolbar(this);
|
|
@@ -35,12 +36,16 @@ class TheiaSampleApp extends TheiaApp {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
let app: TheiaSampleApp;
|
|
39
|
-
|
|
40
39
|
test.describe('Theia Sample Application', () => {
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
let app: TheiaSampleApp;
|
|
42
|
+
|
|
43
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
44
|
+
app = await TheiaAppLoader.load({ playwright, browser }, new TheiaWorkspace(), TheiaSampleApp);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test.afterAll(async () => {
|
|
48
|
+
await app.page.close();
|
|
44
49
|
});
|
|
45
50
|
|
|
46
51
|
test('should start with visible toolbar', async () => {
|
|
@@ -14,23 +14,28 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
19
20
|
import { TheiaNotificationIndicator } from '../theia-notification-indicator';
|
|
20
21
|
import { TheiaProblemIndicator } from '../theia-problem-indicator';
|
|
21
22
|
import { TheiaStatusBar } from '../theia-status-bar';
|
|
22
23
|
import { TheiaToggleBottomIndicator } from '../theia-toggle-bottom-indicator';
|
|
23
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
24
|
-
|
|
25
|
-
let statusBar: TheiaStatusBar;
|
|
26
24
|
|
|
27
25
|
test.describe('Theia Status Bar', () => {
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
let app: TheiaApp;
|
|
28
|
+
let statusBar: TheiaStatusBar;
|
|
29
|
+
|
|
30
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
31
|
+
app = await TheiaAppLoader.load({ playwright, browser });
|
|
31
32
|
statusBar = app.statusBar;
|
|
32
33
|
});
|
|
33
34
|
|
|
35
|
+
test.afterAll(async () => {
|
|
36
|
+
await app.page.close();
|
|
37
|
+
});
|
|
38
|
+
|
|
34
39
|
test('should show status bar', async () => {
|
|
35
40
|
expect(await statusBar.isVisible()).toBe(true);
|
|
36
41
|
});
|
|
@@ -14,19 +14,23 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
19
20
|
import { TheiaWorkspace } from '../theia-workspace';
|
|
20
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
21
21
|
import { TheiaTerminal } from '../theia-terminal';
|
|
22
22
|
|
|
23
23
|
let app: TheiaApp;
|
|
24
24
|
|
|
25
25
|
test.describe('Theia Terminal View', () => {
|
|
26
26
|
|
|
27
|
-
test.beforeAll(async () => {
|
|
27
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
28
28
|
const ws = new TheiaWorkspace(['src/tests/resources/sample-files1']);
|
|
29
|
-
app = await
|
|
29
|
+
app = await TheiaAppLoader.load({ playwright, browser }, ws);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test.afterAll(async () => {
|
|
33
|
+
await app.page.close();
|
|
30
34
|
});
|
|
31
35
|
|
|
32
36
|
test('should be possible to open a new terminal', async () => {
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
18
|
-
import { DefaultPreferences, PreferenceIds, TheiaPreferenceView } from '../theia-preference-view';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
19
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
20
|
+
import { DefaultPreferences, PreferenceIds, TheiaPreferenceView } from '../theia-preference-view';
|
|
20
21
|
import { TheiaTextEditor } from '../theia-text-editor';
|
|
21
22
|
import { TheiaWorkspace } from '../theia-workspace';
|
|
22
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
23
|
-
|
|
24
|
-
let app: TheiaApp;
|
|
25
23
|
|
|
26
24
|
test.describe('Theia Text Editor', () => {
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
let app: TheiaApp;
|
|
27
|
+
|
|
28
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
29
29
|
const ws = new TheiaWorkspace(['src/tests/resources/sample-files1']);
|
|
30
|
-
app = await
|
|
30
|
+
app = await TheiaAppLoader.load({ playwright, browser }, ws);
|
|
31
31
|
|
|
32
32
|
// set auto-save preference to off
|
|
33
33
|
const preferenceView = await app.openPreferences(TheiaPreferenceView);
|
|
@@ -35,6 +35,10 @@ test.describe('Theia Text Editor', () => {
|
|
|
35
35
|
await preferenceView.close();
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
test.afterAll(async () => {
|
|
39
|
+
await app.page.close();
|
|
40
|
+
});
|
|
41
|
+
|
|
38
42
|
test('should be visible and active after opening "sample.txt"', async () => {
|
|
39
43
|
const sampleTextEditor = await app.openEditor('sample.txt', TheiaTextEditor);
|
|
40
44
|
expect(await sampleTextEditor.isTabVisible()).toBe(true);
|
|
@@ -14,21 +14,25 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
18
|
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
19
20
|
import { TheiaToolbar } from '../theia-toolbar';
|
|
20
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
21
21
|
|
|
22
22
|
let app: TheiaApp;
|
|
23
23
|
let toolbar: TheiaToolbar;
|
|
24
24
|
|
|
25
25
|
test.describe('Theia Toolbar', () => {
|
|
26
26
|
|
|
27
|
-
test.beforeAll(async () => {
|
|
28
|
-
app = await
|
|
27
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
28
|
+
app = await TheiaAppLoader.load({ playwright, browser });
|
|
29
29
|
toolbar = new TheiaToolbar(app);
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
+
test.afterAll(async () => {
|
|
33
|
+
await app.page.close();
|
|
34
|
+
});
|
|
35
|
+
|
|
32
36
|
test('should toggle the toolbar and check visibility', async () => {
|
|
33
37
|
// depending on the user settings we have different starting conditions for the toolbar
|
|
34
38
|
const isShownInitially = await toolbar.isShown();
|
|
@@ -14,34 +14,41 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { expect } from '@playwright/test';
|
|
18
|
-
import {
|
|
17
|
+
import { expect, test } from '@playwright/test';
|
|
18
|
+
import { TheiaAppLoader } from '../theia-app-loader';
|
|
19
19
|
import { DOT_FILES_FILTER, TheiaExplorerView } from '../theia-explorer-view';
|
|
20
20
|
import { TheiaWorkspace } from '../theia-workspace';
|
|
21
|
-
import test, { page } from './fixtures/theia-fixture';
|
|
22
21
|
|
|
23
22
|
test.describe('Theia Workspace', () => {
|
|
23
|
+
let isElectron: boolean;
|
|
24
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
25
|
+
isElectron = process.env.USE_ELECTRON === 'true';
|
|
26
|
+
});
|
|
24
27
|
|
|
25
|
-
test('should be initialized empty by default', async () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
test('should be initialized empty by default', async ({ playwright, browser }) => {
|
|
29
|
+
if (!isElectron) {
|
|
30
|
+
const app = await TheiaAppLoader.load({ playwright, browser });
|
|
31
|
+
const explorer = await app.openView(TheiaExplorerView);
|
|
32
|
+
const fileStatElements = await explorer.visibleFileStatNodes(DOT_FILES_FILTER);
|
|
33
|
+
expect(fileStatElements.length).toBe(0);
|
|
34
|
+
await app.page.close();
|
|
35
|
+
}
|
|
30
36
|
});
|
|
31
37
|
|
|
32
|
-
test('should be initialized with the contents of a file location', async () => {
|
|
38
|
+
test('should be initialized with the contents of a file location', async ({ playwright, browser }) => {
|
|
33
39
|
const ws = new TheiaWorkspace(['src/tests/resources/sample-files1']);
|
|
34
|
-
const app = await
|
|
40
|
+
const app = await TheiaAppLoader.load({ playwright, browser }, ws);
|
|
35
41
|
const explorer = await app.openView(TheiaExplorerView);
|
|
36
42
|
// resources/sample-files1 contains two folders and one file
|
|
37
43
|
expect(await explorer.existsDirectoryNode('sampleFolder')).toBe(true);
|
|
38
44
|
expect(await explorer.existsDirectoryNode('sampleFolderCompact')).toBe(true);
|
|
39
45
|
expect(await explorer.existsFileNode('sample.txt')).toBe(true);
|
|
46
|
+
await app.page.close();
|
|
40
47
|
});
|
|
41
48
|
|
|
42
|
-
test('should be initialized with the contents of multiple file locations', async () => {
|
|
49
|
+
test('should be initialized with the contents of multiple file locations', async ({ playwright, browser }) => {
|
|
43
50
|
const ws = new TheiaWorkspace(['src/tests/resources/sample-files1', 'src/tests/resources/sample-files2']);
|
|
44
|
-
const app = await
|
|
51
|
+
const app = await TheiaAppLoader.load({ playwright, browser }, ws);
|
|
45
52
|
const explorer = await app.openView(TheiaExplorerView);
|
|
46
53
|
// resources/sample-files1 contains two folders and one file
|
|
47
54
|
expect(await explorer.existsDirectoryNode('sampleFolder')).toBe(true);
|
|
@@ -49,6 +56,25 @@ test.describe('Theia Workspace', () => {
|
|
|
49
56
|
expect(await explorer.existsFileNode('sample.txt')).toBe(true);
|
|
50
57
|
// resources/sample-files2 contains one file
|
|
51
58
|
expect(await explorer.existsFileNode('another-sample.txt')).toBe(true);
|
|
59
|
+
await app.page.close();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('open sample.txt via file menu', async ({ playwright, browser }) => {
|
|
63
|
+
const ws = new TheiaWorkspace(['src/tests/resources/sample-files1']);
|
|
64
|
+
const app = await TheiaAppLoader.load({ playwright, browser }, ws);
|
|
65
|
+
const menuEntry = app.isElectron ? 'Open File...' : 'Open...';
|
|
66
|
+
|
|
67
|
+
await (await app.menuBar.openMenu('File')).clickMenuItem(menuEntry);
|
|
68
|
+
const fileDialog = await app.page.waitForSelector('div[class="dialogBlock"]');
|
|
69
|
+
expect(await fileDialog.isVisible()).toBe(true);
|
|
70
|
+
|
|
71
|
+
const fileEntry = app.page.getByText('sample.txt');
|
|
72
|
+
await fileEntry.click();
|
|
73
|
+
await app.page.locator('#theia-dialog-shell').getByRole('button', { name: 'Open' }).click();
|
|
74
|
+
|
|
75
|
+
const span = await app.page.waitForSelector('span:has-text("content line 2")');
|
|
76
|
+
expect(await span.isVisible()).toBe(true);
|
|
77
|
+
await app.page.close();
|
|
52
78
|
});
|
|
53
79
|
|
|
54
80
|
});
|