🔗 Parent Note
🤔 Situation
You want to atach a file to the input tag.
<label for='data-file'>Data File</label>
<input type="file" name="files" id="attach_files">
👍 Usual solution
Capybara::Node::Actions#attach_file
attach_file('data-file', 'path/to/file.csv')
🦄 Workaround solution
find('form input[type="file"]').set('path/to/file.csv')
Top comments (0)