waitForFunction bug fix #185
Open
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.
I found two issues when trying to use this function (both are corrected in this PR)
the
isFunctionflag needs to be set (I verified this by looking at events sent by the node version of Playwright)The generator was not being run. Adding the
processVoidResponse()by itself didn't work, becausewaitForFunctionis not Page operation, it's a Frame operation. So I switched to usingsendMessage()which properly makes this distinction.I found a few other similar bugs but wanted to limit this PR's scope. I also have a few suggestions/requests to allow me to use this in my CI pipeline that I'd love to discuss when you have time. Great work on this package!