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."