You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I.mockRoute('**/*.{png,jpg,jpeg}', route => route.abort());
// To disable mocking for a route call `stopMockingRoute`
// for previously mocked URL
I.stopMockingRoute('**/*.{png,jpg,jpeg}'
To master request intercepting use HTTPRequest object object passed into mock request handler.
Hello! @kobenguyent@DavertMik
Just have a question to clarify and probably be useful for those following in my footsteps.
I came across this pull request during the research
I'm just implementing testing and found that the desired helper function I.startMocking() may have become obsolete, as the pollyjs was removed in this pull request.
Trying to verify whether this is true and that at the moment there is no way to use recording requests to files completely?
And the only option for mocking requests now is mockRoute() with manual specification of responses?
I found the startRecordingTraffic methods for playwright
and grabRecordedNetworkTraffics
But as I understand it, this is supposed to be used for recording real requests and asserting on them and not recording them themselves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation/Description of the PR
Network requests & responses can be mocked and modified. Use mockRoute which strictly follows Puppeteer's setRequestInterception API.
To master request intercepting use HTTPRequest object object passed into mock request handler.
Applicable helpers:
Type of change
Checklist:
npm run docs)npm run lint)npm test)