@lvce-editor/test-worker 3.17.0 → 3.19.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/dist/api.d.ts +18 -4
- package/dist/testWorkerMain.js +66 -14
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ declare const execute: (id: string, ...args: readonly any[]) => Promise<any>;
|
|
|
19
19
|
declare const selectItem: (text: string) => Promise<void>;
|
|
20
20
|
declare const setCursor: (rowIndex: number, columnIndex: number) => Promise<void>;
|
|
21
21
|
declare const openCompletion: () => Promise<void>;
|
|
22
|
+
declare const closeCompletion: () => Promise<void>;
|
|
22
23
|
declare const openEditorContextMenu: () => Promise<void>;
|
|
23
24
|
declare const invokeTabCompletion: () => Promise<void>;
|
|
24
25
|
declare const executeTabCompletion: () => Promise<void>;
|
|
@@ -69,6 +70,8 @@ declare const rename: () => Promise<void>;
|
|
|
69
70
|
declare const showHover: () => Promise<void>;
|
|
70
71
|
declare const openRename: () => Promise<void>;
|
|
71
72
|
declare const shouldHaveText: (expectedText: string) => Promise<void>;
|
|
73
|
+
declare const selectIndex: (index: number) => Promise<void>;
|
|
74
|
+
declare const selectCurrentIndex: () => Promise<void>;
|
|
72
75
|
declare const openContextMenu$1: (index: number) => Promise<void>;
|
|
73
76
|
declare const focus$1: () => Promise<void>;
|
|
74
77
|
declare const focusNext$2: () => Promise<void>;
|
|
@@ -117,6 +120,13 @@ declare const clearInput: () => Promise<void>;
|
|
|
117
120
|
declare const sortByPrecedence: () => Promise<void>;
|
|
118
121
|
declare const stopRecordingKeys: () => Promise<void>;
|
|
119
122
|
declare const handleContextMenu$1: (button: number, x: number, y: number) => Promise<void>;
|
|
123
|
+
declare const copyCommandId: () => Promise<void>;
|
|
124
|
+
declare const copyCommandTitle: () => Promise<void>;
|
|
125
|
+
declare const addKeyBinding: () => Promise<void>;
|
|
126
|
+
declare const removeKeyBinding: () => Promise<void>;
|
|
127
|
+
declare const changeWhenExpression: () => Promise<void>;
|
|
128
|
+
declare const showSameKeyBindings: () => Promise<void>;
|
|
129
|
+
declare const resetKeyBinding: () => Promise<void>;
|
|
120
130
|
declare const press: (key: string) => Promise<void>;
|
|
121
131
|
declare const openUri: (uri: string) => Promise<void>;
|
|
122
132
|
declare const splitRight: () => Promise<void>;
|
|
@@ -141,7 +151,7 @@ declare const clearSearchResults: () => Promise<void>;
|
|
|
141
151
|
declare const dismissItem: () => Promise<void>;
|
|
142
152
|
declare const focusFirst$3: () => Promise<void>;
|
|
143
153
|
declare const focusIndex$2: (index: number) => Promise<void>;
|
|
144
|
-
declare const selectIndex: (index: number) => Promise<void>;
|
|
154
|
+
declare const selectIndex$1: (index: number) => Promise<void>;
|
|
145
155
|
declare const focusNext$6: () => Promise<void>;
|
|
146
156
|
declare const handleWheel$1: (deltaMode: number, deltaY: number) => Promise<void>;
|
|
147
157
|
declare const focusNextPage: () => Promise<void>;
|
|
@@ -198,7 +208,10 @@ declare namespace ContextMenu {
|
|
|
198
208
|
export { selectItem };
|
|
199
209
|
}
|
|
200
210
|
declare namespace Editor {
|
|
201
|
-
export { addAllMissingImports, closeColorPicker, closeCompletionDetails, copy, copyLineDown, copyLineUp, cursorCharacterLeft, cursorCharacterRight, cursorDown, cursorEnd, cursorHome, cursorUp, cursorWordLeft, cursorWordPartLeft, cursorWordPartRight, cursorWordRight, deleteAllLeft, deleteAllRight, executeTabCompletion, findAllImplementations, findAllReferences, format, getText, goToDefinition, goToTypeDefinition, insertLineBreak, invokeBraceCompletion, invokeTabCompletion, openColorPicker, openCompletion, openCompletionDetails, openContextMenu, openEditorContextMenu, openFind, openFindWidget, openHover, openRename, openSourceActions, organizeImports, rename, selectAll, setCursor, setDeltaY, setSelections, shouldHaveText, showHover, sortImports, sourceActionsSelectCurrent, toggleBlockComment, toggleCompletionDetails, toggleLineComment, type };
|
|
211
|
+
export { addAllMissingImports, closeColorPicker, closeCompletion, closeCompletionDetails, copy, copyLineDown, copyLineUp, cursorCharacterLeft, cursorCharacterRight, cursorDown, cursorEnd, cursorHome, cursorUp, cursorWordLeft, cursorWordPartLeft, cursorWordPartRight, cursorWordRight, deleteAllLeft, deleteAllRight, executeTabCompletion, findAllImplementations, findAllReferences, format, getText, goToDefinition, goToTypeDefinition, insertLineBreak, invokeBraceCompletion, invokeTabCompletion, openColorPicker, openCompletion, openCompletionDetails, openContextMenu, openEditorContextMenu, openFind, openFindWidget, openHover, openRename, openSourceActions, organizeImports, rename, selectAll, setCursor, setDeltaY, setSelections, shouldHaveText, showHover, sortImports, sourceActionsSelectCurrent, toggleBlockComment, toggleCompletionDetails, toggleLineComment, type };
|
|
212
|
+
}
|
|
213
|
+
declare namespace EditorCompletion {
|
|
214
|
+
export { selectCurrentIndex, selectIndex };
|
|
202
215
|
}
|
|
203
216
|
declare namespace Explorer {
|
|
204
217
|
export { acceptEdit, cancelEdit, clickCurrent, expandAll, expandRecursively, focus$1 as focus, focusFirst$1 as focusFirst, focusIndex, focusLast$1 as focusLast, focusNext$2 as focusNext, handleArrowLeft, handleClick$1 as handleClick, newFile, openContextMenu$1 as openContextMenu, removeDirent, rename$1 as rename, updateEditingValue };
|
|
@@ -219,7 +232,7 @@ declare namespace IconTheme {
|
|
|
219
232
|
export { setIconTheme };
|
|
220
233
|
}
|
|
221
234
|
declare namespace KeyBindingsEditor {
|
|
222
|
-
export { clearInput, focusFirst$2 as focusFirst, focusLast$2 as focusLast, focusNext$4 as focusNext, focusPrevious$2 as focusPrevious, handleClick$2 as handleClick, handleContextMenu$1 as handleContextMenu, handleDoubleClick, handleInput, handleWheel, open$1 as open, sortByPrecedence, startRecordingKeys, stopRecordingKeys, toggleRecordingKeys };
|
|
235
|
+
export { addKeyBinding, changeWhenExpression, clearInput, copyCommandId, copyCommandTitle, focusFirst$2 as focusFirst, focusLast$2 as focusLast, focusNext$4 as focusNext, focusPrevious$2 as focusPrevious, handleClick$2 as handleClick, handleContextMenu$1 as handleContextMenu, handleDoubleClick, handleInput, handleWheel, open$1 as open, removeKeyBinding, resetKeyBinding, showSameKeyBindings, sortByPrecedence, startRecordingKeys, stopRecordingKeys, toggleRecordingKeys };
|
|
223
236
|
}
|
|
224
237
|
declare namespace KeyBoard {
|
|
225
238
|
export { press };
|
|
@@ -240,7 +253,7 @@ declare namespace QuickPick {
|
|
|
240
253
|
export { executeCommand, focusIndex$1 as focusIndex, focusNext$5 as focusNext, focusPrevious$3 as focusPrevious, open$3 as open, selectItem$1 as selectItem, setValue$1 as setValue };
|
|
241
254
|
}
|
|
242
255
|
declare namespace Search {
|
|
243
|
-
export { clearSearchResults, dismissItem, focusFirst$3 as focusFirst, focusIndex$2 as focusIndex, focusNext$6 as focusNext, focusNextPage, focusPrevious$4 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, replaceAll, selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
|
|
256
|
+
export { clearSearchResults, dismissItem, focusFirst$3 as focusFirst, focusIndex$2 as focusIndex, focusNext$6 as focusNext, focusNextPage, focusPrevious$4 as focusPrevious, focusPreviousPage, handleWheel$1 as handleWheel, replaceAll, selectIndex$1 as selectIndex, setExcludeValue, setIncludeValue, setReplaceValue, setValue$2 as setValue, toggleMatchCase, toggleMatchWholeWord, togglePreserveCase, toggleReplace, toggleSearchDetails, toggleUseRegularExpression };
|
|
244
257
|
}
|
|
245
258
|
declare namespace Settings {
|
|
246
259
|
export { update };
|
|
@@ -268,6 +281,7 @@ export interface TestApi {
|
|
|
268
281
|
readonly Command: typeof Command,
|
|
269
282
|
readonly ContextMenu: typeof ContextMenu,
|
|
270
283
|
readonly Editor: typeof Editor,
|
|
284
|
+
readonly EditorCompletion: typeof EditorCompletion,
|
|
271
285
|
readonly Explorer: typeof Explorer,
|
|
272
286
|
readonly Extension: typeof Extension,
|
|
273
287
|
readonly ExtensionDetail: typeof ExtensionDetail,
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1092,17 +1092,32 @@ const setMockRpc = mockRpc => {
|
|
|
1092
1092
|
state.mockRpcs[mockRpc.name] = mockRpc;
|
|
1093
1093
|
};
|
|
1094
1094
|
|
|
1095
|
-
|
|
1095
|
+
const toButtonNumber = buttonType => {
|
|
1096
|
+
switch (buttonType) {
|
|
1097
|
+
case 'left':
|
|
1098
|
+
return 0;
|
|
1099
|
+
case 'middle':
|
|
1100
|
+
return 1;
|
|
1101
|
+
case 'right':
|
|
1102
|
+
return 2;
|
|
1103
|
+
default:
|
|
1104
|
+
throw new Error(`unsupported button type: ${buttonType}`);
|
|
1105
|
+
}
|
|
1106
|
+
};
|
|
1096
1107
|
|
|
1097
1108
|
const create = (selector, options = {}) => {
|
|
1109
|
+
// @ts-ignore
|
|
1098
1110
|
return new Locator(selector, options);
|
|
1099
1111
|
};
|
|
1100
1112
|
const Locator = function (selector, {
|
|
1101
1113
|
nth = -1,
|
|
1102
1114
|
hasText = ''
|
|
1103
1115
|
} = {}) {
|
|
1116
|
+
// @ts-ignore
|
|
1104
1117
|
this._selector = selector;
|
|
1118
|
+
// @ts-ignore
|
|
1105
1119
|
this._nth = nth;
|
|
1120
|
+
// @ts-ignore
|
|
1106
1121
|
this._hasText = hasText;
|
|
1107
1122
|
};
|
|
1108
1123
|
const performAction = async (locator, action, options) => {
|
|
@@ -1111,18 +1126,6 @@ const performAction = async (locator, action, options) => {
|
|
|
1111
1126
|
} = locator.webView || Rpc;
|
|
1112
1127
|
return invoke('TestFrameWork.performAction', locator, action, options);
|
|
1113
1128
|
};
|
|
1114
|
-
const toButtonNumber = buttonType => {
|
|
1115
|
-
switch (buttonType) {
|
|
1116
|
-
case 'left':
|
|
1117
|
-
return 0;
|
|
1118
|
-
case 'middle':
|
|
1119
|
-
return 1;
|
|
1120
|
-
case 'right':
|
|
1121
|
-
return 2;
|
|
1122
|
-
default:
|
|
1123
|
-
throw new Error(`unsupported button type: ${buttonType}`);
|
|
1124
|
-
}
|
|
1125
|
-
};
|
|
1126
1129
|
Locator.prototype.click = async function ({
|
|
1127
1130
|
button = 'left'
|
|
1128
1131
|
} = {}) {
|
|
@@ -1329,6 +1332,9 @@ const setCursor = async (rowIndex, columnIndex) => {
|
|
|
1329
1332
|
const openCompletion = async () => {
|
|
1330
1333
|
await invoke('Editor.openCompletion');
|
|
1331
1334
|
};
|
|
1335
|
+
const closeCompletion = async () => {
|
|
1336
|
+
await invoke('Editor.closeCompletion');
|
|
1337
|
+
};
|
|
1332
1338
|
const openEditorContextMenu = async () => {
|
|
1333
1339
|
await invoke('Editor.handleContextMenu', 0, 0);
|
|
1334
1340
|
};
|
|
@@ -1462,7 +1468,10 @@ const closeColorPicker = async () => {
|
|
|
1462
1468
|
await invoke('Editor.closeColorPicker');
|
|
1463
1469
|
};
|
|
1464
1470
|
const openContextMenu$1 = async () => {
|
|
1465
|
-
|
|
1471
|
+
const button = 0;
|
|
1472
|
+
const x = 0;
|
|
1473
|
+
const y = 0;
|
|
1474
|
+
await invoke('Editor.contextMenu', button, x, y);
|
|
1466
1475
|
};
|
|
1467
1476
|
const getText = async () => {
|
|
1468
1477
|
return invoke('Editor.getText');
|
|
@@ -1487,6 +1496,7 @@ const TestFrameWorkComponentEditor = {
|
|
|
1487
1496
|
__proto__: null,
|
|
1488
1497
|
addAllMissingImports,
|
|
1489
1498
|
closeColorPicker,
|
|
1499
|
+
closeCompletion,
|
|
1490
1500
|
closeCompletionDetails,
|
|
1491
1501
|
copy,
|
|
1492
1502
|
copyLineDown,
|
|
@@ -1539,6 +1549,19 @@ const TestFrameWorkComponentEditor = {
|
|
|
1539
1549
|
type
|
|
1540
1550
|
};
|
|
1541
1551
|
|
|
1552
|
+
const selectIndex$1 = async index => {
|
|
1553
|
+
await invoke('EditorCompletion.selectIndex', index);
|
|
1554
|
+
};
|
|
1555
|
+
const selectCurrentIndex = async () => {
|
|
1556
|
+
await invoke('EditorCompletion.selectCurrentIndex');
|
|
1557
|
+
};
|
|
1558
|
+
|
|
1559
|
+
const TestFrameWorkComponentEditorCompletion = {
|
|
1560
|
+
__proto__: null,
|
|
1561
|
+
selectCurrentIndex,
|
|
1562
|
+
selectIndex: selectIndex$1
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1542
1565
|
const openContextMenu = async index => {
|
|
1543
1566
|
await invoke('Explorer.handleContextMenuKeyboard', index);
|
|
1544
1567
|
};
|
|
@@ -1776,10 +1799,35 @@ const stopRecordingKeys = () => {
|
|
|
1776
1799
|
const handleContextMenu = (button, x, y) => {
|
|
1777
1800
|
return invoke('KeyBindings.handleContextMenu', button, x, y);
|
|
1778
1801
|
};
|
|
1802
|
+
const copyCommandId = () => {
|
|
1803
|
+
return invoke('KeyBindings.copyCommandId');
|
|
1804
|
+
};
|
|
1805
|
+
const copyCommandTitle = () => {
|
|
1806
|
+
return invoke('KeyBindings.copyCommandTitle');
|
|
1807
|
+
};
|
|
1808
|
+
const addKeyBinding = () => {
|
|
1809
|
+
return invoke('KeyBindings.addKeyBinding');
|
|
1810
|
+
};
|
|
1811
|
+
const removeKeyBinding = () => {
|
|
1812
|
+
return invoke('KeyBindings.removeKeyBinding');
|
|
1813
|
+
};
|
|
1814
|
+
const changeWhenExpression = () => {
|
|
1815
|
+
return invoke('KeyBindings.changeWhenExpression');
|
|
1816
|
+
};
|
|
1817
|
+
const showSameKeyBindings = () => {
|
|
1818
|
+
return invoke('KeyBindings.showSameKeyBindings');
|
|
1819
|
+
};
|
|
1820
|
+
const resetKeyBinding = () => {
|
|
1821
|
+
return invoke('KeyBindings.resetKeyBinding');
|
|
1822
|
+
};
|
|
1779
1823
|
|
|
1780
1824
|
const TestFrameWorkComponentKeyBindingsEditor = {
|
|
1781
1825
|
__proto__: null,
|
|
1826
|
+
addKeyBinding,
|
|
1827
|
+
changeWhenExpression,
|
|
1782
1828
|
clearInput,
|
|
1829
|
+
copyCommandId,
|
|
1830
|
+
copyCommandTitle,
|
|
1783
1831
|
focusFirst: focusFirst$2,
|
|
1784
1832
|
focusLast: focusLast$1,
|
|
1785
1833
|
focusNext: focusNext$3,
|
|
@@ -1790,6 +1838,9 @@ const TestFrameWorkComponentKeyBindingsEditor = {
|
|
|
1790
1838
|
handleInput: handleInput$1,
|
|
1791
1839
|
handleWheel: handleWheel$1,
|
|
1792
1840
|
open: open$3,
|
|
1841
|
+
removeKeyBinding,
|
|
1842
|
+
resetKeyBinding,
|
|
1843
|
+
showSameKeyBindings,
|
|
1793
1844
|
sortByPrecedence,
|
|
1794
1845
|
startRecordingKeys,
|
|
1795
1846
|
stopRecordingKeys,
|
|
@@ -2262,6 +2313,7 @@ const TestFrameWorkComponent = {
|
|
|
2262
2313
|
Command: TestFrameWorkComponentCommand,
|
|
2263
2314
|
ContextMenu: TestFrameWorkComponentContextMenu,
|
|
2264
2315
|
Editor: TestFrameWorkComponentEditor,
|
|
2316
|
+
EditorCompletion: TestFrameWorkComponentEditorCompletion,
|
|
2265
2317
|
Explorer: TestFrameWorkComponentExplorer,
|
|
2266
2318
|
Extension: TestFrameWorkComponentExtension,
|
|
2267
2319
|
ExtensionDetail: TestFrameWorkComponentExtensionDetail,
|