From 992964a64fe84b0a5a8bb8a5c9f0cc0f3843733b Mon Sep 17 00:00:00 2001 From: Henning Koch Date: Mon, 8 Jan 2024 16:58:07 +0100 Subject: [PATCH] Fix wait_tasks option not being respected --- lib/capybara-lockstep/helper.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/capybara-lockstep/helper.js b/lib/capybara-lockstep/helper.js index 9d547cd..3d3a4b5 100644 --- a/lib/capybara-lockstep/helper.js +++ b/lib/capybara-lockstep/helper.js @@ -257,7 +257,10 @@ window.CapybaraLockstep = (function() { function afterWaitTasks(fn, tasksLeft = waitTasks) { if (tasksLeft > 0) { - afterWaitTasks(fn, tasksLeft - 1) + // Wait 1 task and recurse + setTimeout(function() { + afterWaitTasks(fn, tasksLeft - 1) + }) } else { fn() }