Cypress
Cypress end-to-end test rules. Apply to TypeScript/TSX sources that use the Cypress runner (cy.* commands and Mocha-style describe/it blocks). Mirror the rule set from eslint-plugin-cypress and detect Cypress-specific anti-patterns such as async test bodies, missing assertions before screenshots, or deprecated XPath selectors.
Source: eslint-plugin-cypress (MIT).
cypress/assertion-before-screenshot: Require at least one Cypress assertion beforecy.screenshot().cypress/no-and: Prefercy.should()over.and()when starting a Cypress assertion chain,.and()only makes sense after a preceding.should().cypress/no-assigning-return-values: Reject assigning the return value of a Cypress command.cypress/no-async-before: RejectasyncCypressbefore/beforeEachhooks.cypress/no-async-tests: RejectasyncCypressit/specifytest callbacks.cypress/no-chained-get: Reject chained.get(...).get(...)calls.cypress/no-debug: Rejectcy.debug()and chained.debug()commands.cypress/no-force: Reject{ force: true }on Cypress action commands such as.click({ force: true }).cypress/no-pause: Rejectcy.pause()and chained.pause()commands.cypress/no-unnecessary-waiting: Reject numericcy.wait(ms)sleeps. They create flaky tests.cypress/no-xpath: Rejectcy.xpath(...)selectors.cypress/require-data-selectors: Requirecy.get()selectors to target adata-*attribute when the selector is a string literal, separates testing concerns from styling.cypress/unsafe-to-chain-command: Reject chaining further Cypress commands after action commands.
Last updated on