Revert "chore: remove fake error from expect calls (#28112)" (#29271)

This reverts commit 2c3955a28c.

Relates https://github.com/microsoft/playwright-python/issues/2258
This commit is contained in:
Max Schmitt 2024-01-31 23:43:37 +01:00 committed by GitHub
parent 15a20259b9
commit 622153db18
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 });
if (result.received !== undefined)
result.received = serializeResult(result.received);
if (result.matches === params.isNot)
metadata.error = { error: { name: 'Expect', message: 'Expect failed' } };
return result;
}
}