Skip to content

fix(tests): wait for TinyMDE to be defined after page navigation - #178

Merged
jefago merged 1 commit into
mainfrom
fix/firefox-test-flakiness
Jun 28, 2026
Merged

fix(tests): wait for TinyMDE to be defined after page navigation#178
jefago merged 1 commit into
mainfrom
fix/firefox-test-flakiness

Conversation

@jefago

@jefago jefago commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes random Firefox test failures where TinyMDE is not defined errors were reported
  • Root cause: when all 3 browser projects (Firefox, Chromium, Webkit) run concurrently, tiny-mde.js occasionally fails to load in Firefox due to transient server contention; browsers still fire the load event even when a script fails to load, so waitUntil: 'load' resolved before TinyMDE was actually available
  • Adds a global.waitForTinyMDE(page) helper that uses Playwright's waitForFunction to explicitly wait for TinyMDE to appear in the browser global scope
  • Applied the check after every page.goto() call across all 6 test files

Test plan

  • Full test suite passes (684 passed, 684 total) across all 3 browsers
  • setup.test.js (the file where all 17 Firefox failures were observed) now consistently passes when run with all 3 projects concurrently

🤖 Generated with Claude Code

When all 3 browser projects run concurrently, tiny-mde.js occasionally
fails to load in Firefox due to transient server contention. Browsers
still fire the load event even when a script tag fails to load, so
waitUntil: 'load' was resolving before TinyMDE was actually available.

Adds a waitForTinyMDE helper that explicitly waits for TinyMDE to appear
in the browser global, and applies it after every page.goto() call across
all test files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jefago
jefago merged commit a17315b into main Jun 28, 2026
2 checks passed
@jefago
jefago deleted the fix/firefox-test-flakiness branch June 28, 2026 18:58
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.

1 participant