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
{
"context": "Tests whether the agent proactively uses cy.session() for auth caching, custom commands, data-testid selectors, and Cypress best practices when writing E2E tests for a login flow and authenticated dashboard. The task describes only business requirements -- it does not prescribe Cypress patterns.",
"type": "weighted_checklist",
"checklist": [
{
"name": "cy.session for auth caching",
"description": "The agent uses cy.session() to cache the authenticated state so the full login flow is not repeated for every test. The session call wraps login steps and is invoked from beforeEach or a custom command.",
"max_score": 16
},
{
"name": "Login custom command",
"description": "The agent extracts the login flow into a reusable custom command (Cypress.Commands.add) in cypress/support/commands.ts rather than duplicating login steps in every test.",
"max_score": 12
},
{
"name": "data-testid selectors",
"description": "The agent uses data-testid or data-cy attributes for selecting form inputs, buttons, and dashboard elements -- not CSS class selectors or fragile structural selectors.",
"max_score": 14
},
{
"name": "cy.intercept with aliases",
"description": "The agent uses cy.intercept() to stub or spy on API calls (login endpoint, dashboard data) with .as() aliases and cy.wait('@alias') before asserting on results.",
"max_score": 14
},
{
"name": "beforeEach test isolation",
"description": "Each describe block uses beforeEach() to set up state independently (login, visit page, stub APIs) so no test depends on state from a previous test.",
"max_score": 10
},
{
"name": "No arbitrary waits",
"description": "The agent does not use cy.wait(ms) with a numeric delay. All waits use cy.wait('@alias') or rely on Cypress assertion retryability.",
"max_score": 10
},
{
"name": "Login error state tested",
"description": "At least one test covers a login failure scenario (wrong credentials or API error) using cy.intercept() to stub an error response.",
"max_score": 8
},
{
"name": "baseUrl in config",
"description": "cypress.config.ts sets baseUrl to http://localhost:3000 and tests use cy.visit('/') rather than hardcoding the full URL.",
"max_score": 8
},
{
"name": "URL assertion after login",
"description": "The agent asserts on the URL after login (e.g., cy.url().should('include', '/dashboard')) to verify navigation succeeded.",
"max_score": 8
}
]
}