@lvce-editor/test-worker 10.8.0 → 10.10.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 +21 -13
- package/dist/testWorkerMain.js +116 -78
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export interface LocatorExpect {
|
|
2
|
+
readonly not: LocatorExpect;
|
|
3
|
+
readonly toBeFocused: () => Promise<void>;
|
|
4
|
+
readonly toBeHidden: () => Promise<void>;
|
|
2
5
|
readonly toBeVisible: () => Promise<void>;
|
|
3
|
-
readonly toHaveText: (text: string) => Promise<void>;
|
|
4
6
|
readonly toContainText: (text: string) => Promise<void>;
|
|
5
|
-
readonly toHaveValue: (value: string) => Promise<void>;
|
|
6
|
-
readonly toBeFocused: () => Promise<void>;
|
|
7
|
-
readonly toHaveCSS: (key: string, value: string) => Promise<void>;
|
|
8
7
|
readonly toHaveAttribute: (key: string, value: string | null) => Promise<void>;
|
|
9
|
-
readonly toHaveJSProperty: (key: string, value: any) => Promise<void>;
|
|
10
8
|
readonly toHaveClass: (className: string) => Promise<void>;
|
|
11
|
-
readonly toHaveId: (id: string) => Promise<void>;
|
|
12
9
|
readonly toHaveCount: (count: number) => Promise<void>;
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
10
|
+
readonly toHaveCSS: (key: string, value: string) => Promise<void>;
|
|
11
|
+
readonly toHaveId: (id: string) => Promise<void>;
|
|
12
|
+
readonly toHaveJSProperty: (key: string, value: any) => Promise<void>;
|
|
13
|
+
readonly toHaveText: (text: string) => Promise<void>;
|
|
14
|
+
readonly toHaveValue: (value: string) => Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
interface LocatorClickOptions {
|
|
@@ -20,12 +20,12 @@ interface LocatorClickOptions {
|
|
|
20
20
|
|
|
21
21
|
interface ILocatorExternal {
|
|
22
22
|
readonly click: (options: LocatorClickOptions) => Promise<void>;
|
|
23
|
-
readonly
|
|
23
|
+
readonly dispatchEvent: (type: string, init: string) => Promise<void>;
|
|
24
24
|
readonly first: () => ILocatorExternal;
|
|
25
|
+
readonly hover: () => Promise<void>;
|
|
25
26
|
readonly locator: (subSelector: string) => ILocatorExternal;
|
|
26
27
|
readonly nth: (nth: number) => ILocatorExternal;
|
|
27
28
|
readonly type: (text: string) => Promise<void>;
|
|
28
|
-
readonly dispatchEvent: (type: string, init: string) => Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
interface LocatorConstructor {
|
|
@@ -33,17 +33,17 @@ interface LocatorConstructor {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface Diagnostic {
|
|
36
|
-
readonly rowIndex: number;
|
|
37
36
|
readonly columnIndex: number;
|
|
38
|
-
readonly endRowIndex: number;
|
|
39
37
|
readonly endColumnIndex: number;
|
|
38
|
+
readonly endRowIndex: number;
|
|
40
39
|
readonly message: string;
|
|
40
|
+
readonly rowIndex: number;
|
|
41
41
|
readonly type: "error" | "warning";
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export interface DroppedFileHandle {
|
|
45
|
-
readonly id: number;
|
|
46
45
|
readonly file: File;
|
|
46
|
+
readonly id: number;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export interface FileSystemTmpDirOptions {
|
|
@@ -257,12 +257,16 @@ interface Extension {
|
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
interface ExtensionDetail {
|
|
260
|
+
readonly copyReadmeLink: (href: string) => Promise<void>;
|
|
260
261
|
readonly handleClickCategory: (categoryId: string) => Promise<void>;
|
|
261
262
|
readonly handleClickDisable: () => Promise<void>;
|
|
262
263
|
readonly handleClickEnable: () => Promise<void>;
|
|
263
264
|
readonly handleClickSetColorTheme: () => Promise<void>;
|
|
265
|
+
readonly handleClickUninstall: () => Promise<void>;
|
|
266
|
+
readonly handleImageContextMenu: () => Promise<void>;
|
|
264
267
|
readonly handleReadmeContextMenu: (x: number, y: number, nodeName: string, href: string) => Promise<void>;
|
|
265
268
|
readonly handleScroll: (scrollTop: number) => Promise<void>;
|
|
269
|
+
readonly hideSizeLink: () => Promise<void>;
|
|
266
270
|
readonly open: (extensionId: string) => Promise<void>;
|
|
267
271
|
readonly openCommands: () => Promise<void>;
|
|
268
272
|
readonly openFeature: (featureName: string) => Promise<void>;
|
|
@@ -282,6 +286,7 @@ interface ExtensionSearch {
|
|
|
282
286
|
readonly clearSearchResults: () => Promise<void>;
|
|
283
287
|
readonly copyExtensionId: () => Promise<void>;
|
|
284
288
|
readonly copyExtensionInfo: () => Promise<void>;
|
|
289
|
+
readonly handleClick: (index: number) => Promise<void>;
|
|
285
290
|
readonly handleContextMenu: (button: number, x: number, y: number) => Promise<void>;
|
|
286
291
|
readonly handleInput: (value: string) => Promise<void>;
|
|
287
292
|
readonly open: () => Promise<void>;
|
|
@@ -489,6 +494,9 @@ interface Settings {
|
|
|
489
494
|
|
|
490
495
|
interface SettingsView {
|
|
491
496
|
readonly clear: (searchValue: string) => Promise<void>;
|
|
497
|
+
readonly clearHistory: () => Promise<void>;
|
|
498
|
+
readonly handleClickFilterButton: (x: number, y: number) => Promise<void>;
|
|
499
|
+
readonly handleClickTab: (name: string) => Promise<void>;
|
|
492
500
|
readonly handleInput: (searchValue: string) => Promise<void>;
|
|
493
501
|
readonly handleScroll: (scrollTop: number) => Promise<void>;
|
|
494
502
|
readonly selectExtensions: () => Promise<void>;
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1179,8 +1179,8 @@ const toHaveValue = (locator, {
|
|
|
1179
1179
|
const toHaveText = async (locator, options) => {
|
|
1180
1180
|
const locatorString = printLocator(locator);
|
|
1181
1181
|
const {
|
|
1182
|
-
|
|
1183
|
-
|
|
1182
|
+
actual,
|
|
1183
|
+
wasFound
|
|
1184
1184
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveText', locator, options);
|
|
1185
1185
|
const {
|
|
1186
1186
|
text
|
|
@@ -1193,8 +1193,8 @@ const toHaveText = async (locator, options) => {
|
|
|
1193
1193
|
const toContainText = async (locator, options) => {
|
|
1194
1194
|
const locatorString = printLocator(locator);
|
|
1195
1195
|
const {
|
|
1196
|
-
|
|
1197
|
-
|
|
1196
|
+
actual,
|
|
1197
|
+
wasFound
|
|
1198
1198
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toContainText', locator, options);
|
|
1199
1199
|
const {
|
|
1200
1200
|
text
|
|
@@ -1207,8 +1207,8 @@ const toContainText = async (locator, options) => {
|
|
|
1207
1207
|
const toHaveAttribute = async (locator, options) => {
|
|
1208
1208
|
const locatorString = printLocator(locator);
|
|
1209
1209
|
const {
|
|
1210
|
-
|
|
1211
|
-
|
|
1210
|
+
actual,
|
|
1211
|
+
wasFound
|
|
1212
1212
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveAttribute', locator, options);
|
|
1213
1213
|
const {
|
|
1214
1214
|
key,
|
|
@@ -1250,8 +1250,8 @@ const toHaveClass = async (locator, options) => {
|
|
|
1250
1250
|
};
|
|
1251
1251
|
const toHaveId = async (locator, options) => {
|
|
1252
1252
|
const {
|
|
1253
|
-
|
|
1254
|
-
|
|
1253
|
+
actual,
|
|
1254
|
+
wasFound
|
|
1255
1255
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveId', locator, options);
|
|
1256
1256
|
const locatorString = printLocator(locator);
|
|
1257
1257
|
const {
|
|
@@ -1268,8 +1268,8 @@ const toBeHidden = locator => {
|
|
|
1268
1268
|
};
|
|
1269
1269
|
const toHaveCss = async (locator, options) => {
|
|
1270
1270
|
const {
|
|
1271
|
-
|
|
1272
|
-
|
|
1271
|
+
actual,
|
|
1272
|
+
wasFound
|
|
1273
1273
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveCss', locator, options);
|
|
1274
1274
|
const locatorString = printLocator(locator);
|
|
1275
1275
|
const {
|
|
@@ -1283,8 +1283,8 @@ const toHaveCss = async (locator, options) => {
|
|
|
1283
1283
|
};
|
|
1284
1284
|
const toHaveJSProperty = async (locator, options) => {
|
|
1285
1285
|
const {
|
|
1286
|
-
|
|
1287
|
-
|
|
1286
|
+
actual,
|
|
1287
|
+
wasFound
|
|
1288
1288
|
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveJSProperty', locator, options);
|
|
1289
1289
|
const locatorString = printLocator(locator);
|
|
1290
1290
|
const {
|
|
@@ -1299,30 +1299,30 @@ const toHaveJSProperty = async (locator, options) => {
|
|
|
1299
1299
|
|
|
1300
1300
|
const getFunction = fnName => {
|
|
1301
1301
|
switch (fnName) {
|
|
1302
|
+
case 'toBeFocused':
|
|
1303
|
+
return toBeFocused;
|
|
1304
|
+
case 'toBeHidden':
|
|
1305
|
+
return toBeHidden;
|
|
1302
1306
|
case 'toBeVisible':
|
|
1303
1307
|
return toBeVisible;
|
|
1304
|
-
case 'toHaveValue':
|
|
1305
|
-
return toHaveValue;
|
|
1306
|
-
case 'toHaveText':
|
|
1307
|
-
return toHaveText;
|
|
1308
1308
|
case 'toContainText':
|
|
1309
1309
|
return toContainText;
|
|
1310
1310
|
case 'toHaveAttribute':
|
|
1311
1311
|
return toHaveAttribute;
|
|
1312
|
+
case 'toHaveClass':
|
|
1313
|
+
return toHaveClass;
|
|
1312
1314
|
case 'toHaveCount':
|
|
1313
1315
|
return toHaveCount;
|
|
1314
|
-
case 'toBeFocused':
|
|
1315
|
-
return toBeFocused;
|
|
1316
|
-
case 'toHaveId':
|
|
1317
|
-
return toHaveId;
|
|
1318
|
-
case 'toBeHidden':
|
|
1319
|
-
return toBeHidden;
|
|
1320
1316
|
case 'toHaveCss':
|
|
1321
1317
|
return toHaveCss;
|
|
1322
|
-
case '
|
|
1323
|
-
return
|
|
1318
|
+
case 'toHaveId':
|
|
1319
|
+
return toHaveId;
|
|
1324
1320
|
case 'toHaveJSProperty':
|
|
1325
1321
|
return toHaveJSProperty;
|
|
1322
|
+
case 'toHaveText':
|
|
1323
|
+
return toHaveText;
|
|
1324
|
+
case 'toHaveValue':
|
|
1325
|
+
return toHaveValue;
|
|
1326
1326
|
default:
|
|
1327
1327
|
throw new Error(`unexpected function name ${fnName}`);
|
|
1328
1328
|
}
|
|
@@ -1452,16 +1452,16 @@ const nameAnonymousFunction = (fn, name) => {
|
|
|
1452
1452
|
// @ts-nocheck
|
|
1453
1453
|
|
|
1454
1454
|
const state = {
|
|
1455
|
+
mockRpcs: Object.create(null),
|
|
1455
1456
|
/**
|
|
1456
1457
|
* @type {any[]}
|
|
1457
1458
|
*/
|
|
1458
|
-
pendingTests: []
|
|
1459
|
-
mockRpcs: Object.create(null)
|
|
1459
|
+
pendingTests: []
|
|
1460
1460
|
};
|
|
1461
1461
|
const addTest = (name, fn) => {
|
|
1462
1462
|
state.pendingTests.push({
|
|
1463
|
-
|
|
1464
|
-
|
|
1463
|
+
fn,
|
|
1464
|
+
name
|
|
1465
1465
|
});
|
|
1466
1466
|
};
|
|
1467
1467
|
const getTests = () => {
|
|
@@ -1497,8 +1497,8 @@ const performAction = async (locator, action, options) => {
|
|
|
1497
1497
|
};
|
|
1498
1498
|
class Locator {
|
|
1499
1499
|
constructor(selector, {
|
|
1500
|
-
|
|
1501
|
-
|
|
1500
|
+
hasText = '',
|
|
1501
|
+
nth = -1
|
|
1502
1502
|
} = {}) {
|
|
1503
1503
|
this._selector = selector;
|
|
1504
1504
|
this._nth = nth;
|
|
@@ -1508,17 +1508,17 @@ class Locator {
|
|
|
1508
1508
|
button = 'left'
|
|
1509
1509
|
} = {}) {
|
|
1510
1510
|
const options = {
|
|
1511
|
-
cancable: true,
|
|
1512
1511
|
bubbles: true,
|
|
1513
1512
|
button: toButtonNumber(button),
|
|
1513
|
+
cancable: true,
|
|
1514
1514
|
detail: 1
|
|
1515
1515
|
};
|
|
1516
1516
|
return performAction(this, 'click', options);
|
|
1517
1517
|
}
|
|
1518
1518
|
async hover() {
|
|
1519
1519
|
const options = {
|
|
1520
|
-
|
|
1521
|
-
|
|
1520
|
+
bubbles: true,
|
|
1521
|
+
cancable: true
|
|
1522
1522
|
};
|
|
1523
1523
|
return performAction(this, 'hover', options);
|
|
1524
1524
|
}
|
|
@@ -1546,8 +1546,8 @@ class Locator {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
async dispatchEvent(type, init) {
|
|
1548
1548
|
return performAction(this, 'dispatchEvent', {
|
|
1549
|
-
|
|
1550
|
-
|
|
1549
|
+
init,
|
|
1550
|
+
type
|
|
1551
1551
|
});
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
@@ -1614,7 +1614,7 @@ const focusNext$8 = async () => {
|
|
|
1614
1614
|
const focusPrevious$7 = async () => {
|
|
1615
1615
|
await invoke$1('ActivityBar.focusPrevious');
|
|
1616
1616
|
};
|
|
1617
|
-
const handleClick$
|
|
1617
|
+
const handleClick$3 = async index => {
|
|
1618
1618
|
await invoke$1('ActivityBar.handleClick', index);
|
|
1619
1619
|
};
|
|
1620
1620
|
const handleContextMenu$5 = async () => {
|
|
@@ -1631,7 +1631,7 @@ const ActivityBar = {
|
|
|
1631
1631
|
focusLast: focusLast$6,
|
|
1632
1632
|
focusNext: focusNext$8,
|
|
1633
1633
|
focusPrevious: focusPrevious$7,
|
|
1634
|
-
handleClick: handleClick$
|
|
1634
|
+
handleClick: handleClick$3,
|
|
1635
1635
|
handleContextMenu: handleContextMenu$5,
|
|
1636
1636
|
selectCurrent
|
|
1637
1637
|
};
|
|
@@ -2317,7 +2317,7 @@ const copyRelativePath = async () => {
|
|
|
2317
2317
|
// @ts-ignore
|
|
2318
2318
|
await invoke$1('Explorer.copyRelativePath');
|
|
2319
2319
|
};
|
|
2320
|
-
const handleClick$
|
|
2320
|
+
const handleClick$2 = async index => {
|
|
2321
2321
|
await invoke$1('Explorer.handleClick', index);
|
|
2322
2322
|
};
|
|
2323
2323
|
const handleClickAt$2 = async (preventDefault, button, ctrlKey, shiftKey, x, y) => {
|
|
@@ -2389,7 +2389,7 @@ const Explorer = {
|
|
|
2389
2389
|
focusNext: focusNext$7,
|
|
2390
2390
|
handleArrowLeft: handleArrowLeft$1,
|
|
2391
2391
|
handleBlur,
|
|
2392
|
-
handleClick: handleClick$
|
|
2392
|
+
handleClick: handleClick$2,
|
|
2393
2393
|
handleClickAt: handleClickAt$2,
|
|
2394
2394
|
handleCopy,
|
|
2395
2395
|
handleCut,
|
|
@@ -2440,6 +2440,10 @@ const handleReadmeContextMenu = async (x, y, nodeName, href) => {
|
|
|
2440
2440
|
// @ts-ignore
|
|
2441
2441
|
await invoke$1('ExtensionDetail.handleReadmeContextMenu', x, y, nodeName, href);
|
|
2442
2442
|
};
|
|
2443
|
+
const copyReadmeLink = async href => {
|
|
2444
|
+
// @ts-ignore
|
|
2445
|
+
await invoke$1('ExtensionDetail.copyReadmeLink', href);
|
|
2446
|
+
};
|
|
2443
2447
|
const handleClickEnable = async () => {
|
|
2444
2448
|
// @ts-ignore
|
|
2445
2449
|
await invoke$1('ExtensionDetail.handleClickEnable');
|
|
@@ -2471,6 +2475,12 @@ const open$6 = extensionId => {
|
|
|
2471
2475
|
const uri = `extension-detail://${extensionId}`;
|
|
2472
2476
|
return invoke$1('Main.openUri', uri);
|
|
2473
2477
|
};
|
|
2478
|
+
const handleClickUninstall = () => {
|
|
2479
|
+
return invoke$1('ExtensionDetail.handleClickUninstall');
|
|
2480
|
+
};
|
|
2481
|
+
const handleImageContextMenu = () => {
|
|
2482
|
+
return invoke$1('ExtensionDetail.handleImageContextMenu');
|
|
2483
|
+
};
|
|
2474
2484
|
const openFeature = featureName => {
|
|
2475
2485
|
// @ts-ignore
|
|
2476
2486
|
return invoke$1('ExtensionDetail.handleFeaturesClick', featureName);
|
|
@@ -2497,15 +2507,22 @@ const handleScroll$1 = async scrollTop => {
|
|
|
2497
2507
|
// @ts-ignore
|
|
2498
2508
|
return invoke$1('ExtensionDetail.handleScroll', scrollTop);
|
|
2499
2509
|
};
|
|
2510
|
+
const hideSizeLink = async () => {
|
|
2511
|
+
return invoke$1('ExtensionDetail.hideSizeLink');
|
|
2512
|
+
};
|
|
2500
2513
|
|
|
2501
2514
|
const ExtensionDetail = {
|
|
2502
2515
|
__proto__: null,
|
|
2516
|
+
copyReadmeLink,
|
|
2503
2517
|
handleClickCategory,
|
|
2504
2518
|
handleClickDisable,
|
|
2505
2519
|
handleClickEnable,
|
|
2506
2520
|
handleClickSetColorTheme,
|
|
2521
|
+
handleClickUninstall,
|
|
2522
|
+
handleImageContextMenu,
|
|
2507
2523
|
handleReadmeContextMenu,
|
|
2508
2524
|
handleScroll: handleScroll$1,
|
|
2525
|
+
hideSizeLink,
|
|
2509
2526
|
open: open$6,
|
|
2510
2527
|
openCommands,
|
|
2511
2528
|
openFeature,
|
|
@@ -2541,6 +2558,10 @@ const handleInput$4 = async value => {
|
|
|
2541
2558
|
// @ts-ignore
|
|
2542
2559
|
await invoke$1('Extensions.handleInput', value, Script$1);
|
|
2543
2560
|
};
|
|
2561
|
+
const handleClick$1 = async index => {
|
|
2562
|
+
// @ts-ignore
|
|
2563
|
+
await invoke$1('Extensions.handleClick', index);
|
|
2564
|
+
};
|
|
2544
2565
|
const handleContextMenu$4 = async (button, x, y) => {
|
|
2545
2566
|
// @ts-ignore
|
|
2546
2567
|
await invoke$1('Extensions.handleContextMenu', button, x, y);
|
|
@@ -2563,6 +2584,7 @@ const ExtensionSearch = {
|
|
|
2563
2584
|
clearSearchResults: clearSearchResults$1,
|
|
2564
2585
|
copyExtensionId,
|
|
2565
2586
|
copyExtensionInfo,
|
|
2587
|
+
handleClick: handleClick$1,
|
|
2566
2588
|
handleContextMenu: handleContextMenu$4,
|
|
2567
2589
|
handleInput: handleInput$4,
|
|
2568
2590
|
open: open$4
|
|
@@ -2988,38 +3010,38 @@ const getKeyOptions = rawKey => {
|
|
|
2988
3010
|
let key = '';
|
|
2989
3011
|
for (const part of parts) {
|
|
2990
3012
|
switch (part) {
|
|
3013
|
+
case Alt:
|
|
3014
|
+
altKey = true;
|
|
3015
|
+
break;
|
|
2991
3016
|
case Control:
|
|
2992
3017
|
ctrlKey = true;
|
|
2993
3018
|
break;
|
|
2994
3019
|
case Space:
|
|
2995
3020
|
key = ' ';
|
|
2996
3021
|
break;
|
|
2997
|
-
case Alt:
|
|
2998
|
-
altKey = true;
|
|
2999
|
-
break;
|
|
3000
3022
|
default:
|
|
3001
3023
|
key = part;
|
|
3002
3024
|
break;
|
|
3003
3025
|
}
|
|
3004
3026
|
}
|
|
3005
3027
|
return {
|
|
3006
|
-
|
|
3028
|
+
altKey,
|
|
3007
3029
|
ctrlKey,
|
|
3008
|
-
|
|
3030
|
+
key
|
|
3009
3031
|
};
|
|
3010
3032
|
}
|
|
3011
3033
|
return {
|
|
3012
|
-
|
|
3034
|
+
altKey: false,
|
|
3013
3035
|
ctrlKey: false,
|
|
3014
|
-
|
|
3036
|
+
key: rawKey
|
|
3015
3037
|
};
|
|
3016
3038
|
};
|
|
3017
3039
|
|
|
3018
3040
|
const press = async key => {
|
|
3019
3041
|
const keyOptions = getKeyOptions(key);
|
|
3020
3042
|
const options = {
|
|
3021
|
-
cancelable: true,
|
|
3022
3043
|
bubbles: true,
|
|
3044
|
+
cancelable: true,
|
|
3023
3045
|
...keyOptions
|
|
3024
3046
|
};
|
|
3025
3047
|
// @ts-ignore
|
|
@@ -3528,6 +3550,10 @@ const handleInput$1 = async searchValue => {
|
|
|
3528
3550
|
// @ts-ignore
|
|
3529
3551
|
return invoke$1('Settings.handleInput', searchValue, Script);
|
|
3530
3552
|
};
|
|
3553
|
+
const handleClickTab = async name => {
|
|
3554
|
+
// @ts-ignore
|
|
3555
|
+
return invoke$1('Settings.handleClickTab', name);
|
|
3556
|
+
};
|
|
3531
3557
|
const usePreviousSearchValue = async () => {
|
|
3532
3558
|
// @ts-ignore
|
|
3533
3559
|
return invoke$1('Settings.usePreviousSearchValue');
|
|
@@ -3540,6 +3566,10 @@ const clear = async searchValue => {
|
|
|
3540
3566
|
// @ts-ignore
|
|
3541
3567
|
return invoke$1('Settings.clear', searchValue, Script);
|
|
3542
3568
|
};
|
|
3569
|
+
const clearHistory = async () => {
|
|
3570
|
+
// @ts-ignore
|
|
3571
|
+
return invoke$1('Settings.clearHistory', searchValue, Script);
|
|
3572
|
+
};
|
|
3543
3573
|
const selectTab = async tabId => {
|
|
3544
3574
|
// @ts-ignore
|
|
3545
3575
|
return invoke$1('Settings.handleClickTab', tabId);
|
|
@@ -3557,10 +3587,17 @@ const handleScroll = async scrollTop => {
|
|
|
3557
3587
|
// @ts-ignore
|
|
3558
3588
|
await invoke$1('Settings.handleScroll', scrollTop, Script);
|
|
3559
3589
|
};
|
|
3590
|
+
const handleClickFilterButton = async (x, y) => {
|
|
3591
|
+
// @ts-ignore
|
|
3592
|
+
await invoke$1('Settings.handleClickFilterButton', x, y);
|
|
3593
|
+
};
|
|
3560
3594
|
|
|
3561
3595
|
const SettingsView = {
|
|
3562
3596
|
__proto__: null,
|
|
3563
3597
|
clear,
|
|
3598
|
+
clearHistory,
|
|
3599
|
+
handleClickFilterButton,
|
|
3600
|
+
handleClickTab,
|
|
3564
3601
|
handleInput: handleInput$1,
|
|
3565
3602
|
handleScroll,
|
|
3566
3603
|
selectExtensions,
|
|
@@ -3751,8 +3788,8 @@ const transferWebViewPort = async (webViewId, port) => {
|
|
|
3751
3788
|
|
|
3752
3789
|
const waitForFirstEventEvent = async port => {
|
|
3753
3790
|
const {
|
|
3754
|
-
|
|
3755
|
-
|
|
3791
|
+
promise,
|
|
3792
|
+
resolve
|
|
3756
3793
|
} = Promise.withResolvers();
|
|
3757
3794
|
port.onmessage = resolve;
|
|
3758
3795
|
const firstEvent = await promise;
|
|
@@ -3773,9 +3810,9 @@ const createPortRpc = async webViewId => {
|
|
|
3773
3810
|
throw new Error('unexpected first message');
|
|
3774
3811
|
}
|
|
3775
3812
|
const rpc = await MessagePortRpcParent.create({
|
|
3776
|
-
messagePort: port1,
|
|
3777
3813
|
commandMap: {},
|
|
3778
|
-
isMessagePortOpen: true
|
|
3814
|
+
isMessagePortOpen: true,
|
|
3815
|
+
messagePort: port1
|
|
3779
3816
|
});
|
|
3780
3817
|
return rpc;
|
|
3781
3818
|
};
|
|
@@ -3833,6 +3870,7 @@ const createApi = (platform, assetDir) => {
|
|
|
3833
3870
|
EditorHover,
|
|
3834
3871
|
EditorRename,
|
|
3835
3872
|
EditorSourceAction,
|
|
3873
|
+
expect,
|
|
3836
3874
|
Explorer,
|
|
3837
3875
|
Extension,
|
|
3838
3876
|
ExtensionDetail,
|
|
@@ -3844,10 +3882,13 @@ const createApi = (platform, assetDir) => {
|
|
|
3844
3882
|
}
|
|
3845
3883
|
},
|
|
3846
3884
|
FindWidget,
|
|
3885
|
+
getTmpDir: getTmpDir$1,
|
|
3886
|
+
// TODO maybe deprecate this or move to file system
|
|
3847
3887
|
IconTheme,
|
|
3848
3888
|
IframeInspector,
|
|
3849
3889
|
KeyBindingsEditor,
|
|
3850
3890
|
KeyBoard,
|
|
3891
|
+
Locator: create,
|
|
3851
3892
|
Main,
|
|
3852
3893
|
Output,
|
|
3853
3894
|
Panel,
|
|
@@ -3862,14 +3903,11 @@ const createApi = (platform, assetDir) => {
|
|
|
3862
3903
|
SideBar,
|
|
3863
3904
|
SourceControl,
|
|
3864
3905
|
StatusBar,
|
|
3906
|
+
test,
|
|
3865
3907
|
TitleBarMenuBar,
|
|
3866
3908
|
Url,
|
|
3867
3909
|
WebView,
|
|
3868
|
-
Workspace
|
|
3869
|
-
test,
|
|
3870
|
-
Locator: create,
|
|
3871
|
-
expect,
|
|
3872
|
-
getTmpDir: getTmpDir$1 // TODO maybe deprecate this or move to file system
|
|
3910
|
+
Workspace
|
|
3873
3911
|
};
|
|
3874
3912
|
};
|
|
3875
3913
|
|
|
@@ -3898,27 +3936,27 @@ const executeTest2 = async (name, fn, globals, timestampGenerator) => {
|
|
|
3898
3936
|
const formattedDuration = formatDuration(duration);
|
|
3899
3937
|
if (error) {
|
|
3900
3938
|
return {
|
|
3901
|
-
|
|
3902
|
-
start,
|
|
3903
|
-
end,
|
|
3939
|
+
background: 'red',
|
|
3904
3940
|
duration,
|
|
3941
|
+
end,
|
|
3942
|
+
error,
|
|
3905
3943
|
formattedDuration,
|
|
3906
3944
|
name,
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3945
|
+
start,
|
|
3946
|
+
text: `test failed: ${error}`,
|
|
3947
|
+
type: Fail
|
|
3910
3948
|
};
|
|
3911
3949
|
}
|
|
3912
3950
|
return {
|
|
3913
|
-
|
|
3914
|
-
start,
|
|
3915
|
-
end,
|
|
3951
|
+
background: 'green',
|
|
3916
3952
|
duration,
|
|
3953
|
+
end,
|
|
3954
|
+
error: undefined,
|
|
3917
3955
|
formattedDuration,
|
|
3918
3956
|
name,
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3957
|
+
start,
|
|
3958
|
+
text: `test passed in ${formattedDuration}`,
|
|
3959
|
+
type: Pass
|
|
3922
3960
|
};
|
|
3923
3961
|
};
|
|
3924
3962
|
|
|
@@ -3941,9 +3979,9 @@ const now = () => {
|
|
|
3941
3979
|
|
|
3942
3980
|
const executeTest = async (name, fn, globals = {}) => {
|
|
3943
3981
|
const {
|
|
3982
|
+
background,
|
|
3944
3983
|
error,
|
|
3945
3984
|
formattedDuration,
|
|
3946
|
-
background,
|
|
3947
3985
|
text,
|
|
3948
3986
|
type
|
|
3949
3987
|
} = await executeTest2(name, fn, globals, now);
|
|
@@ -4021,10 +4059,10 @@ const watchForHotReload = async (platform, href) => {
|
|
|
4021
4059
|
// 3. print out results
|
|
4022
4060
|
const execute = async (href, platform, assetDir) => {
|
|
4023
4061
|
push({
|
|
4024
|
-
url: href,
|
|
4025
4062
|
assetDir,
|
|
4063
|
+
inProgress: true,
|
|
4026
4064
|
platform,
|
|
4027
|
-
|
|
4065
|
+
url: href
|
|
4028
4066
|
});
|
|
4029
4067
|
const globals = createApi(platform, assetDir);
|
|
4030
4068
|
// TODO
|
|
@@ -4059,10 +4097,10 @@ const execute = async (href, platform, assetDir) => {
|
|
|
4059
4097
|
// TODO maybe setup file watcher earlier, to not miss events?
|
|
4060
4098
|
|
|
4061
4099
|
push({
|
|
4062
|
-
url: href,
|
|
4063
4100
|
assetDir,
|
|
4101
|
+
inProgress: false,
|
|
4064
4102
|
platform,
|
|
4065
|
-
|
|
4103
|
+
url: href
|
|
4066
4104
|
});
|
|
4067
4105
|
// TODO if file watcher was previously added, don't need to add one
|
|
4068
4106
|
try {
|
|
@@ -4080,10 +4118,10 @@ const hotReloadTest = async () => {
|
|
|
4080
4118
|
}
|
|
4081
4119
|
const last$1 = last();
|
|
4082
4120
|
const {
|
|
4083
|
-
platform,
|
|
4084
|
-
url,
|
|
4085
4121
|
assetDir,
|
|
4086
|
-
inProgress
|
|
4122
|
+
inProgress,
|
|
4123
|
+
platform,
|
|
4124
|
+
url
|
|
4087
4125
|
} = last$1;
|
|
4088
4126
|
if (inProgress) {
|
|
4089
4127
|
return;
|
|
@@ -4098,9 +4136,9 @@ const handleFileWatcherEvent = async event => {
|
|
|
4098
4136
|
};
|
|
4099
4137
|
|
|
4100
4138
|
const commandMap = {
|
|
4139
|
+
'FileWatcher.handleEvent': handleFileWatcherEvent,
|
|
4101
4140
|
'Test.execute': execute,
|
|
4102
|
-
'Test.executeMock': executeMock
|
|
4103
|
-
'FileWatcher.handleEvent': handleFileWatcherEvent
|
|
4141
|
+
'Test.executeMock': executeMock
|
|
4104
4142
|
};
|
|
4105
4143
|
|
|
4106
4144
|
const send = async port => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-worker",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.10.0",
|
|
4
4
|
"description": "Test Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/testWorkerMain.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lvce-editor/constants": "^1.
|
|
14
|
+
"@lvce-editor/constants": "^1.41.0"
|
|
15
15
|
},
|
|
16
16
|
"types": "dist/api.d.ts"
|
|
17
17
|
}
|