@theia/playwright 1.55.0-next.4 → 1.55.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 +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/tests/theia-explorer-view.test.js +3 -2
- package/lib/tests/theia-explorer-view.test.js.map +1 -1
- package/lib/tests/theia-main-menu.test.js +4 -5
- package/lib/tests/theia-main-menu.test.js.map +1 -1
- 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 +266 -0
- package/lib/tests/theia-notebook-editor.test.js.map +1 -0
- package/lib/tests/theia-quick-command.test.js +5 -0
- package/lib/tests/theia-quick-command.test.js.map +1 -1
- package/lib/theia-monaco-editor.d.ts +14 -0
- package/lib/theia-monaco-editor.d.ts.map +1 -1
- package/lib/theia-monaco-editor.js +42 -1
- package/lib/theia-monaco-editor.js.map +1 -1
- package/lib/theia-notebook-cell.d.ts +96 -0
- package/lib/theia-notebook-cell.d.ts.map +1 -0
- package/lib/theia-notebook-cell.js +209 -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-preference-view.d.ts +7 -1
- package/lib/theia-preference-view.d.ts.map +1 -1
- package/lib/theia-preference-view.js +16 -2
- package/lib/theia-preference-view.js.map +1 -1
- package/lib/theia-quick-command-palette.d.ts +1 -0
- package/lib/theia-quick-command-palette.d.ts.map +1 -1
- package/lib/theia-quick-command-palette.js +8 -0
- package/lib/theia-quick-command-palette.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +3 -0
- package/src/tests/resources/notebook-files/.theia/settings.json +3 -0
- package/src/tests/resources/notebook-files/sample.ipynb +18 -0
- package/src/tests/theia-explorer-view.test.ts +3 -2
- package/src/tests/theia-main-menu.test.ts +4 -5
- package/src/tests/theia-notebook-editor.test.ts +322 -0
- package/src/tests/theia-quick-command.test.ts +6 -0
- package/src/theia-monaco-editor.ts +44 -1
- package/src/theia-notebook-cell.ts +247 -0
- package/src/theia-notebook-editor.ts +171 -0
- package/src/theia-notebook-toolbar.ts +53 -0
- package/src/theia-preference-view.ts +14 -2
- package/src/theia-quick-command-palette.ts +10 -0
|
@@ -79,8 +79,22 @@ class TheiaPreferenceView extends theia_view_1.TheiaView {
|
|
|
79
79
|
this.optionSelectDropdown = '.theia-select-component-dropdown';
|
|
80
80
|
this.optionSelectDropdownValue = '.theia-select-component-option-value';
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
/**
|
|
83
|
+
* @param preferenceScope The preference scope (Workspace or User) to open the view for. Default is Workspace.
|
|
84
|
+
* @param useMenu If true, the view will be opened via the main menu. If false,
|
|
85
|
+
* the view will be opened via the quick command palette. Default is using the main menu.
|
|
86
|
+
* @returns The TheiaPreferenceView page object instance.
|
|
87
|
+
*/
|
|
88
|
+
async open(preferenceScope = TheiaPreferenceScope.Workspace, useMenu = true) {
|
|
89
|
+
var _a;
|
|
90
|
+
if (useMenu) {
|
|
91
|
+
const mainMenu = await this.app.menuBar.openMenu('File');
|
|
92
|
+
await ((_a = (await mainMenu.menuItemByNamePath('Preferences', 'Settings'))) === null || _a === void 0 ? void 0 : _a.click());
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
await this.app.quickCommandPalette.type('Preferences:');
|
|
96
|
+
await this.app.quickCommandPalette.trigger('Preferences: Open Settings (UI)');
|
|
97
|
+
}
|
|
84
98
|
await this.waitForVisible();
|
|
85
99
|
await this.openPreferenceScope(preferenceScope);
|
|
86
100
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-preference-view.js","sourceRoot":"","sources":["../src/theia-preference-view.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;;;AAIhF,6CAAyC;AAEzC,MAAM,qBAAqB,GAAG;IAC1B,WAAW,EAAE,4BAA4B;IACzC,YAAY,EAAE,kBAAkB;CACnC,CAAC;AAEW,QAAA,aAAa,GAAG;IACzB,MAAM,EAAE;QACJ,QAAQ,EAAE,gBAAgB;QAC1B,gBAAgB,EAAE,yBAAyB;KAC9C;IACD,QAAQ,EAAE;QACN,UAAU,EAAE,qBAAqB;KACpC;IACD,UAAU,EAAE;QACR,kBAAkB,EAAE,+BAA+B;KACtD;IACD,KAAK,EAAE;QACH,WAAW,EAAE,mBAAmB;KACnC;CACJ,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAC9B,MAAM,EAAE;QACJ,QAAQ,EAAE;YACN,GAAG,EAAE,KAAK;YACV,UAAU,EAAE,YAAY;YACxB,aAAa,EAAE,eAAe;YAC9B,cAAc,EAAE,gBAAgB;SACnC;QACD,gBAAgB,EAAE;YACd,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,WAAW;YACtB,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,KAAK;SACb;KACJ;IACD,QAAQ,EAAE;QACN,UAAU,EAAE;YACR,OAAO,EAAE,IAAI;SAChB;KACJ;IACD,UAAU,EAAE;QACR,kBAAkB,EAAE,MAAM;KAC7B;IACD,KAAK,EAAE;QACH,WAAW,EAAE;YACT,OAA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IAAI,CAAC,2BAA2B,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,qBAAqB,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAA,CAAC;IAC1J,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,YAAoB;QACxC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACtB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,qBAAqB,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAA,CAAC;IAC7K,CAAC;IAEO,2BAA2B,CAAC,YAAoB;QACpD,OAAO,GAAG,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,uBAAuB,CAAC;IAC9E,CAAC;CACJ;AA9KD,kDA8KC"}
|
|
@@ -9,5 +9,6 @@ export declare class TheiaQuickCommandPalette extends TheiaPageObject {
|
|
|
9
9
|
protected triggerSingleCommand(commandName: string): Promise<void>;
|
|
10
10
|
type(value: string, confirm?: boolean): Promise<void>;
|
|
11
11
|
protected selectedCommand(): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
|
|
12
|
+
visibleItems(): Promise<ElementHandle<SVGElement | HTMLElement>[]>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=theia-quick-command-palette.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-quick-command-palette.d.ts","sourceRoot":"","sources":["../src/theia-quick-command-palette.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,qBAAa,wB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Aa,CAAC,UAAU,GAAG,WAAW,CAAC,EAAE,CAAC;CAS3E"}
|
|
@@ -74,6 +74,14 @@ class TheiaQuickCommandPalette extends theia_page_object_1.TheiaPageObject {
|
|
|
74
74
|
}
|
|
75
75
|
return command.$('.monaco-list-row.focused .monaco-highlighted-label');
|
|
76
76
|
}
|
|
77
|
+
async visibleItems() {
|
|
78
|
+
// FIXME rewrite with locators
|
|
79
|
+
const command = await this.page.waitForSelector(this.selector);
|
|
80
|
+
if (!command) {
|
|
81
|
+
throw new Error('No selected command found!');
|
|
82
|
+
}
|
|
83
|
+
return command.$$('.monaco-highlighted-label');
|
|
84
|
+
}
|
|
77
85
|
}
|
|
78
86
|
exports.TheiaQuickCommandPalette = TheiaQuickCommandPalette;
|
|
79
87
|
//# sourceMappingURL=theia-quick-command-palette.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theia-quick-command-palette.js","sourceRoot":"","sources":["../src/theia-quick-command-palette.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;;;AAGhF,2DAAsD;AACtD,iCAAuD;AAEvD,MAAa,wBAAyB,SAAQ,mCAAe;IAA7D;;QAEI,aAAQ,GAAG,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"theia-quick-command-palette.js","sourceRoot":"","sources":["../src/theia-quick-command-palette.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;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AAC;IAED,KAAK,CAAC,YAAY;QACd,8BAA8B;QAC9B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,OAAO,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC;IACnD,CAAC;CAEJ;AAtED,4DAsEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/playwright",
|
|
3
|
-
"version": "1.55.0
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"description": "System tests for Theia",
|
|
5
5
|
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"allure-commandline": "^2.23.1",
|
|
40
40
|
"allure-playwright": "^2.5.0",
|
|
41
41
|
"cross-env": "^7.0.3",
|
|
42
|
-
"rimraf": "^
|
|
42
|
+
"rimraf": "^5.0.0",
|
|
43
43
|
"typescript": "~5.4.5"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"main": "lib/index",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "0e7a523b8e798679d2e098709c63bd7060e54c8a"
|
|
50
50
|
}
|
package/src/index.ts
CHANGED
|
@@ -26,6 +26,9 @@ export * from './theia-menu-item';
|
|
|
26
26
|
export * from './theia-menu';
|
|
27
27
|
export * from './theia-notification-indicator';
|
|
28
28
|
export * from './theia-notification-overlay';
|
|
29
|
+
export * from './theia-notebook-cell';
|
|
30
|
+
export * from './theia-notebook-editor';
|
|
31
|
+
export * from './theia-notebook-toolbar';
|
|
29
32
|
export * from './theia-output-channel';
|
|
30
33
|
export * from './theia-output-view';
|
|
31
34
|
export * from './theia-page-object';
|
|
@@ -183,7 +183,8 @@ test.describe('Theia Explorer View', () => {
|
|
|
183
183
|
expect(await explorer.existsDirectoryNode('sampleDirectoryCompact/nestedFolder1/nestedFolder2', true /* compact */)).toBe(true);
|
|
184
184
|
});
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
// TODO These tests only seems to fail on Ubuntu - it's not clear why
|
|
187
|
+
test.skip('should delete nested folder "sampleDirectoryCompact/nestedFolder1/nestedFolder2"', async () => {
|
|
187
188
|
const fileStatElements = await explorer.visibleFileStatNodes();
|
|
188
189
|
expect(await explorer.existsDirectoryNode('sampleDirectoryCompact/nestedFolder1/nestedFolder2', true /* compact */)).toBe(true);
|
|
189
190
|
await explorer.deleteNode('sampleDirectoryCompact/nestedFolder1/nestedFolder2', true /* confirm */, 'nestedFolder2' /* nodeSegmentLabel */);
|
|
@@ -192,7 +193,7 @@ test.describe('Theia Explorer View', () => {
|
|
|
192
193
|
expect(updatedFileStatElements.length).toBe(fileStatElements.length - 1);
|
|
193
194
|
});
|
|
194
195
|
|
|
195
|
-
test('should delete compact folder "sampleDirectoryCompact/nestedFolder1"', async () => {
|
|
196
|
+
test.skip('should delete compact folder "sampleDirectoryCompact/nestedFolder1"', async () => {
|
|
196
197
|
const fileStatElements = await explorer.visibleFileStatNodes();
|
|
197
198
|
expect(await explorer.existsDirectoryNode('sampleDirectoryCompact/nestedFolder1', true /* compact */)).toBe(true);
|
|
198
199
|
await explorer.deleteNode('sampleDirectoryCompact/nestedFolder1', true /* confirm */, 'sampleDirectoryCompact' /* nodeSegmentLabel */);
|
|
@@ -110,18 +110,17 @@ test.describe('Theia Main Menu', () => {
|
|
|
110
110
|
expect(await fileDialog.isVisible()).toBe(false);
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
test('Create file via New File menu and
|
|
114
|
-
|
|
115
|
-
await (await menuBar.openMenu('File')).clickMenuItem(openFileEntry);
|
|
113
|
+
test('Create file via New File menu and accept', async () => {
|
|
114
|
+
await (await menuBar.openMenu('File')).clickMenuItem('New File...');
|
|
116
115
|
const quickPick = app.page.getByPlaceholder('Select File Type or Enter');
|
|
117
116
|
// type file name and press enter
|
|
118
117
|
await quickPick.fill('test.txt');
|
|
119
118
|
await quickPick.press('Enter');
|
|
120
119
|
|
|
121
|
-
// check file dialog is opened and accept with
|
|
120
|
+
// check file dialog is opened and accept with ENTER
|
|
122
121
|
const fileDialog = await app.page.waitForSelector('div[class="dialogBlock"]');
|
|
123
122
|
expect(await fileDialog.isVisible()).toBe(true);
|
|
124
|
-
await app.page.locator('#theia-dialog-shell').
|
|
123
|
+
await app.page.locator('#theia-dialog-shell').press('Enter');
|
|
125
124
|
expect(await fileDialog.isVisible()).toBe(false);
|
|
126
125
|
|
|
127
126
|
// check file in workspace exists
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2024 TypeFox GmbH and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { Locator, PlaywrightWorkerArgs, expect, test } from '@playwright/test';
|
|
18
|
+
import { TheiaApp } from '../theia-app';
|
|
19
|
+
import { TheiaAppLoader, TheiaPlaywrightTestConfig } from '../theia-app-loader';
|
|
20
|
+
import { TheiaNotebookCell } from '../theia-notebook-cell';
|
|
21
|
+
import { TheiaNotebookEditor } from '../theia-notebook-editor';
|
|
22
|
+
import { TheiaWorkspace } from '../theia-workspace';
|
|
23
|
+
import path = require('path');
|
|
24
|
+
|
|
25
|
+
// See .github/workflows/playwright.yml for preferred python version
|
|
26
|
+
const preferredKernel = process.env.CI ? 'Python 3.11' : 'Python 3';
|
|
27
|
+
|
|
28
|
+
test.describe('Theia Notebook Editor interaction', () => {
|
|
29
|
+
|
|
30
|
+
let app: TheiaApp;
|
|
31
|
+
let editor: TheiaNotebookEditor;
|
|
32
|
+
|
|
33
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
34
|
+
app = await loadApp({ playwright, browser });
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test.beforeEach(async ({ playwright, browser }) => {
|
|
38
|
+
editor = await app.openEditor('sample.ipynb', TheiaNotebookEditor);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test.afterAll(async () => {
|
|
42
|
+
await app.page.close();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test.afterEach(async () => {
|
|
46
|
+
if (editor) {
|
|
47
|
+
await editor.closeWithoutSave();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('kernels are installed', async () => {
|
|
52
|
+
const kernels = await editor.availableKernels();
|
|
53
|
+
const msg = `Available kernels:\n ${kernels.join('\n')}`;
|
|
54
|
+
console.log(msg); // Print available kernels, useful when running in CI.
|
|
55
|
+
expect(kernels.length, msg).toBeGreaterThan(0);
|
|
56
|
+
|
|
57
|
+
const py3kernel = kernels.filter(kernel => kernel.match(new RegExp(`^${preferredKernel}`)));
|
|
58
|
+
expect(py3kernel.length, msg).toBeGreaterThan(0);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('should select a kernel', async () => {
|
|
62
|
+
await editor.selectKernel(preferredKernel);
|
|
63
|
+
const selectedKernel = await editor.selectedKernel();
|
|
64
|
+
expect(selectedKernel).toMatch(new RegExp(`^${preferredKernel}`));
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('should add a new code cell', async () => {
|
|
68
|
+
await editor.addCodeCell();
|
|
69
|
+
const cells = await editor.cells();
|
|
70
|
+
expect(cells.length).toBe(2);
|
|
71
|
+
expect(await cells[1].mode()).toBe('python');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('should add a new markdown cell', async () => {
|
|
75
|
+
await editor.addMarkdownCell();
|
|
76
|
+
await (await editor.cells())[1].addEditorText('print("markdown")');
|
|
77
|
+
|
|
78
|
+
const cells = await editor.cells();
|
|
79
|
+
expect(cells.length).toBe(2);
|
|
80
|
+
expect(await cells[1].mode()).toBe('markdown');
|
|
81
|
+
expect(await cells[1].editorText()).toBe('print("markdown")');
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test('should execute all cells', async () => {
|
|
85
|
+
const cell = await firstCell(editor);
|
|
86
|
+
await cell.addEditorText('print("Hallo Notebook!")');
|
|
87
|
+
|
|
88
|
+
await editor.addCodeCell();
|
|
89
|
+
const secondCell = (await editor.cells())[1];
|
|
90
|
+
await secondCell.addEditorText('print("Bye Notebook!")');
|
|
91
|
+
|
|
92
|
+
await editor.executeAllCells();
|
|
93
|
+
|
|
94
|
+
expect(await cell.outputText()).toBe('Hallo Notebook!');
|
|
95
|
+
expect(await secondCell.outputText()).toBe('Bye Notebook!');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test('should split cell', async () => {
|
|
99
|
+
const cell = await firstCell(editor);
|
|
100
|
+
/*
|
|
101
|
+
Add cell text:
|
|
102
|
+
print("Line-1")
|
|
103
|
+
print("Line-2")
|
|
104
|
+
*/
|
|
105
|
+
await cell.addEditorText('print("Line-1")\nprint("Line-2")');
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
Set cursor:
|
|
109
|
+
print("Line-1")
|
|
110
|
+
<|>print("Line-2")
|
|
111
|
+
*/
|
|
112
|
+
const line = await cell.editor.lineByLineNumber(1);
|
|
113
|
+
await line?.waitForElementState('visible');
|
|
114
|
+
await line?.click();
|
|
115
|
+
await line?.press('ArrowRight');
|
|
116
|
+
|
|
117
|
+
// split cell
|
|
118
|
+
await cell.splitCell();
|
|
119
|
+
|
|
120
|
+
// expect two cells with text "print("Line-1")" and "print("Line-2")"
|
|
121
|
+
expect(await editor.cells()).toHaveLength(2);
|
|
122
|
+
expect(await (await editor.cells())[0].editorText()).toBe('print("Line-1")');
|
|
123
|
+
expect(await (await editor.cells())[1].editorText()).toBe('print("Line-2")');
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test.describe('Theia Notebook Cell interaction', () => {
|
|
128
|
+
|
|
129
|
+
let app: TheiaApp;
|
|
130
|
+
let editor: TheiaNotebookEditor;
|
|
131
|
+
|
|
132
|
+
test.beforeAll(async ({ playwright, browser }) => {
|
|
133
|
+
app = await loadApp({ playwright, browser });
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test.afterAll(async () => {
|
|
137
|
+
await app.page.close();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test.beforeEach(async () => {
|
|
141
|
+
editor = await app.openEditor('sample.ipynb', TheiaNotebookEditor);
|
|
142
|
+
const selectedKernel = await editor.selectedKernel();
|
|
143
|
+
if (selectedKernel?.match(new RegExp(`^${preferredKernel}`)) === null) {
|
|
144
|
+
await editor.selectKernel(preferredKernel);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test.afterEach(async () => {
|
|
149
|
+
if (editor) {
|
|
150
|
+
await editor.closeWithoutSave();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test('should write text in a code cell', async () => {
|
|
155
|
+
const cell = await firstCell(editor);
|
|
156
|
+
// assume the first cell is a code cell
|
|
157
|
+
expect(await cell.isCodeCell()).toBe(true);
|
|
158
|
+
|
|
159
|
+
await cell.addEditorText('print("Hallo")');
|
|
160
|
+
const cellText = await cell.editorText();
|
|
161
|
+
expect(cellText).toBe('print("Hallo")');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
test('should write multi-line text in a code cell', async () => {
|
|
165
|
+
const cell = await firstCell(editor);
|
|
166
|
+
await cell.addEditorText('print("Hallo")\nprint("Notebook")');
|
|
167
|
+
|
|
168
|
+
const cellText = await cell.editorText();
|
|
169
|
+
expect(cellText).toBe('print("Hallo")\nprint("Notebook")');
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
test('Execute code cell and read output', async () => {
|
|
173
|
+
const cell = await firstCell(editor);
|
|
174
|
+
await cell.addEditorText('print("Hallo Notebook!")');
|
|
175
|
+
await cell.execute();
|
|
176
|
+
|
|
177
|
+
const cellOutput = await cell.outputText();
|
|
178
|
+
expect(cellOutput).toBe('Hallo Notebook!');
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
test('Check execution count matches', async () => {
|
|
182
|
+
const cell = await firstCell(editor);
|
|
183
|
+
await cell.addEditorText('print("Hallo Notebook!")');
|
|
184
|
+
await cell.execute();
|
|
185
|
+
await cell.execute();
|
|
186
|
+
await cell.execute();
|
|
187
|
+
|
|
188
|
+
expect(await cell.executionCount()).toBe('3');
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test('Check arrow up and down works', async () => {
|
|
192
|
+
const cell = await firstCell(editor);
|
|
193
|
+
await editor.addCodeCell();
|
|
194
|
+
const secondCell = (await editor.cells())[1];
|
|
195
|
+
// second cell is selected after creation
|
|
196
|
+
expect(await secondCell.isSelected()).toBe(true);
|
|
197
|
+
// select cell above
|
|
198
|
+
await editor.page.keyboard.type('second cell');
|
|
199
|
+
await secondCell.editor.page.keyboard.press('ArrowUp');
|
|
200
|
+
expect(await cell.isSelected()).toBe(true);
|
|
201
|
+
|
|
202
|
+
// select cell below
|
|
203
|
+
await cell.app.page.keyboard.press('ArrowDown');
|
|
204
|
+
expect(await secondCell.isSelected()).toBe(true);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
test('Check k(up)/j(down) selection works', async () => {
|
|
208
|
+
const cell = await firstCell(editor);
|
|
209
|
+
await editor.addCodeCell();
|
|
210
|
+
const secondCell = (await editor.cells())[1];
|
|
211
|
+
// second cell is selected after creation
|
|
212
|
+
expect(await secondCell.isSelected()).toBe(true);
|
|
213
|
+
await secondCell.selectCell(); // deselect editor focus
|
|
214
|
+
|
|
215
|
+
// select cell above
|
|
216
|
+
await secondCell.editor.page.keyboard.press('k');
|
|
217
|
+
expect(await cell.isSelected()).toBe(true);
|
|
218
|
+
|
|
219
|
+
// select cell below
|
|
220
|
+
await cell.app.page.keyboard.press('j');
|
|
221
|
+
expect(await secondCell.isSelected()).toBe(true);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test('Check x/c/v works', async () => {
|
|
225
|
+
const cell = await firstCell(editor);
|
|
226
|
+
await cell.addEditorText('print("First cell")');
|
|
227
|
+
await editor.addCodeCell();
|
|
228
|
+
const secondCell = (await editor.cells())[1];
|
|
229
|
+
await secondCell.addEditorText('print("Second cell")');
|
|
230
|
+
await secondCell.selectCell(); // deselect editor focus
|
|
231
|
+
|
|
232
|
+
// cut second cell
|
|
233
|
+
await secondCell.page.keyboard.press('x');
|
|
234
|
+
await editor.waitForCellCountChanged(2);
|
|
235
|
+
expect((await editor.cells()).length).toBe(1);
|
|
236
|
+
|
|
237
|
+
// paste second cell
|
|
238
|
+
await cell.selectCell();
|
|
239
|
+
await cell.page.keyboard.press('v');
|
|
240
|
+
await editor.waitForCellCountChanged(1);
|
|
241
|
+
expect((await editor.cells()).length).toBe(2);
|
|
242
|
+
const pastedCell = (await editor.cells())[1];
|
|
243
|
+
expect(await pastedCell.isSelected()).toBe(true);
|
|
244
|
+
|
|
245
|
+
// copy first cell
|
|
246
|
+
await cell.selectCell(); // deselect editor focus
|
|
247
|
+
await cell.page.keyboard.press('c');
|
|
248
|
+
// paste copied cell
|
|
249
|
+
await cell.page.keyboard.press('v');
|
|
250
|
+
await editor.waitForCellCountChanged(2);
|
|
251
|
+
expect((await editor.cells()).length).toBe(3);
|
|
252
|
+
expect(await (await editor.cells())[0].editorText()).toBe('print("First cell")');
|
|
253
|
+
expect(await (await editor.cells())[1].editorText()).toBe('print("First cell")');
|
|
254
|
+
expect(await (await editor.cells())[2].editorText()).toBe('print("Second cell")');
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
test('Check LineNumber switch `l` works', async () => {
|
|
258
|
+
const cell = await firstCell(editor);
|
|
259
|
+
await cell.addEditorText('print("First cell")');
|
|
260
|
+
await cell.selectCell();
|
|
261
|
+
await cell.page.keyboard.press('l');
|
|
262
|
+
// NOTE: div.line-numbers is not visible
|
|
263
|
+
await cell.editor.locator.locator('.overflow-guard > div.line-numbers').waitFor({ state: 'attached' });
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
test('Check Collapse output switch `o` works', async () => {
|
|
267
|
+
const cell = await firstCell(editor);
|
|
268
|
+
await cell.addEditorText('print("Check output collapse")');
|
|
269
|
+
await cell.selectCell();
|
|
270
|
+
await cell.execute(); // produce output
|
|
271
|
+
expect(await cell.outputText()).toBe('Check output collapse');
|
|
272
|
+
|
|
273
|
+
await cell.page.keyboard.press('o');
|
|
274
|
+
await (await cell.outputContainer()).waitFor({ state: 'hidden' });
|
|
275
|
+
await cell.page.keyboard.press('o');
|
|
276
|
+
await (await cell.outputContainer()).waitFor({ state: 'visible' });
|
|
277
|
+
|
|
278
|
+
expect(await cell.outputText()).toBe('Check output collapse');
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
test('Check arrow-up/arrow-down/escape with code completion', async () => {
|
|
282
|
+
await editor.addMarkdownCell();
|
|
283
|
+
const mdCell = (await editor.cells())[1];
|
|
284
|
+
await mdCell.addEditorText('h');
|
|
285
|
+
|
|
286
|
+
await editor.page.keyboard.press('Control+Space'); // call CC (suggestWidgetVisible=true)
|
|
287
|
+
await ensureCodeCompletionVisible(mdCell.editor.locator);
|
|
288
|
+
await editor.page.keyboard.press('Escape'); // close CC
|
|
289
|
+
// check the same cell still selected and not lose the edit mode
|
|
290
|
+
expect(await mdCell.editor.isFocused()).toBe(true);
|
|
291
|
+
|
|
292
|
+
await editor.page.keyboard.press('Control+Space'); // call CC (suggestWidgetVisible=true)
|
|
293
|
+
await ensureCodeCompletionVisible(mdCell.editor.locator);
|
|
294
|
+
await editor.page.keyboard.press('ArrowUp'); // select next entry in CC list
|
|
295
|
+
await editor.page.keyboard.press('Enter'); // apply completion
|
|
296
|
+
// check the same cell still selected and not the second one due to 'ArrowDown' being pressed
|
|
297
|
+
expect(await mdCell.isSelected()).toBe(true);
|
|
298
|
+
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
async function ensureCodeCompletionVisible(parent: Locator): Promise<void> {
|
|
303
|
+
await parent.locator('div.monaco-editor div.suggest-widget').waitFor({ timeout: 5000 });
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
async function firstCell(editor: TheiaNotebookEditor): Promise<TheiaNotebookCell> {
|
|
307
|
+
return (await editor.cells())[0];
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
async function loadApp(args: TheiaPlaywrightTestConfig & PlaywrightWorkerArgs): Promise<TheiaApp> {
|
|
311
|
+
const workingDir = path.resolve();
|
|
312
|
+
// correct WS path. When running from IDE the path is playwright/configs with CLI it's playwright/
|
|
313
|
+
const prefix = workingDir.endsWith('playwright/configs') ? '../' : '';
|
|
314
|
+
const ws = new TheiaWorkspace([prefix + 'src/tests/resources/notebook-files']);
|
|
315
|
+
const app = await TheiaAppLoader.load(args, ws);
|
|
316
|
+
// auto-save are disabled using settings.json file
|
|
317
|
+
// see examples/playwright/src/tests/resources/notebook-files/.theia/settings.json
|
|
318
|
+
|
|
319
|
+
// NOTE: Workspace trust is disabled in examples/browser/package.json using default preferences.
|
|
320
|
+
// If workspace trust check is on, python extension will not be able to explore Python installations.
|
|
321
|
+
return app;
|
|
322
|
+
}
|
|
@@ -77,4 +77,10 @@ test.describe('Theia Quick Command', () => {
|
|
|
77
77
|
expect(await notification.isEntryVisible('Positive Integer: 6')).toBe(true);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
+
test('retrieve and check visible items', async () => {
|
|
81
|
+
await quickCommand.type('close all tabs', false);
|
|
82
|
+
const listItems = await Promise.all((await quickCommand.visibleItems()).map(async item => item.textContent()));
|
|
83
|
+
expect(listItems).toContain('View: Close All Tabs in Main Area');
|
|
84
|
+
});
|
|
85
|
+
|
|
80
86
|
});
|
|
@@ -27,7 +27,7 @@ export class TheiaMonacoEditor extends TheiaPageObject {
|
|
|
27
27
|
await this.page.waitForSelector(this.selector, { state: 'visible' });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
protected viewElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
|
|
30
|
+
protected async viewElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
|
|
31
31
|
return this.page.$(this.selector);
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -74,6 +74,49 @@ export class TheiaMonacoEditor extends TheiaPageObject {
|
|
|
74
74
|
return viewElement?.waitForSelector(`.view-lines .view-line:has-text("${text}")`);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* @returns The text content of the editor.
|
|
79
|
+
*/
|
|
80
|
+
async editorText(): Promise<string | undefined> {
|
|
81
|
+
const lines: string[] = [];
|
|
82
|
+
const linesCount = await this.numberOfLines();
|
|
83
|
+
if (linesCount === undefined) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
for (let line = 1; line <= linesCount; line++) {
|
|
87
|
+
const lineText = await this.textContentOfLineByLineNumber(line);
|
|
88
|
+
if (lineText === undefined) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
lines.push(lineText);
|
|
92
|
+
}
|
|
93
|
+
return lines.join('\n');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Adds text to the editor.
|
|
98
|
+
* @param text The text to add to the editor.
|
|
99
|
+
* @param lineNumber The line number where to add the text. Default is 1.
|
|
100
|
+
*/
|
|
101
|
+
async addEditorText(text: string, lineNumber: number = 1): Promise<void> {
|
|
102
|
+
const line = await this.lineByLineNumber(lineNumber);
|
|
103
|
+
await line?.click();
|
|
104
|
+
await this.page.keyboard.type(text);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @returns `true` if the editor is focused, `false` otherwise.
|
|
109
|
+
*/
|
|
110
|
+
async isFocused(): Promise<boolean> {
|
|
111
|
+
const viewElement = await this.viewElement();
|
|
112
|
+
const monacoEditor = await viewElement?.$('div.monaco-editor');
|
|
113
|
+
if (!monacoEditor) {
|
|
114
|
+
throw new Error('Couldn\'t retrieve monaco editor element.');
|
|
115
|
+
}
|
|
116
|
+
const editorClass = await monacoEditor.getAttribute('class');
|
|
117
|
+
return editorClass?.includes('focused') ?? false;
|
|
118
|
+
}
|
|
119
|
+
|
|
77
120
|
protected replaceEditorSymbolsWithSpace(content: string): string | Promise<string | undefined> {
|
|
78
121
|
// [ ] => \u00a0 -- NO-BREAK SPACE
|
|
79
122
|
// [·] · => \u00b7 -- MIDDLE DOT
|