Skip to content

Refactor Cypress tests and ListBox component to improve selector usage#6727

Merged
Steve-Mcl merged 1 commit intomainfrom
fix/harden-listbox-selector-for-e2e-resilience
Feb 18, 2026
Merged

Refactor Cypress tests and ListBox component to improve selector usage#6727
Steve-Mcl merged 1 commit intomainfrom
fix/harden-listbox-selector-for-e2e-resilience

Conversation

@cstns
Copy link
Copy Markdown
Contributor

@cstns cstns commented Feb 18, 2026

Description

Intermittent E2E failures are occurring due to CSS transitions on the Listbox options component. Because of the 100ms transition duration, there is a brief window where multiple instances of the options panel exist in the DOM simultaneously. This is particularly problematic on broker pages, where tests rapidly toggle multiple select-box components that share identical values (e.g., "Yes/No" options).

Why it occurs mostly in CI:

  • CI environments are often slower and more variable than local machines, effectively widening the timing window where a "closing" listbox still resides in the DOM
  • since the options are "teleported" to the document body, panels from different listboxes become top-level siblings. This removes any natural parent container scoping, leading to selector collisions

I have hardened the Cypress selectors for the select-box and applied them to the teleported options panels. This ensures more specific targeting and prevents the test runner from interacting with a stale component during transitions.

Related Issue(s)

closes #6691

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@cstns cstns marked this pull request as draft February 18, 2026 11:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.65%. Comparing base (392a993) to head (ef3731c).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6727   +/-   ##
=======================================
  Coverage   76.65%   76.65%           
=======================================
  Files         398      398           
  Lines       20108    20108           
  Branches     4844     4844           
=======================================
  Hits        15414    15414           
  Misses       4694     4694           
Flag Coverage Δ
backend 76.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cstns cstns mentioned this pull request Feb 18, 2026
11 tasks
@cstns cstns requested a review from Steve-Mcl February 18, 2026 12:00
@cstns cstns marked this pull request as ready for review February 18, 2026 12:01
@Steve-Mcl Steve-Mcl merged commit 4949d70 into main Feb 18, 2026
47 checks passed
@Steve-Mcl Steve-Mcl deleted the fix/harden-listbox-selector-for-e2e-resilience branch February 18, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate and fix flaky e2e tests

2 participants