Closed jmuheim closed 7 years ago
That doesn't sound always possible, what's your test driver for doing that?
If you are satisfied with this one
$('.test')[0].dispatchEvent({
clipboardData: {
type: 'image/png',
items: [{
getAsFile: function () { /* return the blob of the image file */ }
}]
}
});
This is what we are expecting from Chrome's API.
I'm using Ruby on Rails with RSpec, Capybara, and PhantomJS. It's pretty cool, but for JavaScript testing it's rather limited. We'll see what I can do with the code you posted above... Thank you.
Hello
Is there a way to fake the paste event? I need to test my JavaScript code and don't know how to trigger the event.
Thank you.