-
Notifications
You must be signed in to change notification settings - Fork 91
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
cy.focused().type("text") shows cypress/unsafe-to-chain-command error #140
Comments
Hi @BCaspari , you are correct that |
This would also impact cypress-io/cypress-example-kitchensink if it weren't for the fact that |
Even doing |
I believe this to be an unintended side effect from this change specifically: 49c6eb3#diff-43276831483080b5e9f5d83eb749bebf8e0d7167aa50c64cbc4fc1bcd7e0698bR121 Which comes from here: 49c6eb3#diff-43276831483080b5e9f5d83eb749bebf8e0d7167aa50c64cbc4fc1bcd7e0698bR111-R115 Seems like before this change, any selector had to exactly match the name of the "unsafe to chain" selectors. Now, because of the regex, if the selector's name partially matches one of the names, the linter will complain. e.g. |
Any progress on this one? Is there anything I could do to help? The issue and the cause seems to be identified. |
I've made a PR to illustrate the false positive, and a potential fix, here: #142 |
|
I believe so yes A more scalable solution is proposed in #141 (rather than the fast hotfix I did) - but for this specific bug the merged PR and new release solves it adequately 👍 |
the implementation is wrong.. Not only focused but every command that contains any of the unsafe to chain commands shows cypress/unsafe-to-chain-command error. Please check #141 because we have to rename our functions or disable linting and that's not the proper solution.. |
|
🎉 This issue has been resolved in version 3.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
After an update to 2.14.0, the cypress/unsafe-to-chain-command rule is triggered by code as
cy.focused().type("text")
.This should be no problem however, as the cypress docu states
cy.focused() is a query, and it is safe to chain further commands
(https://docs.cypress.io/api/commands/focused)The text was updated successfully, but these errors were encountered: