From 135e61fa58d3896d7a1bf0bb80a9fef369f63b32 Mon Sep 17 00:00:00 2001 From: Henning Koch Date: Mon, 8 Jan 2024 20:56:39 +0100 Subject: [PATCH] Test that wait_tasks config is respected --- spec/features/synchronization_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/features/synchronization_spec.rb b/spec/features/synchronization_spec.rb index 7919cb7..6f1f57f 100644 --- a/spec/features/synchronization_spec.rb +++ b/spec/features/synchronization_spec.rb @@ -112,6 +112,24 @@ end + it 'stays busy for the configured number of tasks' do + Capybara::Lockstep.mode = :off + Capybara::Lockstep.wait_tasks = 10 + + App.start_html = <<~HTML + label + HTML + + visit '/start' + page.find('a').click + + expect(page.evaluate_script('CapybaraLockstep.isBusy()')).to eq(true) + + sleep (0.004 * 10) + + expect(page.evaluate_script('CapybaraLockstep.isBusy()')).to eq(false) + end + end describe 'when reading elements' do