discourse/app/helpers
Alan Guo Xiang Tan 55b05c921b
DEV: Add client settled checks for system tests (#35230)
This change seeks to improve the reliability of our system tests by
resolving the lack of consistency in the state of the client side
application between steps in a system test. This is achieved by patching
various action methods in `Capybara::Playwright::Node` and
`Capybara::Playwright::Browser` so that the methods execute an async
JavaScript function on the client side that waits for the client side
application to reach a settled state. A settled state is currently
defined as:

1. No inflight ajax requests. (_messageBus and presence requests are
excluded_)
2. 2 event cycles of the Javascript event loop has happened for for all
"click", "input", "mousedown", "keydown", "focusin", "focusout",
"touchstart", "change", "resize", "scroll" DOM events that fired.

For debugging purposes, a `--debug-client-settled` CLI flag has been
added to `bin/rspec`. When used, detailed debugging information will be
printed to the browser's console as well as to `stdout` of the
`bin/rspec` process.

This change was inspired by
https://evilmartians.com/chronicles/flaky-tests-be-gone-long-lasting-relief-chronic-ci-retry-irritation
and the https://github.com/makandra/capybara-lockstep rubygem.
2025-10-10 11:03:18 +08:00
..
application_helper.rb DEV: Add client settled checks for system tests (#35230) 2025-10-10 11:03:18 +08:00
common_helper.rb Revert "DEV: Remove the word tags from adobe_analytics_tags_url" (#32490) 2025-04-28 22:46:28 +08:00
email_helper.rb DEV: update base url links to respect subfolder installs (#27740) 2024-07-09 12:42:38 +04:00
embed_helper.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
emoji_helper.rb FEATURE: Render emojis on GitHub labels when oneboxing an issue. (#13531) 2021-06-25 14:48:36 -03:00
list_helper.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
posts_helper.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
qunit_helper.rb DEV: Use rollup for theme JS compilation (#33103) 2025-07-25 12:02:29 +01:00
topic_post_bookmarkable_helper.rb DEV: Apply syntax_tree formatting to app/* 2023-01-09 14:14:59 +00:00
topics_helper.rb FEATURE: Localize topic view in crawler view (#34253) 2025-08-13 16:38:07 +08:00
user_notifications_helper.rb DEV: Refactors digest/summary email into partials (#33451) 2025-07-07 09:57:15 -05:00