cherry-pick(#29271): Revert "chore: remove fake error from expect calls (#28112)" (#29296)

This PR cherry-picks the following commits:

- 622153db18

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Playwright Service 2024-02-01 09:11:50 -08:00 committed by GitHub
parent 7a72adc33c
commit 414affaed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -262,6 +262,8 @@ export class FrameDispatcher extends Dispatcher<Frame, channels.FrameChannel, Br
const result = await this._frame.expect(metadata, params.selector, { ...params, expectedValue }); const result = await this._frame.expect(metadata, params.selector, { ...params, expectedValue });
if (result.received !== undefined) if (result.received !== undefined)
result.received = serializeResult(result.received); result.received = serializeResult(result.received);
if (result.matches === params.isNot)
metadata.error = { error: { name: 'Expect', message: 'Expect failed' } };
return result; return result;
} }
} }