-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
type('{enter}') doesn't fire input event #3405
Comments
Yes, I can see that the enter is not creating a new line within the editor. Wanted to make sure you were familiar with this existing issue with ace editor also #1818 Yeah, you'll have to figure out what event or logic ace editor is listening for in order to create the newline in their editor. I tried to add some keyboard event listeners to see, but wasn't able to track it down at the moment. |
Thanks for the update, @jennifer-shehane. It looks like they are just relying on the browser itself to set the |
Issue #311 will definitely help with these types of issues. As a workaround today, you can trigger any events, including |
@fr0 Yes, this is a bug. we have hard-coded no input events when pressing here's the LOC causing that logic: https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cypress/keyboard.coffee#L151 as a workaround: .type('{enter}').trigger('input') |
@devil-pc What event is your application code listening for to trigger the GET. |
Hello Jennifer - i will try to explain from the functional point of view:
Now, because I am unable to send the Enter key using Cypress - we are stuck on the development for the automated test... We have tried multiple approaches like:
Are we doing something wrong? |
Hello all. Thank you @bkucera - with your suggestion I managed to solve the problem.... The code is like this: cy.get('#map-autocomplete').type('2A Margate Rd, Singapore 438073') //we insert the address
cy.wait(3000) / we wait for Google Maps to return a result
cy.get('.pac-item').first().click({force: true}) //we click on the first result
cy.get('#map-autocomplete').type('{downarrow}{enter}') // we send the Enter to the input field It works but the sending of the Enter key is not a clean one.... Have a great day, Clau |
I would suggest avoiding such static waits b/c sometimes it would not pass on time. Better record the request you are waiting for and using |
I agree @RockChild we should never use waits like the one I described above - this was just an example ...in the real world we are waiting for the response.....anyway with the Version 3.4.0 of Cypress the sending of the Enter key was fixed.. Have a great day, Clau |
The code for this is done in cypress-io/cypress#4870, but has yet to be released. |
Released in |
Current behavior:
I'm trying to test an app with the ace editor ( https://ace.c9.io/ ), which uses a
textarea
, but I'm running into a problem:It types 'foo' but does not press the Enter key.
Desired behavior:
Using
{enter}
intype
should press the Enter key.Steps to reproduce: (app code and test code)
See above.
Versions
3.1.5, Chrome 72, MacOS
The text was updated successfully, but these errors were encountered: