Skip to content

Commit

Permalink
fix for javascript vs no-js cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
martyn-w committed Jul 30, 2024
1 parent cafd58a commit 9f380c6
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@
Given("I have completed the education form") do
visit path_for 'education', school: @school
choose 'Graduate or postgraduate'
fill_in "What subject are you studying?", with: "Physics"

subject_field = find_field("What subject are you studying?")
subject_field.fill_in(with: "Physics")

unless subject_field.native.is_a?(Nokogiri::XML::Element)
# Unless we are using the standard rack-test driver (which does not support
# javascript), we need to change the focus off the control before continuing
subject_field.send_keys :tab
end

click_button 'Continue'
end

Expand Down

0 comments on commit 9f380c6

Please sign in to comment.