Add playwright routes support - #235
Open
Jonathan-384481 wants to merge 3 commits into
Open
Conversation
KhyFee
reviewed
Aug 3, 2026
KhyFee
left a comment
There was a problem hiding this comment.
Useful addition — withRoute / route covering continue/abort/fulfill matches the Playwright surface people reach for first.
Notes from the diff:
setNetworkInterceptionPatternswith a glob is good; confirm overlapping patterns / multiplewithRoutecalls append rather than replace (tests only show a single pattern).- PHPDoc says
callable(Route): boolbut fulfill/abort examples look side-effecting — clarify return-value expectations (ignored vs must return true). Route::reset()between tests is important; worth asserting in a test that handlers do not leak acrossvisit()calls.- Naming
PlaywrightRoutein userland vs internalRouteis fine; a short README snippet with the three verbs would help discoverability.
Happy to see this land once multi-route + reset behavior is confirmed.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds routes to pest-plugin-browser with minimal changes to the current code. Use with
visit('/')->withRoute('**/message', fn (PlaywrightRoute $route) => $route->continue());or
$page->route('**/*', fn (PlaywrightRoute $route) => $route->abort());Currently supported methods are continue, abort and fulfill