@lvce-editor/test-worker 4.15.0 → 4.16.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 +11 -9
- package/package.json +1 -1
package/dist/testWorkerMain.js
CHANGED
|
@@ -1097,6 +1097,8 @@ const getLocatorRpc = locator => {
|
|
|
1097
1097
|
};
|
|
1098
1098
|
|
|
1099
1099
|
const locatorInvoke = (locator, method, ...params) => {
|
|
1100
|
+
object(locator);
|
|
1101
|
+
string$1(method);
|
|
1100
1102
|
const {
|
|
1101
1103
|
invoke
|
|
1102
1104
|
} = getLocatorRpc(locator);
|
|
@@ -1126,7 +1128,7 @@ const toHaveText = async (locator, options) => {
|
|
|
1126
1128
|
const {
|
|
1127
1129
|
wasFound,
|
|
1128
1130
|
actual
|
|
1129
|
-
} = await locatorInvoke(locator, 'TestFrameWork.
|
|
1131
|
+
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveText', locator, options);
|
|
1130
1132
|
const {
|
|
1131
1133
|
text
|
|
1132
1134
|
} = options;
|
|
@@ -1140,7 +1142,7 @@ const toHaveAttribute = async (locator, options) => {
|
|
|
1140
1142
|
const {
|
|
1141
1143
|
wasFound,
|
|
1142
1144
|
actual
|
|
1143
|
-
} = await locatorInvoke(locator, 'TestFrameWork.
|
|
1145
|
+
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveAttribute', locator, options);
|
|
1144
1146
|
const {
|
|
1145
1147
|
key,
|
|
1146
1148
|
value
|
|
@@ -1156,21 +1158,21 @@ const toHaveCount = async (locator, {
|
|
|
1156
1158
|
const locatorString = printLocator(locator);
|
|
1157
1159
|
const {
|
|
1158
1160
|
actual
|
|
1159
|
-
} = await locatorInvoke(locator, 'TestFrameWork.
|
|
1161
|
+
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveCount', locator);
|
|
1160
1162
|
return `expected ${locatorString} to have count ${count} but was ${actual}`;
|
|
1161
1163
|
};
|
|
1162
1164
|
const toBeFocused = async locator => {
|
|
1163
1165
|
const locatorString = printLocator(locator);
|
|
1164
1166
|
const {
|
|
1165
1167
|
actual
|
|
1166
|
-
} = await locatorInvoke(locator, 'TestFrameWork.
|
|
1168
|
+
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toBeFocused', locator);
|
|
1167
1169
|
return `expected ${locatorString} to be focused but active element is ${actual}`;
|
|
1168
1170
|
};
|
|
1169
1171
|
const toHaveClass = async (locator, options) => {
|
|
1170
1172
|
const locatorString = printLocator(locator);
|
|
1171
1173
|
const {
|
|
1172
1174
|
wasFound
|
|
1173
|
-
} = await locatorInvoke(locator, 'TestFrameWork.
|
|
1175
|
+
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveClass', locator, options);
|
|
1174
1176
|
const {
|
|
1175
1177
|
className
|
|
1176
1178
|
} = options;
|
|
@@ -1183,7 +1185,7 @@ const toHaveId = async (locator, options) => {
|
|
|
1183
1185
|
const {
|
|
1184
1186
|
wasFound,
|
|
1185
1187
|
actual
|
|
1186
|
-
} = await locatorInvoke(locator, 'TestFrameWork.
|
|
1188
|
+
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveId', locator, options);
|
|
1187
1189
|
const locatorString = printLocator(locator);
|
|
1188
1190
|
const {
|
|
1189
1191
|
id
|
|
@@ -1201,7 +1203,7 @@ const toHaveCss = async (locator, options) => {
|
|
|
1201
1203
|
const {
|
|
1202
1204
|
wasFound,
|
|
1203
1205
|
actual
|
|
1204
|
-
} = await locatorInvoke(locator, 'TestFrameWork.
|
|
1206
|
+
} = await locatorInvoke(locator, 'TestFrameWork.checkConditionError', 'toHaveCss', locator, options);
|
|
1205
1207
|
const locatorString = printLocator(locator);
|
|
1206
1208
|
const {
|
|
1207
1209
|
key,
|
|
@@ -1255,7 +1257,7 @@ const expect$1 = locator => {
|
|
|
1255
1257
|
return {
|
|
1256
1258
|
async checkSingleElementCondition(fnName, options) {
|
|
1257
1259
|
// TODO add rpcId property to locator instead
|
|
1258
|
-
const result = await locatorInvoke('TestFrameWork.checkSingleElementCondition', locator, fnName, options);
|
|
1260
|
+
const result = await locatorInvoke(locator, 'TestFrameWork.checkSingleElementCondition', locator, fnName, options);
|
|
1259
1261
|
if (result && result.error) {
|
|
1260
1262
|
const fn = getFunction(fnName);
|
|
1261
1263
|
const errorInfo = await fn(locator, options);
|
|
@@ -1263,7 +1265,7 @@ const expect$1 = locator => {
|
|
|
1263
1265
|
}
|
|
1264
1266
|
},
|
|
1265
1267
|
async checkMultiElementCondition(fnName, options) {
|
|
1266
|
-
const result = await locatorInvoke('TestFrameWork.checkMultiElementCondition', locator, fnName, options);
|
|
1268
|
+
const result = await locatorInvoke(locator, 'TestFrameWork.checkMultiElementCondition', locator, fnName, options);
|
|
1267
1269
|
if (result && result.error) {
|
|
1268
1270
|
const fn = getFunction(fnName);
|
|
1269
1271
|
const errorInfo = await fn(locator, options);
|