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

Add unsafe-to-chain-command exception for type and clear commands when used together #132

Open
fuxingloh opened this issue Apr 8, 2023 · 7 comments

Comments

@fuxingloh
Copy link

According to the Cypress documentation on clear, it is considered a correct usage to chain the clear command with the type command, and vice versa:

cy.get('input[name="name"]').clear().type('Jane Lane')
cy.get('input[name="name"]').type('Jane Lane').clear()

As of v2.13.2, the current lint rule does not allow this usage.

@nagash77
Copy link
Contributor

@fuxingloh , Thank you for submitting your feature request. Cypress Product Managers will review this request and consider it for future implementation. Please remember we cannot guarantee this will be implemented in a specific timeframe or at all. Please see the Cypress App Product Roadmap for what we currently have in the works.

@websitevirtuoso
Copy link

yes. I just had to ingore this eslint rule. I have too many cases

  cy.getBySel('post.title').find('input').clear().type(newPost.title)

@dqiubread
Copy link

Any update on this change?

@corydeppen
Copy link

It's been a year since this was reported. Can a maintainer at least confirm that this is something that needs to be addressed in the plugin or if the docs aren't completely accurate and the plugin is reporting correctly?

@oracast
Copy link

oracast commented Apr 5, 2024

it is dead. just move to playwright

@dqiubread
Copy link

It's been a year since this was reported. Can a maintainer at least confirm that this is something that needs to be addressed in the plugin or if the docs aren't completely accurate and the plugin is reporting correctly?

This PR should fix it but it hasnt been merged. https://github.com/cypress-io/eslint-plugin-cypress/pull/141/files
In the meantime my team decided to use patch-package with the changes in the PR to fix it.

@dqiubread
Copy link

It's been a year since this was reported. Can a maintainer at least confirm that this is something that needs to be addressed in the plugin or if the docs aren't completely accurate and the plugin is reporting correctly?

This PR should fix it but it hasnt been merged. https://github.com/cypress-io/eslint-plugin-cypress/pull/141/files In the meantime my team decided to use patch-package with the changes in the PR to fix it.

Sorry just realized this is on type and clear command chaining and not the chaining custom commands to other commands. My team decided to just un chain them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants