Skip to content

Commit 414affa

Browse files
cherry-pick(#29271): Revert "chore: remove fake error from expect calls (#28112)" (#29296)
This PR cherry-picks the following commits: - 622153d Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 7a72adc commit 414affa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/playwright-core/src/server/dispatchers/frameDispatcher.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ export class FrameDispatcher extends Dispatcher<Frame, channels.FrameChannel, Br
262262
const result = await this._frame.expect(metadata, params.selector, { ...params, expectedValue });
263263
if (result.received !== undefined)
264264
result.received = serializeResult(result.received);
265+
if (result.matches === params.isNot)
266+
metadata.error = { error: { name: 'Expect', message: 'Expect failed' } };
265267
return result;
266268
}
267269
}

0 commit comments

Comments
 (0)