Repository navigation
Fix Playwright wait methods not executing commands - #256
Open
asllanmaciel wants to merge 2 commits into
Open
asllanmaciel wants to merge 2 commits into
asllanmaciel wants to merge 2 commits into
Conversation
asllanmaciel
force-pushed
the
fix/1892-wait-methods-consume-generator
branch
from
September 14, 2026 16:14
63830bf to
f62e6a5
Compare
|
Confirming on 5.0.1: |
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.
Summary
Consumes the
Client::execute()generator in the page wait methods so their Playwright commands are actually sent.Client::execute()is lazy because it returns aGenerator; calling it and discarding the result does not execute the websocket send.waitForLoadState(),waitForFunction(), andwaitForURL()were therefore silent no-ops.This patch routes those calls through the existing
processVoidResponse()helper, which consumes the generator, and adds regression coverage asserting that each wait method sends the expected Playwright message.Fixes pestphp/pest#1892.
Test isolation follow-up
The regression tests stub the singleton
Clientwebsocket connection. A follow-up commit now clears that stub inafterEach()so the fake connection cannot leak into later tests in the same process and interfere with a realconnectTo()call.Validation
waitForLoadState(),waitForFunction(), andwaitForURL()is present on the current head;Tests #1202) isaction_requiredbefore jobs execute; this is an authorization gate, not a test failure;git diff --checkis clean.The implementation remains intentionally narrow: three existing wait methods now consume the response exactly like the other void Playwright operations, and the tests restore singleton state after each case.
AI assistance was used to help investigate, prepare, and review the patch. I reviewed the final diff and validation evidence and take responsibility for the contribution.