Ognjen Regoje bio photo

Ognjen Regoje
But you can call me Oggy


I make things that run on the web (mostly).
More ABOUT me and my PROJECTS.

me@ognjen.io LinkedIn

Filling a number field in cucumber tests

#cucumber #number field #rails #technical

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