-
-
Notifications
You must be signed in to change notification settings - Fork 427
Possbility to test file upload initiated by javascript #546
Comments
This is an unfortunate side effect of the changes required to make capybara-webkit compatible with Qt 5.0. As of Qt 5, opening a file dialog must be initiated by a user action, which requires a "native click" event. There's an upstream QtWebKit bug which has gone unanswered for over a year. We've been unable to come up with an alternative solution to the click issue, however it has also caused other issues for users who have applied certain styling (inline-block) to elements, which WebKit is unable to click. There's also a Capybara 2.1 feature, |
@miks are you doing this using JavaScript so that you can style the upload button? Can you try a technique that doesn't hide the actual upload, like this one? http://www.quirksmode.org/dom/inputfile.html |
It's not related to style. We have upload functionality like this:
This approach allow to minimize UI for fast file upload. |
@miks did you solve this? I'm having trouble with this |
@acrogenesis I just made form and regular file input visible for tests like (here: https://github.com/cubesystems/releaf/blob/master/releaf-i18n_database/spec/features/translations_spec.rb#L78) |
Thanks that worked 👍 |
I'm closing this issue since it seems to be resolved. |
I have page to test where actual file upload input is hidden and upload itself is triggered with click event from simple button.
With capybara 2.1.0 and capybara webkit 1.0.0 I have no clue how to test this kind of interface. When test trigger click on UI button within capybara-webkit and save screenshot there is no upload dialog present (unlike in real browser).
Also "attach_file" method is failing as file upload input is hidden.
The text was updated successfully, but these errors were encountered: