Ognjen Regoje bio photo

MY NAME IS
Ognjen Regoje
BUT YOU CAN CALL ME OGGY


I make things that run on the web (mostly).
More /ABOUT me.

me@ognjen.io Twitter LinkedIn Instagram Github

Filling a number field in cucumber tests

In order to upload a file in a cucumber test, that is to use a file select input, define the following in your user_steps.rb:

  Then(/^I fill in number field "(.*?)" with "(.*?)"$/) do |field, value|
    # With JavaScript:
    page.execute_script("$(\"##{field}\").val(\"#{value}\")")
  end

#cucumber #number field #rails #technical