Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

You can use example below to upload files.


Facts


Make sure that you have folder structure below.


# Your application
football
build
dummy
document
hello.doc
world.xls
image
test.jpg

Behat.yml


Apart from other common setting, you must define file_path key.


default:
extensions:
Behat\MinkExtension\Extension:
files_path: %behat.paths.base%/build/dummy/

Feature


Actual built-in method is here.


Feature: Example feature

Scenario: I can upload image
Given I am on "/"
When I attach the file "image/test.jpg" to "league_flag"
And I press "Submit"
Then I should see "Succeeded."