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": "Write E2E tests for a login flow and authenticated dashboard page",
"relevant_when": "Agent writes Cypress E2E tests for authentication flows, login pages, or protected dashboard pages",
"context": "Proactively verify that agents apply Cypress best practices when testing login and authenticated pages. The agent should use cy.session() to cache auth state, cy.intercept() for API mocking, data-testid selectors, and beforeEach for test isolation. This scenario does not mention specific Cypress patterns -- the agent should apply them from knowledge.",
"sources": [
{
"type": "file",
"filename": "skills/cypress-testing/SKILL.md",
"tile": "tessl-labs/cypress-testing"
}
],
"checklist": [
{
"name": "session-for-auth-caching",
"rule": "Agent uses cy.session() to cache the authenticated state so login is not repeated in full for every test. The session call should wrap the login steps and be invoked from beforeEach or a custom command.",
"relevant_when": "Agent writes multiple Cypress tests that require authenticated state"
},
{
"name": "login-custom-command",
"rule": "Agent extracts the login flow into a reusable custom command (Cypress.Commands.add) rather than duplicating login steps in every test",
"relevant_when": "Agent writes Cypress tests that require logging in"
},
{
"name": "data-testid-selectors",
"rule": "Agent uses data-testid or data-cy attributes for selecting form inputs, buttons, and dashboard elements -- not CSS classes or structural selectors",
"relevant_when": "Agent writes Cypress selectors for login form or dashboard elements"
},
{
"name": "intercept-api-calls",
"rule": "Agent uses cy.intercept() to stub or wait on API calls (e.g., login endpoint, dashboard data fetch) with aliases and cy.wait('@alias')",
"relevant_when": "Agent writes Cypress tests involving API interactions for login or data fetching"
},
{
"name": "beforeeach-test-isolation",
"rule": "Agent uses beforeEach() to set up each test independently (login + visit page), so no test depends on the state left by a previous test",
"relevant_when": "Agent writes a describe block with multiple dashboard or auth tests"
},
{
"name": "error-state-tested",
"rule": "Agent writes at least one test for a login error state (wrong credentials, API failure) using cy.intercept() to stub an error response",
"relevant_when": "Agent writes Cypress tests for a login flow"
},
{
"name": "no-arbitrary-waits",
"rule": "Agent does not use cy.wait(ms) with a numeric delay -- uses assertions or cy.wait('@alias') instead",
"relevant_when": "Agent writes Cypress tests with async operations"
},
{
"name": "url-assertion-after-login",
"rule": "Agent asserts on the URL after login (e.g., cy.url().should('include', '/dashboard')) to verify navigation succeeded",
"relevant_when": "Agent writes Cypress tests for login redirect behavior"
}
]
}