@lvce-editor/test-worker 13.25.0 → 13.27.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 +9 -1
- package/dist/testWorkerMain.js +31 -4
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare class Locator implements ILocatorExternal {
|
|
|
36
36
|
readonly _selector: any;
|
|
37
37
|
readonly _nth: number;
|
|
38
38
|
readonly _hasText: string;
|
|
39
|
-
constructor(selector: any,
|
|
39
|
+
constructor(selector: any, options?: ILocatorCreateOptions);
|
|
40
40
|
click({ button }?: {
|
|
41
41
|
readonly button?: string;
|
|
42
42
|
}): Promise<void>;
|
|
@@ -71,6 +71,12 @@ export interface ChatDebugEvent {
|
|
|
71
71
|
readonly [key: string]: unknown;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
export interface OpenChatDebugOptions {
|
|
75
|
+
readonly events?: readonly ChatDebugEvent[];
|
|
76
|
+
readonly sessionId: string;
|
|
77
|
+
readonly useDevtoolsLayout: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
74
80
|
export interface Diagnostic {
|
|
75
81
|
readonly columnIndex: number;
|
|
76
82
|
readonly endColumnIndex: number;
|
|
@@ -203,6 +209,8 @@ interface ChatDebug {
|
|
|
203
209
|
readonly handleClickRefresh: () => Promise<void>;
|
|
204
210
|
readonly handleInput: (name: ChatDebugInputName, value: string, checked: boolean) => Promise<void>;
|
|
205
211
|
readonly open: (sessionId: string) => Promise<void>;
|
|
212
|
+
readonly open2: ({ events, sessionId, useDevtoolsLayout }: OpenChatDebugOptions) => Promise<void>;
|
|
213
|
+
readonly openTabPayload: () => Promise<void>;
|
|
206
214
|
readonly openTabPreview: () => Promise<void>;
|
|
207
215
|
readonly openTabResponse: () => Promise<void>;
|
|
208
216
|
readonly openTabTiming: () => Promise<void>;
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1218,7 +1218,9 @@ const get = id => {
|
|
|
1218
1218
|
};
|
|
1219
1219
|
|
|
1220
1220
|
const getLocatorInvoke = locator => {
|
|
1221
|
+
// @ts-ignore
|
|
1221
1222
|
if (locator.webViewId) {
|
|
1223
|
+
// @ts-ignore
|
|
1222
1224
|
const module = get(locator.webViewId);
|
|
1223
1225
|
return module.invoke;
|
|
1224
1226
|
}
|
|
@@ -1562,10 +1564,16 @@ const toButtonNumber = buttonType => {
|
|
|
1562
1564
|
};
|
|
1563
1565
|
|
|
1564
1566
|
class Locator {
|
|
1565
|
-
constructor(selector, {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1567
|
+
constructor(selector, options = {}) {
|
|
1568
|
+
if (!options || typeof options !== 'object' || Array.isArray(options)) {
|
|
1569
|
+
throw new TypeError('options must be of type object');
|
|
1570
|
+
}
|
|
1571
|
+
const {
|
|
1572
|
+
hasText = '',
|
|
1573
|
+
nth = -1
|
|
1574
|
+
} = options;
|
|
1575
|
+
string(hasText, 'options.hasText must be of type string');
|
|
1576
|
+
number(nth, 'options.nth must be of type number');
|
|
1569
1577
|
this._selector = selector;
|
|
1570
1578
|
this._nth = nth;
|
|
1571
1579
|
this._hasText = hasText;
|
|
@@ -1619,6 +1627,7 @@ class Locator {
|
|
|
1619
1627
|
}
|
|
1620
1628
|
|
|
1621
1629
|
const createLocator = (selector, options = {}) => {
|
|
1630
|
+
string(selector, 'selector must be of type string');
|
|
1622
1631
|
return new Locator(selector, options);
|
|
1623
1632
|
};
|
|
1624
1633
|
|
|
@@ -1959,6 +1968,19 @@ const Chat = {
|
|
|
1959
1968
|
const open$9 = async sessionId => {
|
|
1960
1969
|
await invoke('Main.openUri', `chat-debug://${sessionId}`);
|
|
1961
1970
|
};
|
|
1971
|
+
const open2 = async ({
|
|
1972
|
+
events,
|
|
1973
|
+
sessionId,
|
|
1974
|
+
useDevtoolsLayout
|
|
1975
|
+
}) => {
|
|
1976
|
+
await invoke('Main.openUri', `chat-debug://${sessionId}`);
|
|
1977
|
+
if (events) {
|
|
1978
|
+
await setEvents(events);
|
|
1979
|
+
}
|
|
1980
|
+
if (useDevtoolsLayout) {
|
|
1981
|
+
await handleInput$7('useDevtoolsLayout', '', true);
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1962
1984
|
const setEvents = async events => {
|
|
1963
1985
|
await invoke('ChatDebug.setEvents', events);
|
|
1964
1986
|
};
|
|
@@ -2001,6 +2023,9 @@ const closeDetails = async () => {
|
|
|
2001
2023
|
const openTabPreview = async () => {
|
|
2002
2024
|
await invoke('ChatDebug.handleInput', 'detailTab', 'preview', false);
|
|
2003
2025
|
};
|
|
2026
|
+
const openTabPayload = async () => {
|
|
2027
|
+
await invoke('ChatDebug.handleInput', 'detailTab', 'payload', false);
|
|
2028
|
+
};
|
|
2004
2029
|
const openTabResponse = async () => {
|
|
2005
2030
|
await invoke('ChatDebug.handleInput', 'detailTab', 'response', false);
|
|
2006
2031
|
};
|
|
@@ -2023,6 +2048,8 @@ const ChatDebug = {
|
|
|
2023
2048
|
handleClickRefresh,
|
|
2024
2049
|
handleInput: handleInput$7,
|
|
2025
2050
|
open: open$9,
|
|
2051
|
+
open2,
|
|
2052
|
+
openTabPayload,
|
|
2026
2053
|
openTabPreview,
|
|
2027
2054
|
openTabResponse,
|
|
2028
2055
|
openTabTiming,
|