From 3bcd5e71a19bd299ffad497db0d1d1733f4ae0d1 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Mon, 24 Aug 2020 15:38:58 +0200 Subject: [PATCH] Maintenance: Custom method `Capybara::Node::Element#in_fixed_postion` is error prone due to a race condition because first check is performed without a sleep. --- spec/support/capybara/custom_extensions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/capybara/custom_extensions.rb b/spec/support/capybara/custom_extensions.rb index a607d66e2..414db809f 100644 --- a/spec/support/capybara/custom_extensions.rb +++ b/spec/support/capybara/custom_extensions.rb @@ -18,7 +18,7 @@ class Capybara::Node::Element # @return [Capybara::Node::Element] the element/node def in_fixed_postion(checks: 100) - previous = native.location + previous = nil (checks + 1).times do |check| raise "Element still moving after #{checks} checks" if check == checks