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

This step defines the test for attaching files to the file input element, enabling their upload for use in a subsequent action.

 

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

 

A folder is added containing a set of test files (e.g., images, documents, etc.). These files are referenced and loaded into the file input element through feature steps. In the subsequent feature step, the required action is performed on the uploaded file.

 

Example:

When I attach the file "profileIcon.jpg" to "#profileIconUpload"