discourse/plugins/discourse-topic-voting
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
..
app DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
assets DEV: Standardize Ember route, controller and template naming (#34417) 2025-09-25 11:27:45 +01:00
config Update translations (#35031) 2025-09-29 10:26:53 +02:00
db DEV: Promote historic core plugins post_deploy migrations (#34274) 2025-08-13 15:52:19 +08:00
lib/discourse_topic_voting DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
spec DEV: Add client settled checks for system tests (#35230) 2025-10-10 11:03:18 +08:00
test/javascripts/acceptance DEV: Fix various lint issues (#33811) 2025-07-24 15:27:04 +02:00
plugin.rb DEV: Clean up scope resolution operators in plugins (#34979) 2025-09-30 14:36:34 +02:00
README.md

Discourse Topic Voting

Adds the ability for voting on a topic within a specified category.

Topic discussing the plugin itself can be found here: https://meta.discourse.org/t/discourse-voting/40121