From 412a3083176e9e353f0e1b3ef6b6f838f17cced0 Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Mon, 21 May 2018 16:34:00 -0700 Subject: [PATCH] Workaround geckdoriver/firefox issue with change event --- lib/capybara/spec/session/fill_in_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/capybara/spec/session/fill_in_spec.rb b/lib/capybara/spec/session/fill_in_spec.rb index dc69b000..7095841b 100644 --- a/lib/capybara/spec/session/fill_in_spec.rb +++ b/lib/capybara/spec/session/fill_in_spec.rb @@ -169,6 +169,8 @@ Capybara::SpecHelper.spec "#fill_in" do context 'on a pre-populated textfield with a reformatting onchange', requires: [:js] do it 'should only trigger onchange once' do @session.visit('/with_js') + # Click somewhere on the page to ensure focus is acquired. Without this FF won't generate change events for some reason??? + @session.find(:css, 'body').click @session.fill_in('with_change_event', with: 'some value') # click outside the field to trigger the change event @session.find(:css, 'body').click