```ruby
When(/^I select an image for the (?:detailed guide|publication)$/) do
  within ".images" do
    attach_file "File", jpg_image
    find(".js-upload-image-input").click # Click event necessary for fieldset cloning.
    fill_in "Alt text", with: "minister of funk", match: :first
  end
end
```

Fix selenium error for forcing click on input type=file
user
```ruby
When(/^I select an image for the (?:detailed guide|publication)$/) do
  within ".images" do
    attach_file "File", jpg_image
    # Click event necessary for fieldset cloning - attaching file doesn't seem
    # to trigger the click event
    page.execute_script("document.querySelector('.js-upload-image-input').dispatchEvent(new CustomEvent('click', { bubbles: true }))")
    fill_in "Alt text", with: "minister of funk", match: :first
  end
end
```
assistant