playwright-core 1.56.0-alpha-1756945786000 → 1.56.0-alpha-1757023974000

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.
@@ -1928,6 +1928,7 @@ import_validatorPrimitives.scheme.FrameExpectResult = (0, import_validatorPrimit
1928
1928
  matches: import_validatorPrimitives.tBoolean,
1929
1929
  received: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tType)("SerializedValue")),
1930
1930
  timedOut: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
1931
+ errorMessage: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1931
1932
  log: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tArray)(import_validatorPrimitives.tString))
1932
1933
  });
1933
1934
  import_validatorPrimitives.scheme.WorkerInitializer = (0, import_validatorPrimitives.tObject)({
@@ -1160,11 +1160,15 @@ class Frame extends import_instrumentation.SdkObject {
1160
1160
  fixupMetadataError(result);
1161
1161
  return result;
1162
1162
  } catch (e) {
1163
- if (js.isJavaScriptErrorInEvaluate(e) || (0, import_selectorParser.isInvalidSelectorError)(e))
1164
- throw e;
1165
1163
  const result = { matches: options.isNot, log: (0, import_callLog.compressCallLog)(progress.metadata.log) };
1166
- if (lastIntermediateResult.isSet)
1164
+ if ((0, import_selectorParser.isInvalidSelectorError)(e)) {
1165
+ result.errorMessage = "Error: " + e.message;
1166
+ } else if (js.isJavaScriptErrorInEvaluate(e)) {
1167
+ result.errorMessage = e.message;
1168
+ } else if (lastIntermediateResult.isSet) {
1167
1169
  result.received = lastIntermediateResult.received;
1170
+ result.errorMessage = lastIntermediateResult.errorMessage;
1171
+ }
1168
1172
  if (e instanceof import_errors.TimeoutError)
1169
1173
  result.timedOut = true;
1170
1174
  fixupMetadataError(result);
@@ -1195,7 +1199,10 @@ class Frame extends import_instrumentation.SdkObject {
1195
1199
  if (log)
1196
1200
  progress.log(log);
1197
1201
  if (matches === options.isNot) {
1198
- lastIntermediateResult.received = missingReceived ? "<element(s) not found>" : received;
1202
+ if (missingReceived)
1203
+ lastIntermediateResult.errorMessage = "Error: element(s) not found";
1204
+ else
1205
+ lastIntermediateResult.received = received;
1199
1206
  lastIntermediateResult.isSet = true;
1200
1207
  if (!missingReceived && !Array.isArray(received))
1201
1208
  progress.log(` unexpected value "${renderUnexpectedValue(options.expression, received)}"`);
@@ -85,7 +85,7 @@ async function asString(stream) {
85
85
  function iterablePump() {
86
86
  let controller;
87
87
  const stream = new ReadableStream({ start: (c) => controller = c });
88
- const iterable = async function* () {
88
+ const iterable = (async function* () {
89
89
  const reader = stream.getReader();
90
90
  while (true) {
91
91
  const { done, value } = await reader.read();
@@ -93,7 +93,7 @@ function iterablePump() {
93
93
  break;
94
94
  yield value;
95
95
  }
96
- }();
96
+ })();
97
97
  return {
98
98
  iterable,
99
99
  addChunk: (chunk) => {