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

Sometimes inputs appear to be incorrectly marked as disabled for typing #22872

Closed
emmanuelonah opened this issue Jul 20, 2022 · 2 comments
Closed
Assignees
Labels
stage: awaiting response Potential fix was proposed; awaiting response

Comments

@emmanuelonah
Copy link

emmanuelonah commented Jul 20, 2022

I'm seeing something similar after upgrading from 7.7.0 to 8.5.0. I've even added an assertion as shown below in the hopes to tease out the issue but the assertion passes and then the next line complains about the error mentioned in the original post.

cy.get("[name=zip]").should("not.be.disabled").type(zip);

image

In my case I was able to get these cases working instead by forcing focus.

cy.get("[name=zip]").focus().should("not.be.disabled").type(zip).focus().blur();

Also BTW, this post on a separate issue seems to be highlighting the experience I've repeated and demonstrated above as well.

Based on what I'm seeing right now I'll be sticking back onto 7.7.0 until this gets resolved or until I have time to help dig further into the root cause or help to arrive at a solution.

Me too after upgrading to 9.3.1, it started happening.

Meanwhile, @jennifer-shehane mentioned here that the reason for such behaviors is because the cypress tries to perform an action on a DOM Node before the actual node/element-node is mounted/rendered into the DOM. But then my fear is; that if we decide to do a synchronous cy.wait, that will be very unstable since we don't know the time frame.

My other solution was to chain the then method to the element before performing an action on it, the reason for thinking that way is that; it will only perform the action when the element is resolved since cypress says every query is promisified here. But then this still doesn't work. Right now I don't know what to do.

cy.get(selectorHere).then(node=>{
//now use it safely, but unfortunately this still doesn't work
})

Originally posted by @emmanuelonah in #5830 (comment)

@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 20, 2022
@nagash77 nagash77 changed the title > I'm seeing something similar after upgrading from 7.7.0 to 8.5.0. I've even added an assertion as shown below in the hopes to tease out the issue but the assertion passes and then the next line complains about the error mentioned in the original post. I'm seeing something similar after upgrading from 7.7.0 to 8.5.0. I've even added an assertion as shown below in the hopes to tease out the issue but the assertion passes and then the next line complains about the error mentioned in the original post. Jul 21, 2022
@marktnoonan marktnoonan changed the title I'm seeing something similar after upgrading from 7.7.0 to 8.5.0. I've even added an assertion as shown below in the hopes to tease out the issue but the assertion passes and then the next line complains about the error mentioned in the original post. Sometimes inputs appear to be incorrectly marked as disabled for typing Jul 23, 2022
@marktnoonan
Copy link
Contributor

@emmanuelonah I agree this should be investigated, seems a few people are seeing it, and in various situations. Did you try the workaround mentioned here with .blur()?

Can you share a reproducible example with me where this is happening and we can debug from there? Cloning https://github.com/cypress-io/cypress-test-tiny and adding your code to that would be great.

Right now it's difficult to help you since I don't know the code, sequence of things happening in the test, and the specific DOM where this is occurring. This is not to say what you're seeing isn't happening, I just need more info to recreate this.

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Jul 23, 2022
@marktnoonan
Copy link
Contributor

@emmanuelonah Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

When opening an issue, please fill out the issue template provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: awaiting response Potential fix was proposed; awaiting response
Projects
None yet
Development

No branches or pull requests

2 participants