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

Uploading a file in cucumber tests

#cucumber #file 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:

  And(/^I attach "(.*?)" to "(.*?)"$/) do |field, file|
    page.attach_file field, File.join(Rails.root, file)
  end