When I attach the file "file name" to "input file"

This step definition serves as a command to upload a file to an input file type element. The file to be uploaded is identified by its name and extension.

When (I|we)* attach the file "([^"]*)?" to "([^"]*)?"

Create a step that enables attaching a file to a field identified by its id|class|name|label.

 

Before utilizing this step definition, ensure that you have previously uploaded the chosen file to the "tests/assets" directory with the appropriate file name.

 

Example by id:

When I attach the file "profileIcon.jpg" to "myfile"