-
Notifications
You must be signed in to change notification settings - Fork 415
Events fired on fill_in #43
Comments
Looks like capybara-webkit manually fires the events in JS. We can do the same as a short-term solution, but in the longer term I'd like to submit a patch to PhantomJS to generate native keystrokes and let WebKit decide what events that should fire. |
+1 on this. Lots of autocomplete tests will probably need this. |
I personally wouldn't even delegate that task to PhantomJS. I see PJS as the Browser and Poltergeist (or any capybara driver) as the user at the keyboard. As a user, you type every key yourself and then blur out of the field to the next one or press a button. You don't "tell" the browser "paste that text here" and the Browser initializes keystrokes. But that's just my 5 cent. |
I had the same problem with using Poltergeist. But, might be I can fix it with Javascript and we can use it until Phantomjs fires these events by itself. As far as I understood those things from Webkit driver must be brought to the Poltergeist? I want to try to contribute that. |
@nestd yes, we can fire events with js until such time as we can get a patch in phantomjs to emulate proper "typing". Here's the code that currently sets input values - so you need to change that to closer resemble the capybara-webkit version. Thanks |
ok, I will do that |
This was fixed #54 |
This issue seems to have reappeared. I found that using I've worked around it with a little helper:
|
I too have found the the same issue with This does not trigger keydown events:
While this does:
The output from debug looks like this:
|
Thanks @benhoskings, the |
When erasing the content with: |
I am also experiencing this problem. |
I'm also bumping into it ; sadly, this is a feature that would make sense to test what happens when emptying a search field for example. (using poltergeist 1.10.0) |
I tried switching from capybara-webkit to poltergeist and stumbled over some differences, especially which events get fired.
When I execute fill_in on a textarea, CW fires:
Poltergeist fires:
This doesn't really simulate real user interaction and resulted in some broken tests in my suite.
The text was updated successfully, but these errors were encountered: