IBX-12632: [Behat] Waited for the dropdown items in IbexaDropdown::selectOption() - #2104
Merged
Merged
Conversation
…lectOption() selectOption() called findAll() immediately after the dropdown was opened. BaseElement::findAll() only waits for raw CSS matches and applies the VisibleCSSLocator visibility criterion afterwards, so while the popover is in the DOM but not yet visible the collection comes back empty - no timeout, just "Collection is empty". Wait with ElementExistsCondition first, the way the sibling selectOptionByValueFragment() already does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change addresses the intermittent dropdown timing failure without altering product code.
Review effort: Lite
Findings: None
What changed in this PR
Updates Behat dropdown selection to wait for asynchronously rendered options, preventing intermittent test failures.
Changes:
- Waits up to five seconds for visible dropdown options.
- Preserves the existing selection behavior.
| File | Description |
|---|---|
src/lib/Behat/Component/IbexaDropdown.php |
Adds visibility-aware waiting to selectOption(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tomaszszopinski
approved these changes
Sep 22, 2026
tomaszszopinski
requested review from
KamilSznajdrowicz,
juskora,
katarzynazawada,
micszo and
pawlakadrian
September 22, 2026 06:49
katarzynazawada
approved these changes
Sep 22, 2026
KamilSznajdrowicz
approved these changes
Sep 22, 2026
barbaragr
added a commit
that referenced
this pull request
Sep 22, 2026
…lectOption() (#2104) selectOption() called findAll() immediately after the dropdown was opened. BaseElement::findAll() only waits for raw CSS matches and applies the VisibleCSSLocator visibility criterion afterwards, so while the popover is in the DOM but not yet visible the collection comes back empty - no timeout, just "Collection is empty". Wait with ElementExistsCondition first, the way the sibling selectOptionByValueFragment() already does. Co-authored-by: barbaragr <barbara.grajczyk@ez.no> Co-authored-by: Claude Opus 5 (1M context) <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.



v4.6Autosave.feature:29("Content item is not autosaved and draft is not visible in dashboard when autosave is disabled") fails intermittently on the stepI disable autosave:Seen in ibexa/headless run 34428511763 (branch 5.0, 2026-09-10), where
Autosave.featurepassed on 2 of the 3 matrix legs in the same run and failed only on MySQL 8.4 / Solr 8 / Redis.Cause
disableAutosave()clicks the dropdown and callsselectOption()right away, andselectOption()had no wait at all — it went straight tofindAll()->getByCriterion().That is not enough, because
BaseElement::internalFindAll()waits only for raw CSS matches and applies the locator criteria — including theVisibleCSSLocatorvisibility check — after the wait loop has ended. While the popover is already in the DOM but not yet visible, the filtered collection comes back empty andgetByCriterion()throwsCollection is emptyimmediately, without anyTimeoutException.ElementExistsConditionis the right tool here: itsisMet()callsfindAll(...)->any(), i.e. it checks the filtered collection, andwaitUntilCondition()polls it for the full timeout.Fix
Wait with
ElementExistsConditionbeforefindAll(), exactly the way the siblingselectOptionByValueFragment()in the same class already does. The asymmetry between those two methods looks accidental.selectOption()is used throughout the suite for every dropdown interaction, so the fix is not limited to the autosave scenario.For QA:
Behat only, no product code touched.
Checklist:
@ibexa/engineering).🤖 Generated with Claude Code