Repository navigation
Conversation
… removed In debug mode _locate() previews found elements via Locator.evaluate(), which auto-waits for the element to be attached. If the element was removed between all() and evaluate(), the step blocked for the full helper timeout and failed. Make the preview best-effort with a short timeout. Fixes codeceptjs#5739 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #5739
Problem
With
--verbose/--debug,_locate()previews the found elements viaelToString()→Locator.evaluate(). Locators returned by.all()auto-wait for the element to be attached, so if the element is removed between.all()andevaluate(), the step (e.g.I.dontSeeElement()) blocks for the full helpertimeoutand fails withTimeoutError: evaluate: Timeout ...ms exceeded. Without debug mode the same test never stalls.Fix
Make the debug preview best-effort:
evaluate()gets a 100 ms timeout and falls back to<unavailable>instead of blocking or failing the step.Test
Added a regression test to
test/helper/Playwright_test.jsthat removes the element right afterLocator.all()resolves and asserts_locate()returns in under 1 s in debug mode. It fails without the fix (timeout) and passes with it.The repro from the issue (200 iterations,
--verbose): 18/200 stalls, 55 s before → 0/200 stalls, 2 s after.🤖 Generated with Claude Code