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 cy.wait command when used with alias. #131

Open
patrickcate opened this issue Apr 7, 2023 · 2 comments

Comments

@patrickcate
Copy link

As mentioned in #127 (comment), one exception to the unsafe-to-chain-command rule is cy.wait when used with an alias:

// Example: assert status from cy.intercept() before proceeding
cy.wait('@alias').its('response.statusCode').should('eq', 200)

Currently the unsafe-to-chain-command is turned off for all cy.wait commands. Instead it would be most useful if the rule was applied for cy.wait commands unless they as used with an alias.

Example:

// BAD
cy.wait(5000);

// GOOD
cy.wait('@alias');
@nagash77
Copy link
Contributor

@patrickcate thank you for entering your request. We will review your request internally and decide if this is something we would be interested in implementing.

@brandonb927
Copy link

Came here and found this issue because my team also ran into a situation like this where I'm trying to enforce better practices of using aliases for wait rather than hard-coded numbers. I would love to be able to add a warning for the pattern of wait(Number) instead of wait(String).

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

3 participants