@theia/playwright 1.34.2 → 1.34.3
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/LICENSE +641 -641
- package/README.md +54 -54
- package/lib/index.d.ts +25 -25
- package/lib/index.js +52 -52
- package/lib/tests/fixtures/theia-fixture.d.ts +3 -3
- package/lib/tests/fixtures/theia-fixture.js +23 -23
- package/lib/tests/theia-app.test.d.ts +1 -1
- package/lib/tests/theia-app.test.js +29 -29
- package/lib/tests/theia-explorer-view.test.d.ts +1 -1
- package/lib/tests/theia-explorer-view.test.js +109 -109
- package/lib/tests/theia-main-menu.test.d.ts +1 -1
- package/lib/tests/theia-main-menu.test.js +73 -73
- package/lib/tests/theia-preference-view.test.d.ts +1 -1
- package/lib/tests/theia-preference-view.test.js +99 -99
- package/lib/tests/theia-problems-view.test.d.ts +1 -1
- package/lib/tests/theia-problems-view.test.js +52 -52
- package/lib/tests/theia-quick-command.test.d.ts +1 -1
- package/lib/tests/theia-quick-command.test.js +53 -53
- package/lib/tests/theia-sample-app.test.d.ts +1 -1
- package/lib/tests/theia-sample-app.test.js +80 -80
- package/lib/tests/theia-status-bar.test.d.ts +1 -1
- package/lib/tests/theia-status-bar.test.js +41 -41
- package/lib/tests/theia-text-editor.test.d.ts +1 -1
- package/lib/tests/theia-text-editor.test.js +152 -152
- package/lib/tests/theia-workspace.test.d.ts +1 -1
- package/lib/tests/theia-workspace.test.js +47 -47
- package/lib/theia-about-dialog.d.ts +4 -4
- package/lib/theia-about-dialog.js +26 -26
- package/lib/theia-app.d.ts +43 -43
- package/lib/theia-app.js +135 -135
- package/lib/theia-context-menu.d.ts +8 -8
- package/lib/theia-context-menu.js +37 -37
- package/lib/theia-dialog.d.ts +27 -27
- package/lib/theia-dialog.js +98 -98
- package/lib/theia-editor.d.ts +9 -9
- package/lib/theia-editor.js +68 -68
- package/lib/theia-explorer-view.d.ts +38 -38
- package/lib/theia-explorer-view.js +209 -209
- package/lib/theia-main-menu.d.ts +12 -12
- package/lib/theia-main-menu.js +53 -53
- package/lib/theia-menu-item.d.ts +14 -14
- package/lib/theia-menu-item.js +66 -66
- package/lib/theia-menu.d.ts +16 -16
- package/lib/theia-menu.js +86 -86
- package/lib/theia-notification-indicator.d.ts +7 -7
- package/lib/theia-notification-indicator.js +44 -44
- package/lib/theia-notification-overlay.d.ts +22 -22
- package/lib/theia-notification-overlay.js +79 -79
- package/lib/theia-page-object.d.ts +7 -7
- package/lib/theia-page-object.js +27 -27
- package/lib/theia-preference-view.d.ts +76 -76
- package/lib/theia-preference-view.js +201 -201
- package/lib/theia-problem-indicator.d.ts +8 -8
- package/lib/theia-problem-indicator.js +38 -38
- package/lib/theia-problem-view.d.ts +5 -5
- package/lib/theia-problem-view.js +30 -30
- package/lib/theia-quick-command-palette.d.ts +11 -11
- package/lib/theia-quick-command-palette.js +73 -73
- package/lib/theia-rename-dialog.d.ts +5 -5
- package/lib/theia-rename-dialog.js +35 -35
- package/lib/theia-status-bar.d.ts +13 -13
- package/lib/theia-status-bar.js +39 -39
- package/lib/theia-status-indicator.d.ts +10 -10
- package/lib/theia-status-indicator.js +48 -48
- package/lib/theia-text-editor.d.ts +27 -27
- package/lib/theia-text-editor.js +149 -149
- package/lib/theia-toggle-bottom-indicator.d.ts +4 -4
- package/lib/theia-toggle-bottom-indicator.js +26 -26
- package/lib/theia-tree-node.d.ts +16 -16
- package/lib/theia-tree-node.js +53 -53
- package/lib/theia-view.d.ts +32 -32
- package/lib/theia-view.js +151 -151
- package/lib/theia-workspace.d.ts +18 -18
- package/lib/theia-workspace.js +69 -69
- package/lib/util.d.ts +19 -19
- package/lib/util.js +93 -93
- package/package.json +2 -2
- package/src/index.ts +41 -41
- package/src/tests/fixtures/theia-fixture.ts +25 -25
- package/src/tests/resources/sample-files1/sample.txt +4 -4
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder1/sampleFolder1-1/sampleFile1-1-1.txt +1 -1
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder1/sampleFolder1-1/sampleFile1-1-2.txt +1 -1
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder1/sampleFolder1-2/sampleFile1-2-1.txt +1 -1
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder1/sampleFolder1-2/sampleFile1-2-2.txt +1 -1
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder2/sampleFolder2-1/sampleFile2-1-1.txt +1 -1
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder2/sampleFolder2-1/sampleFile2-1-2.txt +1 -1
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder2/sampleFolder2-2/sampleFile2-2-1.txt +1 -1
- package/src/tests/resources/sample-files1/sampleFolder/sampleFolder2/sampleFolder2-2/sampleFile2-2-2.txt +1 -1
- package/src/tests/resources/sample-files2/another-sample.txt +1 -1
- package/src/tests/theia-app.test.ts +34 -34
- package/src/tests/theia-explorer-view.test.ts +124 -124
- package/src/tests/theia-main-menu.test.ts +89 -89
- package/src/tests/theia-preference-view.test.ts +118 -118
- package/src/tests/theia-problems-view.test.ts +60 -60
- package/src/tests/theia-quick-command.test.ts +61 -61
- package/src/tests/theia-sample-app.test.ts +92 -92
- package/src/tests/theia-status-bar.test.ts +47 -47
- package/src/tests/theia-text-editor.test.ts +182 -182
- package/src/tests/theia-workspace.test.ts +51 -51
- package/src/theia-about-dialog.ts +26 -26
- package/src/theia-app.ts +154 -154
- package/src/theia-context-menu.ts +42 -42
- package/src/theia-dialog.ts +113 -113
- package/src/theia-editor.ts +73 -73
- package/src/theia-explorer-view.ts +234 -234
- package/src/theia-main-menu.ts +54 -54
- package/src/theia-menu-item.ts +75 -75
- package/src/theia-menu.ts +96 -96
- package/src/theia-notification-indicator.ts +44 -44
- package/src/theia-notification-overlay.ts +94 -94
- package/src/theia-page-object.ts +29 -29
- package/src/theia-preference-view.ts +232 -232
- package/src/theia-problem-indicator.ts +37 -37
- package/src/theia-problem-view.ts +30 -30
- package/src/theia-quick-command-palette.ts +75 -75
- package/src/theia-rename-dialog.ts +36 -36
- package/src/theia-status-bar.ts +44 -44
- package/src/theia-status-indicator.ts +50 -50
- package/src/theia-text-editor.ts +172 -172
- package/src/theia-toggle-bottom-indicator.ts +21 -21
- package/src/theia-tree-node.ts +60 -60
- package/src/theia-view.ts +178 -178
- package/src/theia-workspace.ts +76 -76
- package/src/util.ts +91 -91
package/lib/theia-text-editor.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.TheiaTextEditor = void 0;
|
|
19
|
-
const path_1 = require("path");
|
|
20
|
-
const theia_editor_1 = require("./theia-editor");
|
|
21
|
-
const util_1 = require("./util");
|
|
22
|
-
class TheiaTextEditor extends theia_editor_1.TheiaEditor {
|
|
23
|
-
constructor(filePath, app) {
|
|
24
|
-
// shell-tab-code-editor-opener:file:///c%3A/Users/user/AppData/Local/Temp/cloud-ws-JBUhb6/sample.txt:1
|
|
25
|
-
// code-editor-opener:file:///c%3A/Users/user/AppData/Local/Temp/cloud-ws-JBUhb6/sample.txt:1
|
|
26
|
-
super({
|
|
27
|
-
tabSelector: (0, util_1.normalizeId)(`#shell-tab-code-editor-opener:file://${(0, util_1.urlEncodePath)((0, path_1.join)(app.workspace.escapedPath, util_1.OSUtil.fileSeparator, filePath))}:1`),
|
|
28
|
-
viewSelector: (0, util_1.normalizeId)(`#code-editor-opener:file://${(0, util_1.urlEncodePath)((0, path_1.join)(app.workspace.escapedPath, util_1.OSUtil.fileSeparator, filePath))}:1`) + '.theia-editor'
|
|
29
|
-
}, app);
|
|
30
|
-
}
|
|
31
|
-
async numberOfLines() {
|
|
32
|
-
await this.activate();
|
|
33
|
-
const viewElement = await this.viewElement();
|
|
34
|
-
const lineElements = await (viewElement === null || viewElement === void 0 ? void 0 : viewElement.$$('.view-lines .view-line'));
|
|
35
|
-
return lineElements === null || lineElements === void 0 ? void 0 : lineElements.length;
|
|
36
|
-
}
|
|
37
|
-
async textContentOfLineByLineNumber(lineNumber) {
|
|
38
|
-
const lineElement = await this.lineByLineNumber(lineNumber);
|
|
39
|
-
const content = await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.textContent());
|
|
40
|
-
return content ? this.replaceEditorSymbolsWithSpace(content) : undefined;
|
|
41
|
-
}
|
|
42
|
-
async replaceLineWithLineNumber(text, lineNumber) {
|
|
43
|
-
await this.selectLineWithLineNumber(lineNumber);
|
|
44
|
-
await this.typeTextAndHitEnter(text);
|
|
45
|
-
}
|
|
46
|
-
async typeTextAndHitEnter(text) {
|
|
47
|
-
await this.page.keyboard.type(text);
|
|
48
|
-
await this.page.keyboard.press('Enter');
|
|
49
|
-
}
|
|
50
|
-
async selectLineWithLineNumber(lineNumber) {
|
|
51
|
-
await this.activate();
|
|
52
|
-
const lineElement = await this.lineByLineNumber(lineNumber);
|
|
53
|
-
await this.selectLine(lineElement);
|
|
54
|
-
return lineElement;
|
|
55
|
-
}
|
|
56
|
-
async placeCursorInLineWithLineNumber(lineNumber) {
|
|
57
|
-
await this.activate();
|
|
58
|
-
const lineElement = await this.lineByLineNumber(lineNumber);
|
|
59
|
-
await this.placeCursorInLine(lineElement);
|
|
60
|
-
return lineElement;
|
|
61
|
-
}
|
|
62
|
-
async deleteLineByLineNumber(lineNumber) {
|
|
63
|
-
await this.selectLineWithLineNumber(lineNumber);
|
|
64
|
-
await this.page.keyboard.press('Backspace');
|
|
65
|
-
}
|
|
66
|
-
async lineByLineNumber(lineNumber) {
|
|
67
|
-
await this.activate();
|
|
68
|
-
const viewElement = await this.viewElement();
|
|
69
|
-
const lines = await (viewElement === null || viewElement === void 0 ? void 0 : viewElement.$$('.view-lines .view-line'));
|
|
70
|
-
if (!lines) {
|
|
71
|
-
throw new Error(`Couldn't retrieve lines of text editor ${this.tabSelector}`);
|
|
72
|
-
}
|
|
73
|
-
const linesWithXCoordinates = [];
|
|
74
|
-
for (const lineElement of lines) {
|
|
75
|
-
const box = await lineElement.boundingBox();
|
|
76
|
-
linesWithXCoordinates.push({ x: box ? box.x : Number.MAX_VALUE, lineElement });
|
|
77
|
-
}
|
|
78
|
-
linesWithXCoordinates.sort((a, b) => a.x.toString().localeCompare(b.x.toString()));
|
|
79
|
-
return linesWithXCoordinates[lineNumber - 1].lineElement;
|
|
80
|
-
}
|
|
81
|
-
async textContentOfLineContainingText(text) {
|
|
82
|
-
await this.activate();
|
|
83
|
-
const lineElement = await this.lineContainingText(text);
|
|
84
|
-
const content = await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.textContent());
|
|
85
|
-
return content ? this.replaceEditorSymbolsWithSpace(content) : undefined;
|
|
86
|
-
}
|
|
87
|
-
async replaceLineContainingText(newText, oldText) {
|
|
88
|
-
await this.selectLineContainingText(oldText);
|
|
89
|
-
await this.typeTextAndHitEnter(newText);
|
|
90
|
-
}
|
|
91
|
-
async selectLineContainingText(text) {
|
|
92
|
-
await this.activate();
|
|
93
|
-
const lineElement = await this.lineContainingText(text);
|
|
94
|
-
await this.selectLine(lineElement);
|
|
95
|
-
return lineElement;
|
|
96
|
-
}
|
|
97
|
-
async placeCursorInLineContainingText(text) {
|
|
98
|
-
await this.activate();
|
|
99
|
-
const lineElement = await this.lineContainingText(text);
|
|
100
|
-
await this.placeCursorInLine(lineElement);
|
|
101
|
-
return lineElement;
|
|
102
|
-
}
|
|
103
|
-
async deleteLineContainingText(text) {
|
|
104
|
-
await this.selectLineContainingText(text);
|
|
105
|
-
await this.page.keyboard.press('Backspace');
|
|
106
|
-
}
|
|
107
|
-
async addTextToNewLineAfterLineContainingText(textContainedByExistingLine, newText) {
|
|
108
|
-
const existingLine = await this.lineContainingText(textContainedByExistingLine);
|
|
109
|
-
await this.placeCursorInLine(existingLine);
|
|
110
|
-
await this.page.keyboard.press('End');
|
|
111
|
-
await this.page.keyboard.press('Enter');
|
|
112
|
-
await this.page.keyboard.type(newText);
|
|
113
|
-
}
|
|
114
|
-
async addTextToNewLineAfterLineByLineNumber(lineNumber, newText) {
|
|
115
|
-
const existingLine = await this.lineByLineNumber(lineNumber);
|
|
116
|
-
await this.placeCursorInLine(existingLine);
|
|
117
|
-
await this.page.keyboard.press('End');
|
|
118
|
-
await this.page.keyboard.press('Enter');
|
|
119
|
-
await this.page.keyboard.type(newText);
|
|
120
|
-
}
|
|
121
|
-
async lineContainingText(text) {
|
|
122
|
-
const viewElement = await this.viewElement();
|
|
123
|
-
return viewElement === null || viewElement === void 0 ? void 0 : viewElement.waitForSelector(`.view-lines .view-line:has-text("${text}")`);
|
|
124
|
-
}
|
|
125
|
-
async selectLine(lineElement) {
|
|
126
|
-
await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.click({ clickCount: 3 }));
|
|
127
|
-
}
|
|
128
|
-
async placeCursorInLine(lineElement) {
|
|
129
|
-
await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.click());
|
|
130
|
-
}
|
|
131
|
-
replaceEditorSymbolsWithSpace(content) {
|
|
132
|
-
// [ ] => \u00a0 -- NO-BREAK SPACE
|
|
133
|
-
// [·] · => \u00b7 -- MIDDLE DOT
|
|
134
|
-
// [] ‌ => \u200c -- ZERO WIDTH NON-JOINER
|
|
135
|
-
return content.replace(/[\u00a0\u00b7]/g, ' ').replace(/[\u200c]/g, '');
|
|
136
|
-
}
|
|
137
|
-
async selectedSuggestion() {
|
|
138
|
-
return this.page.waitForSelector(this.viewSelector + ' .monaco-list-row.show-file-icons.focused');
|
|
139
|
-
}
|
|
140
|
-
async getSelectedSuggestionText() {
|
|
141
|
-
const suggestion = await this.selectedSuggestion();
|
|
142
|
-
const text = await suggestion.textContent();
|
|
143
|
-
if (text === null) {
|
|
144
|
-
throw new Error('Text content could not be found');
|
|
145
|
-
}
|
|
146
|
-
return text;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
exports.TheiaTextEditor = TheiaTextEditor;
|
|
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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TheiaTextEditor = void 0;
|
|
19
|
+
const path_1 = require("path");
|
|
20
|
+
const theia_editor_1 = require("./theia-editor");
|
|
21
|
+
const util_1 = require("./util");
|
|
22
|
+
class TheiaTextEditor extends theia_editor_1.TheiaEditor {
|
|
23
|
+
constructor(filePath, app) {
|
|
24
|
+
// shell-tab-code-editor-opener:file:///c%3A/Users/user/AppData/Local/Temp/cloud-ws-JBUhb6/sample.txt:1
|
|
25
|
+
// code-editor-opener:file:///c%3A/Users/user/AppData/Local/Temp/cloud-ws-JBUhb6/sample.txt:1
|
|
26
|
+
super({
|
|
27
|
+
tabSelector: (0, util_1.normalizeId)(`#shell-tab-code-editor-opener:file://${(0, util_1.urlEncodePath)((0, path_1.join)(app.workspace.escapedPath, util_1.OSUtil.fileSeparator, filePath))}:1`),
|
|
28
|
+
viewSelector: (0, util_1.normalizeId)(`#code-editor-opener:file://${(0, util_1.urlEncodePath)((0, path_1.join)(app.workspace.escapedPath, util_1.OSUtil.fileSeparator, filePath))}:1`) + '.theia-editor'
|
|
29
|
+
}, app);
|
|
30
|
+
}
|
|
31
|
+
async numberOfLines() {
|
|
32
|
+
await this.activate();
|
|
33
|
+
const viewElement = await this.viewElement();
|
|
34
|
+
const lineElements = await (viewElement === null || viewElement === void 0 ? void 0 : viewElement.$$('.view-lines .view-line'));
|
|
35
|
+
return lineElements === null || lineElements === void 0 ? void 0 : lineElements.length;
|
|
36
|
+
}
|
|
37
|
+
async textContentOfLineByLineNumber(lineNumber) {
|
|
38
|
+
const lineElement = await this.lineByLineNumber(lineNumber);
|
|
39
|
+
const content = await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.textContent());
|
|
40
|
+
return content ? this.replaceEditorSymbolsWithSpace(content) : undefined;
|
|
41
|
+
}
|
|
42
|
+
async replaceLineWithLineNumber(text, lineNumber) {
|
|
43
|
+
await this.selectLineWithLineNumber(lineNumber);
|
|
44
|
+
await this.typeTextAndHitEnter(text);
|
|
45
|
+
}
|
|
46
|
+
async typeTextAndHitEnter(text) {
|
|
47
|
+
await this.page.keyboard.type(text);
|
|
48
|
+
await this.page.keyboard.press('Enter');
|
|
49
|
+
}
|
|
50
|
+
async selectLineWithLineNumber(lineNumber) {
|
|
51
|
+
await this.activate();
|
|
52
|
+
const lineElement = await this.lineByLineNumber(lineNumber);
|
|
53
|
+
await this.selectLine(lineElement);
|
|
54
|
+
return lineElement;
|
|
55
|
+
}
|
|
56
|
+
async placeCursorInLineWithLineNumber(lineNumber) {
|
|
57
|
+
await this.activate();
|
|
58
|
+
const lineElement = await this.lineByLineNumber(lineNumber);
|
|
59
|
+
await this.placeCursorInLine(lineElement);
|
|
60
|
+
return lineElement;
|
|
61
|
+
}
|
|
62
|
+
async deleteLineByLineNumber(lineNumber) {
|
|
63
|
+
await this.selectLineWithLineNumber(lineNumber);
|
|
64
|
+
await this.page.keyboard.press('Backspace');
|
|
65
|
+
}
|
|
66
|
+
async lineByLineNumber(lineNumber) {
|
|
67
|
+
await this.activate();
|
|
68
|
+
const viewElement = await this.viewElement();
|
|
69
|
+
const lines = await (viewElement === null || viewElement === void 0 ? void 0 : viewElement.$$('.view-lines .view-line'));
|
|
70
|
+
if (!lines) {
|
|
71
|
+
throw new Error(`Couldn't retrieve lines of text editor ${this.tabSelector}`);
|
|
72
|
+
}
|
|
73
|
+
const linesWithXCoordinates = [];
|
|
74
|
+
for (const lineElement of lines) {
|
|
75
|
+
const box = await lineElement.boundingBox();
|
|
76
|
+
linesWithXCoordinates.push({ x: box ? box.x : Number.MAX_VALUE, lineElement });
|
|
77
|
+
}
|
|
78
|
+
linesWithXCoordinates.sort((a, b) => a.x.toString().localeCompare(b.x.toString()));
|
|
79
|
+
return linesWithXCoordinates[lineNumber - 1].lineElement;
|
|
80
|
+
}
|
|
81
|
+
async textContentOfLineContainingText(text) {
|
|
82
|
+
await this.activate();
|
|
83
|
+
const lineElement = await this.lineContainingText(text);
|
|
84
|
+
const content = await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.textContent());
|
|
85
|
+
return content ? this.replaceEditorSymbolsWithSpace(content) : undefined;
|
|
86
|
+
}
|
|
87
|
+
async replaceLineContainingText(newText, oldText) {
|
|
88
|
+
await this.selectLineContainingText(oldText);
|
|
89
|
+
await this.typeTextAndHitEnter(newText);
|
|
90
|
+
}
|
|
91
|
+
async selectLineContainingText(text) {
|
|
92
|
+
await this.activate();
|
|
93
|
+
const lineElement = await this.lineContainingText(text);
|
|
94
|
+
await this.selectLine(lineElement);
|
|
95
|
+
return lineElement;
|
|
96
|
+
}
|
|
97
|
+
async placeCursorInLineContainingText(text) {
|
|
98
|
+
await this.activate();
|
|
99
|
+
const lineElement = await this.lineContainingText(text);
|
|
100
|
+
await this.placeCursorInLine(lineElement);
|
|
101
|
+
return lineElement;
|
|
102
|
+
}
|
|
103
|
+
async deleteLineContainingText(text) {
|
|
104
|
+
await this.selectLineContainingText(text);
|
|
105
|
+
await this.page.keyboard.press('Backspace');
|
|
106
|
+
}
|
|
107
|
+
async addTextToNewLineAfterLineContainingText(textContainedByExistingLine, newText) {
|
|
108
|
+
const existingLine = await this.lineContainingText(textContainedByExistingLine);
|
|
109
|
+
await this.placeCursorInLine(existingLine);
|
|
110
|
+
await this.page.keyboard.press('End');
|
|
111
|
+
await this.page.keyboard.press('Enter');
|
|
112
|
+
await this.page.keyboard.type(newText);
|
|
113
|
+
}
|
|
114
|
+
async addTextToNewLineAfterLineByLineNumber(lineNumber, newText) {
|
|
115
|
+
const existingLine = await this.lineByLineNumber(lineNumber);
|
|
116
|
+
await this.placeCursorInLine(existingLine);
|
|
117
|
+
await this.page.keyboard.press('End');
|
|
118
|
+
await this.page.keyboard.press('Enter');
|
|
119
|
+
await this.page.keyboard.type(newText);
|
|
120
|
+
}
|
|
121
|
+
async lineContainingText(text) {
|
|
122
|
+
const viewElement = await this.viewElement();
|
|
123
|
+
return viewElement === null || viewElement === void 0 ? void 0 : viewElement.waitForSelector(`.view-lines .view-line:has-text("${text}")`);
|
|
124
|
+
}
|
|
125
|
+
async selectLine(lineElement) {
|
|
126
|
+
await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.click({ clickCount: 3 }));
|
|
127
|
+
}
|
|
128
|
+
async placeCursorInLine(lineElement) {
|
|
129
|
+
await (lineElement === null || lineElement === void 0 ? void 0 : lineElement.click());
|
|
130
|
+
}
|
|
131
|
+
replaceEditorSymbolsWithSpace(content) {
|
|
132
|
+
// [ ] => \u00a0 -- NO-BREAK SPACE
|
|
133
|
+
// [·] · => \u00b7 -- MIDDLE DOT
|
|
134
|
+
// [] ‌ => \u200c -- ZERO WIDTH NON-JOINER
|
|
135
|
+
return content.replace(/[\u00a0\u00b7]/g, ' ').replace(/[\u200c]/g, '');
|
|
136
|
+
}
|
|
137
|
+
async selectedSuggestion() {
|
|
138
|
+
return this.page.waitForSelector(this.viewSelector + ' .monaco-list-row.show-file-icons.focused');
|
|
139
|
+
}
|
|
140
|
+
async getSelectedSuggestionText() {
|
|
141
|
+
const suggestion = await this.selectedSuggestion();
|
|
142
|
+
const text = await suggestion.textContent();
|
|
143
|
+
if (text === null) {
|
|
144
|
+
throw new Error('Text content could not be found');
|
|
145
|
+
}
|
|
146
|
+
return text;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.TheiaTextEditor = TheiaTextEditor;
|
|
150
150
|
//# sourceMappingURL=theia-text-editor.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TheiaStatusIndicator } from './theia-status-indicator';
|
|
2
|
-
export declare class TheiaToggleBottomIndicator extends TheiaStatusIndicator {
|
|
3
|
-
id: string;
|
|
4
|
-
}
|
|
1
|
+
import { TheiaStatusIndicator } from './theia-status-indicator';
|
|
2
|
+
export declare class TheiaToggleBottomIndicator extends TheiaStatusIndicator {
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
5
|
//# sourceMappingURL=theia-toggle-bottom-indicator.d.ts.map
|
|
@@ -1,27 +1,27 @@
|
|
|
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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.TheiaToggleBottomIndicator = void 0;
|
|
19
|
-
const theia_status_indicator_1 = require("./theia-status-indicator");
|
|
20
|
-
class TheiaToggleBottomIndicator extends theia_status_indicator_1.TheiaStatusIndicator {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.id = 'bottom-panel-toggle';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.TheiaToggleBottomIndicator = TheiaToggleBottomIndicator;
|
|
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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TheiaToggleBottomIndicator = void 0;
|
|
19
|
+
const theia_status_indicator_1 = require("./theia-status-indicator");
|
|
20
|
+
class TheiaToggleBottomIndicator extends theia_status_indicator_1.TheiaStatusIndicator {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.id = 'bottom-panel-toggle';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.TheiaToggleBottomIndicator = TheiaToggleBottomIndicator;
|
|
27
27
|
//# sourceMappingURL=theia-toggle-bottom-indicator.js.map
|
package/lib/theia-tree-node.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ElementHandle } from '@playwright/test';
|
|
2
|
-
import { TheiaApp } from './theia-app';
|
|
3
|
-
import { TheiaMenu } from './theia-menu';
|
|
4
|
-
export declare class TheiaTreeNode {
|
|
5
|
-
protected elementHandle: ElementHandle<SVGElement | HTMLElement>;
|
|
6
|
-
protected app: TheiaApp;
|
|
7
|
-
labelElementCssClass: string;
|
|
8
|
-
expansionToggleCssClass: string;
|
|
9
|
-
collapsedCssClass: string;
|
|
10
|
-
constructor(elementHandle: ElementHandle<SVGElement | HTMLElement>, app: TheiaApp);
|
|
11
|
-
label(): Promise<string | null>;
|
|
12
|
-
isCollapsed(): Promise<boolean>;
|
|
13
|
-
isExpandable(): Promise<boolean>;
|
|
14
|
-
expand(): Promise<void>;
|
|
15
|
-
openContextMenu(): Promise<TheiaMenu>;
|
|
16
|
-
}
|
|
1
|
+
import { ElementHandle } from '@playwright/test';
|
|
2
|
+
import { TheiaApp } from './theia-app';
|
|
3
|
+
import { TheiaMenu } from './theia-menu';
|
|
4
|
+
export declare class TheiaTreeNode {
|
|
5
|
+
protected elementHandle: ElementHandle<SVGElement | HTMLElement>;
|
|
6
|
+
protected app: TheiaApp;
|
|
7
|
+
labelElementCssClass: string;
|
|
8
|
+
expansionToggleCssClass: string;
|
|
9
|
+
collapsedCssClass: string;
|
|
10
|
+
constructor(elementHandle: ElementHandle<SVGElement | HTMLElement>, app: TheiaApp);
|
|
11
|
+
label(): Promise<string | null>;
|
|
12
|
+
isCollapsed(): Promise<boolean>;
|
|
13
|
+
isExpandable(): Promise<boolean>;
|
|
14
|
+
expand(): Promise<void>;
|
|
15
|
+
openContextMenu(): Promise<TheiaMenu>;
|
|
16
|
+
}
|
|
17
17
|
//# sourceMappingURL=theia-tree-node.d.ts.map
|
package/lib/theia-tree-node.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
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 WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.TheiaTreeNode = void 0;
|
|
19
|
-
const theia_context_menu_1 = require("./theia-context-menu");
|
|
20
|
-
class TheiaTreeNode {
|
|
21
|
-
constructor(elementHandle, app) {
|
|
22
|
-
this.elementHandle = elementHandle;
|
|
23
|
-
this.app = app;
|
|
24
|
-
this.labelElementCssClass = '.theia-TreeNodeSegmentGrow';
|
|
25
|
-
this.expansionToggleCssClass = '.theia-ExpansionToggle';
|
|
26
|
-
this.collapsedCssClass = '.theia-mod-collapsed';
|
|
27
|
-
}
|
|
28
|
-
async label() {
|
|
29
|
-
const labelNode = await this.elementHandle.$(this.labelElementCssClass);
|
|
30
|
-
if (!labelNode) {
|
|
31
|
-
throw new Error('Cannot read label of ' + this.elementHandle);
|
|
32
|
-
}
|
|
33
|
-
return labelNode.textContent();
|
|
34
|
-
}
|
|
35
|
-
async isCollapsed() {
|
|
36
|
-
return !!await this.elementHandle.$(this.collapsedCssClass);
|
|
37
|
-
}
|
|
38
|
-
async isExpandable() {
|
|
39
|
-
return !!await this.elementHandle.$(this.expansionToggleCssClass);
|
|
40
|
-
}
|
|
41
|
-
async expand() {
|
|
42
|
-
if (!await this.isCollapsed()) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const expansionToggle = await this.elementHandle.waitForSelector(this.expansionToggleCssClass);
|
|
46
|
-
await expansionToggle.click();
|
|
47
|
-
await this.elementHandle.waitForSelector(`${this.expansionToggleCssClass}:not(${this.collapsedCssClass})`);
|
|
48
|
-
}
|
|
49
|
-
async openContextMenu() {
|
|
50
|
-
return theia_context_menu_1.TheiaContextMenu.open(this.app, () => this.elementHandle.waitForSelector(this.labelElementCssClass));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.TheiaTreeNode = TheiaTreeNode;
|
|
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 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TheiaTreeNode = void 0;
|
|
19
|
+
const theia_context_menu_1 = require("./theia-context-menu");
|
|
20
|
+
class TheiaTreeNode {
|
|
21
|
+
constructor(elementHandle, app) {
|
|
22
|
+
this.elementHandle = elementHandle;
|
|
23
|
+
this.app = app;
|
|
24
|
+
this.labelElementCssClass = '.theia-TreeNodeSegmentGrow';
|
|
25
|
+
this.expansionToggleCssClass = '.theia-ExpansionToggle';
|
|
26
|
+
this.collapsedCssClass = '.theia-mod-collapsed';
|
|
27
|
+
}
|
|
28
|
+
async label() {
|
|
29
|
+
const labelNode = await this.elementHandle.$(this.labelElementCssClass);
|
|
30
|
+
if (!labelNode) {
|
|
31
|
+
throw new Error('Cannot read label of ' + this.elementHandle);
|
|
32
|
+
}
|
|
33
|
+
return labelNode.textContent();
|
|
34
|
+
}
|
|
35
|
+
async isCollapsed() {
|
|
36
|
+
return !!await this.elementHandle.$(this.collapsedCssClass);
|
|
37
|
+
}
|
|
38
|
+
async isExpandable() {
|
|
39
|
+
return !!await this.elementHandle.$(this.expansionToggleCssClass);
|
|
40
|
+
}
|
|
41
|
+
async expand() {
|
|
42
|
+
if (!await this.isCollapsed()) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const expansionToggle = await this.elementHandle.waitForSelector(this.expansionToggleCssClass);
|
|
46
|
+
await expansionToggle.click();
|
|
47
|
+
await this.elementHandle.waitForSelector(`${this.expansionToggleCssClass}:not(${this.collapsedCssClass})`);
|
|
48
|
+
}
|
|
49
|
+
async openContextMenu() {
|
|
50
|
+
return theia_context_menu_1.TheiaContextMenu.open(this.app, () => this.elementHandle.waitForSelector(this.labelElementCssClass));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.TheiaTreeNode = TheiaTreeNode;
|
|
54
54
|
//# sourceMappingURL=theia-tree-node.js.map
|
package/lib/theia-view.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ElementHandle } from '@playwright/test';
|
|
2
|
-
import { TheiaApp } from './theia-app';
|
|
3
|
-
import { TheiaMenu } from './theia-menu';
|
|
4
|
-
import { TheiaPageObject } from './theia-page-object';
|
|
5
|
-
export interface TheiaViewData {
|
|
6
|
-
tabSelector: string;
|
|
7
|
-
viewSelector: string;
|
|
8
|
-
viewName?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class TheiaView extends TheiaPageObject {
|
|
11
|
-
protected readonly data: TheiaViewData;
|
|
12
|
-
constructor(data: TheiaViewData, app: TheiaApp);
|
|
13
|
-
get tabSelector(): string;
|
|
14
|
-
get viewSelector(): string;
|
|
15
|
-
get name(): string | undefined;
|
|
16
|
-
open(): Promise<TheiaView>;
|
|
17
|
-
focus(): Promise<void>;
|
|
18
|
-
activate(): Promise<void>;
|
|
19
|
-
waitForVisible(): Promise<void>;
|
|
20
|
-
isTabVisible(): Promise<boolean>;
|
|
21
|
-
isDisplayed(): Promise<boolean>;
|
|
22
|
-
isActive(): Promise<boolean>;
|
|
23
|
-
isClosable(): Promise<boolean>;
|
|
24
|
-
close(waitForClosed?: boolean): Promise<void>;
|
|
25
|
-
protected waitUntilClosed(): Promise<void>;
|
|
26
|
-
title(): Promise<string | undefined>;
|
|
27
|
-
isInSidePanel(): Promise<boolean>;
|
|
28
|
-
side(): Promise<'left' | 'right' | 'bottom' | 'main'>;
|
|
29
|
-
openContextMenuOnTab(): Promise<TheiaMenu>;
|
|
30
|
-
protected viewElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
|
|
31
|
-
protected tabElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
|
|
32
|
-
}
|
|
1
|
+
import { ElementHandle } from '@playwright/test';
|
|
2
|
+
import { TheiaApp } from './theia-app';
|
|
3
|
+
import { TheiaMenu } from './theia-menu';
|
|
4
|
+
import { TheiaPageObject } from './theia-page-object';
|
|
5
|
+
export interface TheiaViewData {
|
|
6
|
+
tabSelector: string;
|
|
7
|
+
viewSelector: string;
|
|
8
|
+
viewName?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class TheiaView extends TheiaPageObject {
|
|
11
|
+
protected readonly data: TheiaViewData;
|
|
12
|
+
constructor(data: TheiaViewData, app: TheiaApp);
|
|
13
|
+
get tabSelector(): string;
|
|
14
|
+
get viewSelector(): string;
|
|
15
|
+
get name(): string | undefined;
|
|
16
|
+
open(): Promise<TheiaView>;
|
|
17
|
+
focus(): Promise<void>;
|
|
18
|
+
activate(): Promise<void>;
|
|
19
|
+
waitForVisible(): Promise<void>;
|
|
20
|
+
isTabVisible(): Promise<boolean>;
|
|
21
|
+
isDisplayed(): Promise<boolean>;
|
|
22
|
+
isActive(): Promise<boolean>;
|
|
23
|
+
isClosable(): Promise<boolean>;
|
|
24
|
+
close(waitForClosed?: boolean): Promise<void>;
|
|
25
|
+
protected waitUntilClosed(): Promise<void>;
|
|
26
|
+
title(): Promise<string | undefined>;
|
|
27
|
+
isInSidePanel(): Promise<boolean>;
|
|
28
|
+
side(): Promise<'left' | 'right' | 'bottom' | 'main'>;
|
|
29
|
+
openContextMenuOnTab(): Promise<TheiaMenu>;
|
|
30
|
+
protected viewElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
|
|
31
|
+
protected tabElement(): Promise<ElementHandle<SVGElement | HTMLElement> | null>;
|
|
32
|
+
}
|
|
33
33
|
//# sourceMappingURL=theia-view.d.ts.map
|