Cypress E2E testing patterns -- selectors, cy.intercept, cy.session, cy.clock, custom commands, test isolation, and anti-patterns
98
99%
Does it follow best practices?
Impact
97%
1.25xAverage score across 4 eval scenarios
Passed
No known issues
{
"instruction": "Use data-testid attributes, cy.intercept() for API mocking, and proper Cypress patterns",
"relevant_when": "Agent writes E2E tests with Cypress",
"context": "Cypress tests must use data-testid/data-cy attributes or cy.contains() for stable selectors, never CSS class selectors or deep DOM paths. API mocking must use cy.intercept() (never cy.route/cy.server which are removed). Intercepts must be aliased with .as() and awaited with cy.wait('@alias'). Tests must use beforeEach for isolation and never use cy.wait(ms) for arbitrary delays.",
"sources": [
{
"type": "file",
"filename": "skills/cypress-testing/SKILL.md",
"tile": "tessl-labs/cypress-testing"
}
],
"checklist": [
{
"name": "stable-selectors",
"rule": "Agent uses data-testid or data-cy attributes or cy.contains() for element selection -- never CSS class selectors like .btn-primary or deep DOM path selectors like #root > div > button",
"relevant_when": "Agent writes Cypress test selectors"
},
{
"name": "no-arbitrary-waits",
"rule": "Agent does not use cy.wait(number) with a millisecond value -- uses assertions like .should('be.visible') or cy.wait('@alias') for network calls instead",
"relevant_when": "Agent writes Cypress tests that wait for async operations"
},
{
"name": "intercept-not-route",
"rule": "Agent uses cy.intercept() for API mocking and network stubbing, never cy.route() or cy.server() which are removed in modern Cypress",
"relevant_when": "Agent writes Cypress tests that mock or intercept network requests"
},
{
"name": "intercept-aliased-and-awaited",
"rule": "When using cy.intercept(), agent aliases the intercept with .as('name') and waits for it with cy.wait('@name') before asserting on results that depend on that network call",
"relevant_when": "Agent writes Cypress tests that intercept API calls and assert on the results"
},
{
"name": "beforeeach-isolation",
"rule": "Agent uses beforeEach() to set up test state (cy.visit, data seeding, intercepts) so each test is independent and can run in any order",
"relevant_when": "Agent writes a describe block with multiple Cypress tests"
},
{
"name": "no-conditional-testing",
"rule": "Agent does not use if/else conditional logic based on DOM state (e.g., checking if an element exists with .find().length inside .then()). Each test has a single deterministic path.",
"relevant_when": "Agent writes Cypress tests that handle variable UI states"
},
{
"name": "baseurl-configured",
"rule": "Agent configures baseUrl in cypress.config.ts and uses relative paths in cy.visit('/path') -- never hardcodes full URLs like cy.visit('http://localhost:3000/path') in test files",
"relevant_when": "Agent sets up Cypress configuration or writes cy.visit() calls"
}
]
}