Skip to content

fix: ensure listbox visibility before interacting with options in JWT.#939

Merged
jonathanp-okta merged 1 commit into
masterfrom
fix/broken-playwright-tests
Jul 21, 2026
Merged

fix: ensure listbox visibility before interacting with options in JWT.#939
jonathanp-okta merged 1 commit into
masterfrom
fix/broken-playwright-tests

Conversation

@jonathanp-okta

@jonathanp-okta jonathanp-okta commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Fixes a race condition in the Playwright E2E test suites for the decoder and encoder "generate JWT example" tests, which caused 13 hard failures and 39 flaky tests on CI.

The beforeEach hook clicked the algorithm picker to open the react-select dropdown but did not wait for the dropdown to finish rendering before the individual test attempted to click an option. Playwright would resolve the option element, then lose it as react-select re-rendered — producing consistent element was detached from the DOM timeouts even after 3 retries.

The fix adds a waitFor({ state: "visible" }) on the listbox role after opening the picker, ensuring the dropdown is fully rendered before any option interaction. The option click is also scoped to within the listbox container for added stability.

Scope is limited to e2e/decoder.spec.ts and e2e/encoder.spec.ts: no application logic, components, or library data are affected.

References

N/A

Testing

This is a test stability fix with no application logic changes:

  • CI verification: the 13 previously hard-failing chromium decoder tests and 39 flaky encoder/decoder tests across chromium and firefox should now pass consistently without retries.

  • No new application behavior to verify manually.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@github-actions

Copy link
Copy Markdown

Preview URL https://next-jwt-m16z9g0r0-okta.vercel.app

@jonathanp-okta jonathanp-okta self-assigned this Jul 20, 2026
@jonathanp-okta
jonathanp-okta marked this pull request as ready for review July 20, 2026 16:26
@jonathanp-okta
jonathanp-okta merged commit f2014e6 into master Jul 21, 2026
4 checks passed
@jonathanp-okta
jonathanp-okta deleted the fix/broken-playwright-tests branch July 21, 2026 17:24
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.

2 participants