CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/cypress-testing

Cypress E2E testing patterns -- selectors, cy.intercept, cy.session, cy.clock, custom commands, test isolation, and anti-patterns

98

1.25x
Quality

99%

Does it follow best practices?

Impact

97%

1.25x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-2/

{
  "context": "Tests whether the agent proactively uses beforeEach for test isolation, avoids conditional testing, uses data-testid selectors, and configures baseUrl when writing E2E tests for a multi-step form wizard. The task describes only business requirements -- it does not prescribe Cypress patterns.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "beforeEach test isolation",
      "description": "Each test uses beforeEach() to start from a clean state (visit the onboarding page, optionally stub APIs). No test depends on a previous test having navigated to a particular step.",
      "max_score": 16
    },
    {
      "name": "No conditional testing",
      "description": "The agent does not use if/else based on DOM state to decide which step to interact with. Each test navigates deterministically through the required steps using explicit actions.",
      "max_score": 14
    },
    {
      "name": "data-testid selectors",
      "description": "The agent uses data-testid or data-cy attributes for selecting form fields, buttons, step indicators, and validation messages -- not CSS class selectors or structural selectors.",
      "max_score": 12
    },
    {
      "name": "baseUrl in config",
      "description": "cypress.config.ts sets baseUrl to http://localhost:3000 and tests use cy.visit('/onboarding') rather than hardcoding the full URL.",
      "max_score": 10
    },
    {
      "name": "cy.intercept for form submission",
      "description": "The agent uses cy.intercept() with .as() alias for the POST /api/onboarding endpoint and waits with cy.wait('@alias') to verify the submission completes before asserting on the success page.",
      "max_score": 12
    },
    {
      "name": "Custom command for step navigation",
      "description": "The agent extracts the multi-step form filling into a reusable custom command or helper function (e.g., fillStep1, completeAllSteps) to avoid duplicating form interactions across tests.",
      "max_score": 10
    },
    {
      "name": "Validation error testing",
      "description": "At least one test verifies that validation errors appear when required fields are empty or invalid, and that the Next button is disabled until fields are valid.",
      "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": 8
    },
    {
      "name": "Back navigation tested",
      "description": "At least one test verifies that clicking 'Back' returns to the previous step with previously entered data preserved.",
      "max_score": 8
    }
  ]
}

evals

tile.json