Playwright · Senior · Question 16 of 77
How do you keep HAR-based mocks from going stale?
- 1Re-record them regularly and fail when requests don't match
- 2Never update them, so tests stay fully deterministic
- 3Edit the HAR files by hand whenever the API changes
Show the answer
Correct answer: Re-record them regularly and fail when requests don't match
Explanation
With notFound: 'abort', unmatched requests fail. A scheduled job with update: true refreshes recordings against the real API.