@lvce-editor/test-worker 4.44.0 → 5.0.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 CHANGED
@@ -131,6 +131,10 @@ declare const selectIndices: (indices: readonly number[]) => Promise<void>;
131
131
  declare const toggleIndividualSelection: (index: number) => Promise<void>;
132
132
  declare const addWebExtension: (relativePath: string) => Promise<void>;
133
133
  declare const addNodeExtension: (relativePath: string) => Promise<void>;
134
+ declare const handleClickCategory: (categoryId: string) => Promise<void>;
135
+ declare const handleClickEnable: () => Promise<void>;
136
+ declare const handleClickDisable: () => Promise<void>;
137
+ declare const handleClickSetColorTheme: () => Promise<void>;
134
138
  declare const selectFeature: (name: string) => Promise<void>;
135
139
  declare const selectTab: (name: string) => Promise<void>;
136
140
  declare const selectDetails: () => Promise<void>;
@@ -346,7 +350,7 @@ declare namespace Extension {
346
350
  export { addNodeExtension, addWebExtension };
347
351
  }
348
352
  declare namespace ExtensionDetail {
349
- export { handleScroll, open, openCommands, openFeature, openJsonValidation, openRuntimeStatus, openSettings, openThemes, openWebViews, selectChangelog, selectDetails, selectFeature, selectFeatures, selectTab };
353
+ export { handleClickCategory, handleClickDisable, handleClickEnable, handleClickSetColorTheme, handleScroll, open, openCommands, openFeature, openJsonValidation, openRuntimeStatus, openSettings, openThemes, openWebViews, selectChangelog, selectDetails, selectFeature, selectFeatures, selectTab };
350
354
  }
351
355
  declare namespace FileSystem {
352
356
  export { chmod, createExecutable, createExecutableFrom, getTmpDir, mkdir, readFile, remove, writeFile, writeJson };
@@ -1384,6 +1384,7 @@ const number = (value, message) => {
1384
1384
 
1385
1385
  const expect$1 = locator => {
1386
1386
  return {
1387
+ negated: false,
1387
1388
  async checkSingleElementCondition(fnName, options) {
1388
1389
  // TODO add rpcId property to locator instead
1389
1390
  const result = await locatorInvoke(locator, 'TestFrameWork.checkSingleElementCondition', locator, fnName, options);
@@ -1528,70 +1529,68 @@ const toButtonNumber = buttonType => {
1528
1529
  };
1529
1530
 
1530
1531
  const create = (selector, options = {}) => {
1531
- // @ts-ignore
1532
1532
  return new Locator(selector, options);
1533
1533
  };
1534
- const Locator = function (selector, {
1535
- nth = -1,
1536
- hasText = ''
1537
- } = {}) {
1538
- // @ts-ignore
1539
- this._selector = selector;
1540
- // @ts-ignore
1541
- this._nth = nth;
1542
- // @ts-ignore
1543
- this._hasText = hasText;
1544
- };
1545
1534
  const performAction = async (locator, action, options) => {
1546
1535
  const invoke = getLocatorInvoke(locator);
1547
1536
  return invoke('TestFrameWork.performAction', locator, action, options);
1548
1537
  };
1549
- Locator.prototype.click = async function ({
1550
- button = 'left'
1551
- } = {}) {
1552
- const options = {
1553
- cancable: true,
1554
- bubbles: true,
1555
- button: toButtonNumber(button),
1556
- detail: 1
1557
- };
1558
- return performAction(this, 'click', options);
1559
- };
1560
- Locator.prototype.hover = async function () {
1561
- const options = {
1562
- cancable: true,
1563
- bubbles: true
1564
- };
1565
- return performAction(this, 'hover', options);
1566
- };
1567
- Locator.prototype.first = function () {
1568
- return create(this._selector, {
1569
- nth: 0
1570
- });
1571
- };
1572
- Locator.prototype.locator = function (subSelector) {
1573
- if (this._nth !== -1) {
1574
- return create(`${this._selector}:nth-of-type(${this._nth + 1}) ${subSelector}`);
1538
+ class Locator {
1539
+ constructor(selector, {
1540
+ nth = -1,
1541
+ hasText = ''
1542
+ } = {}) {
1543
+ this._selector = selector;
1544
+ this._nth = nth;
1545
+ this._hasText = hasText;
1546
+ }
1547
+ async click({
1548
+ button = 'left'
1549
+ } = {}) {
1550
+ const options = {
1551
+ cancable: true,
1552
+ bubbles: true,
1553
+ button: toButtonNumber(button),
1554
+ detail: 1
1555
+ };
1556
+ return performAction(this, 'click', options);
1575
1557
  }
1576
- return create(`${this._selector} ${subSelector}`);
1577
- };
1578
- Locator.prototype.nth = function (nth) {
1579
- return create(this._selector, {
1580
- nth
1581
- });
1582
- };
1583
- Locator.prototype.type = async function (text) {
1584
- const options = {
1585
- text
1586
- };
1587
- return performAction(this, 'type', options);
1588
- };
1589
- Locator.prototype.dispatchEvent = async function (type, init) {
1590
- return performAction(this, 'dispatchEvent', {
1591
- type,
1592
- init
1593
- });
1594
- };
1558
+ async hover() {
1559
+ const options = {
1560
+ cancable: true,
1561
+ bubbles: true
1562
+ };
1563
+ return performAction(this, 'hover', options);
1564
+ }
1565
+ first() {
1566
+ return create(this._selector, {
1567
+ nth: 0
1568
+ });
1569
+ }
1570
+ locator(subSelector) {
1571
+ if (this._nth !== -1) {
1572
+ return create(`${this._selector}:nth-of-type(${this._nth + 1}) ${subSelector}`);
1573
+ }
1574
+ return create(`${this._selector} ${subSelector}`);
1575
+ }
1576
+ nth(nth) {
1577
+ return create(this._selector, {
1578
+ nth
1579
+ });
1580
+ }
1581
+ async type(text) {
1582
+ const options = {
1583
+ text
1584
+ };
1585
+ return performAction(this, 'type', options);
1586
+ }
1587
+ async dispatchEvent(type, init) {
1588
+ return performAction(this, 'dispatchEvent', {
1589
+ type,
1590
+ init
1591
+ });
1592
+ }
1593
+ }
1595
1594
 
1596
1595
  const getTmpDir$1 = async () => {
1597
1596
  return 'memfs://';
@@ -2359,6 +2358,22 @@ const TestFrameWorkComponentExtension = {
2359
2358
  addWebExtension
2360
2359
  };
2361
2360
 
2361
+ const handleClickCategory = async categoryId => {
2362
+ // @ts-ignore
2363
+ await invoke$1('ExtensionDetail.handleClickCategory', categoryId);
2364
+ };
2365
+ const handleClickEnable = async () => {
2366
+ // @ts-ignore
2367
+ await invoke$1('ExtensionDetail.handleClickEnable');
2368
+ };
2369
+ const handleClickDisable = async () => {
2370
+ // @ts-ignore
2371
+ await invoke$1('ExtensionDetail.handleClickDisable');
2372
+ };
2373
+ const handleClickSetColorTheme = async () => {
2374
+ // @ts-ignore
2375
+ await invoke$1('ExtensionDetail.handleClickSetColorTheme');
2376
+ };
2362
2377
  const selectFeature = name => {
2363
2378
  return invoke$1('ExtensionDetail.selectFeature', name);
2364
2379
  };
@@ -2407,6 +2422,10 @@ const handleScroll$1 = async scrollTop => {
2407
2422
 
2408
2423
  const TestFrameWorkComponentExtensionDetail = {
2409
2424
  __proto__: null,
2425
+ handleClickCategory,
2426
+ handleClickDisable,
2427
+ handleClickEnable,
2428
+ handleClickSetColorTheme,
2410
2429
  handleScroll: handleScroll$1,
2411
2430
  open: open$4,
2412
2431
  openCommands,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "4.44.0",
3
+ "version": "5.0.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",