Skip to content
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 in Cypress 3.1.0 seems to not trigger input #2555

Closed
jbreckman opened this issue Oct 2, 2018 · 9 comments
Closed

.type in Cypress 3.1.0 seems to not trigger input #2555

jbreckman opened this issue Oct 2, 2018 · 9 comments

Comments

@jbreckman
Copy link

We have an AngularJS app that suddenly started failing a few cypress tests. It seems that with cypress 3.1.0, when we call type on an input that is bound in angular, AngularJS doesn't pick the changes up.

Calling .trigger('input') directly seems to help.

We have a handful of extensions and angular plugins installed and I'm not sure if those are contributing to the problem. We are on 3.0.1 for now and it is working fine.

Sorry for not providing a smaller/easier to test use case. This is mostly here in case anyone else is experiencing similar problems.

@fijimunkii
Copy link

Possibly introduced with these "fixes" in cypress 3.0.3

  • We've loosened up the restrictions surrounding what we consider a typeable element.
  • Fixed other event related issues with .type() that were not firing correctly
  • Fixed issue where change events with .type() would not fire correctly for many more situations and edge cases
  • Fixed the vast majority of known issues with .type()

@LMulvey
Copy link

LMulvey commented Oct 2, 2018

@jbreckman Are you having these issues when running in Chrome 6*?
We're currently experiencing issues with our inputs when running in the Electron browser which is unavoidable when running on our CI.

@kthy
Copy link

kthy commented Oct 4, 2018

I'm experiencing the same problem on our Angular 5 app - and was able to mitigate by chaining a .trigger('input') on the end.

  • Windows 10
  • Cypress 3.1.0
  • Running tests in Chrome 69

@jbreckman
Copy link
Author

@kthy all browsers seemed affected. Try on Cypress 3.0.1... worked for us!

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Nov 10, 2018
@jennifer-shehane
Copy link
Member

Unfortunately we'll have to close this issue if no reproducible example is provided. Can anyone provide a way to reproduce this?

@aleissner
Copy link

aleissner commented Feb 3, 2019

Example HTML code to be tested:

<input type="text" oninput="console.log(event)">

Cypress test code:

cy.get('input').type('1')

Result: Console shows one event:

Event {isTrusted: false, type: "input", target: input, currentTarget: input, eventPhase: 2, …}

Manual Test without Cypress: Enter 1 into the input.
InputEvent {isTrusted: true, data: "1", isComposing: false, inputType: "insertText", dataTransfer: null, …}

Tested with Cypress 3.1.3 and Chrome 71 on Windows 10.

Cypress does not trigger an input event (https://developer.mozilla.org/en-US/docs/Web/API/InputEvent)
but a generic event with type=input (https://developer.mozilla.org/en-US/docs/Web/API/Event)

@Bender55
Copy link

Bender55 commented Mar 14, 2019

We just upgraded to from 3.0.1 to 3.1.5 and tests that could clear and type into a "time" input box no longer do so. What information do you need to help you? screen movie? code?
chrome 72 and electron on MacOS HighSierra 10.13.6. What is the recommend method of going back to a previous version of cypress?

@Bender55
Copy link

we upgraded to 3.2.0 and the issue is still present. Good news is I figured out how to successfully downgrade. Going back to 3.0.1

@sainthkh
Copy link
Contributor

Firing InputEvent has been fixed at #8255 and released at 5.2.0. If this problem still occurs, please open a new issue.

@jennifer-shehane jennifer-shehane removed the stage: needs investigating Someone from Cypress needs to look at this label Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants