@lvce-editor/test-worker 3.18.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/testWorkerMain.js +16 -13
- package/package.json +1 -1
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
|
} = {}) {
|