-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyEvent does not seem to trigger events in tests using input helper #73
Comments
I'm a bit reluctant to add fixes for specific phantomjs bugs now that the project is officially defunct (the maintainer abandoned). @rwjblue What do you think? I'd rather consider phantom unsupported. |
Ugh, you're right @cibernox. Wow the PhantomJS abandonment is new to me, although I saw it coming... After digging through PhantomJS's repo, I did come across an open issue that hints to the |
@cibernox - Ya, agreed. I think phantom edge cases can be unsupported. We should just be reasonable about patches for them (e.g. if its a small change without adding tech debt it may be fine)... |
FWIW, I was using 0.4.1 when seeing this issue. When downgrading back to 0.3.9, the issue went away. |
I believe that some work was done to better mimic browser behaviour: 3d74137 @RuslanZavacky Do you recall what was the change? |
@cibernox I have some concerns about using KeyboardEvent, to be honest. Going back to like 'legacy' events kinda fixes most of the issues. But I am not exactly sure, which is the right path :) Maybe because KeyboardEvents are so different and have like 3 different ways how to use them (+ browser differences) |
I'm having the same issue using version |
@brandynbennett If it's possible, I'd recomend trying headless chrome instead of phantom. Faster, more reliable. We haven't decided yet if this is something we want to fix. |
@cibernox That worked great for me locally :) Unfortunately my CI environment doesn't have Chrome installed. I'd install it myself, but we have a dedicated team for deployments and it's a longer process to change our box setup :/ I asked the team if they could add it, but it'll probably be a while before they finish it. I'm ok to work around it for now though. Headless Chrome definitely seems like the way to go. |
FWIW, we've since ditched PhantomJS in favor of Headless Chrome as you all have suggested here and works perfectly. I guess I understand the reservations of spending extra effort to support PhantomJS since it is unmaintained and very likely to be dead soon. |
I'm experiencing a similar bug with the input helper on Here's my basic setup for the component: https://ember-twiddle.com/458c15dec9d3027cb92ee38c8e176e1a I'm trying to simulate a form submission when the enter key is pressed on the input.
|
Dug a little more and eventually came across Ember.TextField documentation that the Instead of using keyUp, I used keyPress instead. With keyPress, I do not have to set the |
I'm also seeing an issue with PhantomJS and |
This is what we've been using to get around the issue until we move to headless Chrome https://gist.github.com/nlfurniss/b6b8b69cdd9cb325d9339dfb5c8a6d92 |
Hello, thanks for creating this package!
Currently, using
keyEvent()
, particularly for ENTER or ESC keycodes (13
and27
respectively), on an{{input}}
element in a component while running a phantomJS test does not fire the event.Take the following test:
After doing a bit of research, it appears that when creating events using
KeyboardEvents
orKeyEvents
in the fire-event.js, PhantomJS assigns allkeyCode
property on events to0
, for reasons I'm not too sure of. As a result, Ember is not able to correctly detect the pressed key becausekeyCode
is being set to0
by PhantomJS.A workaround was to create an event in a legacy way. For instance, instead of using
keyEvent
, triggering an event like this works.This may be something that phantomjs may be able to fix in its package, but I was thinking it wouldn't be unreasonable for this package to support this?
The text was updated successfully, but these errors were encountered: