.vbw-planning/milestones/07-rails-audit-and-refactoring/06-test-infrastructure/02-PLAN.md
Do NOT add purge_solid_queue_tables to base setup -- only dashboard tests need it. That goes in SystemTestHelpers as an opt-in method.
</action>
<verify>
ruby -c test/application_system_test_case.rb (syntax valid)
</verify>
<done>
ApplicationSystemTestCase has Capybara wait config, setup/teardown, screenshot-on-failure, and tmp cleanup
</done>
</task>
<task type="auto">
<name>Create SystemTestHelpers module</name>
<files>
test/support/system_test_helpers.rb
</files>
<action>
Create test/support/system_test_helpers.rb with a SystemTestHelpers module containing helpers extracted from system test files:
purge_solid_queue_tables -- from dashboard_test.rb (purges SolidQueue tables)seed_queue_activity(source:) -- from dashboard_test.rb (seeds queue data for testing)apply_turbo_stream_messages(page) -- from dashboard_test.rb (processes turbo stream messages in Capybara)parse_turbo_streams(html) -- from dashboard_test.rb (parses turbo stream HTML)assert_item_order(expected_titles) -- from items_test.rb (asserts item display order)Include this module in ApplicationSystemTestCase via require_relative + include. </action> <verify> ruby -c test/support/system_test_helpers.rb (syntax valid) </verify> <done> SystemTestHelpers module exists with all extracted helpers, included in ApplicationSystemTestCase </done> </task> <task type="auto"> <name>Refactor system tests to use shared base</name> <files> test/system/dashboard_test.rb test/system/items_test.rb test/system/logs_test.rb test/system/sources_test.rb test/system/mission_control_test.rb test/system/dropdown_fallback_test.rb </files> <action> For each system test file:
wait: 5 from assertions where Capybara's default_max_wait_time (now 5) handles it. Keep explicit waits only where they differ from default (e.g., wait: 10 for slow operations)