Report a lost browser instead of reading it as a missing element - #66
Merged
Merged
Conversation
…element
elementIsVisible() caught every Exception and returned false. When the
Chrome a run drives is closed under it (another PrestaFlow process
releasing the shared browser, a crash), chrome-php throws TargetDestroyed
("The session is destroyed."), and isVisible() answered "not visible".
A suite checking a block on the home page then failed with "false must be
the same as true": a lost browser disguised as a regression of the shop,
which is how psflowdemo's DisplayHome looked broken on 1.7.8.11 while the
block was served, hooked and rendered. TargetDestroyed now propagates, so
the step fails with the browser error the runner already reports. A missing
element still answers false.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
CommonPage::elementIsVisible(), behindisVisible(), caught every exception and returnedfalse. When the browser disappears mid-run, chrome-php throwsTargetDestroyed. That was then reported as a plain assertion failure,false must be the same as true, which looks like a shop regression.That is how psflowdemo's
DisplayHomeappeared to fail on 1.7.8.11. The browser was closed by a concurrent PrestaFlow process (the defect fixed in #65), and on a fresh 1.7.8.11 shop run alone, the suite passes every time.Fix
elementIsVisible()letsTargetDestroyedpropagate. A really missing element still answersfalse.Verified
tests/Unit/Pages/VisibilityOnLostBrowserTest.phpfails without the fix. With it:OK (334 tests, 763 assertions).The session is destroyed..Notes
getTextContent()still mapsTargetDestroyedtofalse. It is left as is: the first visibility check already surfaces the error.🤖 Generated with Claude Code