Skip to content

Commit

Permalink
cucumber step fixes for javascript vs no-javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
martyn-w committed Jul 24, 2024
1 parent 4992906 commit c17b407
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions features/step_definitions/candidates/registrations/wizard_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@
Given("I have completed the education form") do
visit path_for 'education', school: @school
choose 'Graduate or postgraduate'
# The auto-complete dropdown list doesn't support the "select" method, so we
# need to fill in the inputbox and then tab to the next field instead
fill_in("What subject are you studying?", with: "Physics").send_keys :tab
subject_field = find_field("What subject are you studying?")
if subject_field.tag_name == "select"
# When javascript is disabled, the autocomplete becomes a simple option list
# which we can simply select from
subject_field.select "Physics"
else
# Otherwise we should fill-in the value like an input box, and then press
# tab or enter to advance to the next field after filling-in
subject_field.fill_in(with: "Physics").send_keys :tab
end
click_button 'Continue'
end

Expand Down

0 comments on commit c17b407

Please sign in to comment.