discourse/plugins/automation
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
..
admin/assets/javascripts DEV: Remove unused service injections (#34750) 2025-10-08 13:31:41 +02:00
app DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
assets FIX: Improve automation on/off toggle (#33482) 2025-08-14 10:16:20 +03:00
config Update translations (#35031) 2025-09-29 10:26:53 +02:00
db FEATURE: Add automation statistics tracking to Automation (#31921) 2025-03-21 12:53:26 +11:00
lib DEV: Allow AI tagging automation to tag system-created topics (#35245) 2025-10-08 11:47:16 -04:00
spec DEV: Add client settled checks for system tests (#35230) 2025-10-10 11:03:18 +08:00
test/javascripts/integration/components FIX: ensures empty fields don't store an empty array (#33274) 2025-06-19 20:46:48 +02:00
plugin.rb DEV: add automation trigger on-close-topic (#34705) 2025-09-04 12:00:32 +02:00