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

cypress-notifications-polling.jsonverifiers/

{
  "instruction": "Write E2E tests for a notifications page that polls for new updates and shows a notification badge",
  "relevant_when": "Agent writes Cypress E2E tests for polling, real-time updates, notification feeds, or badge counters",
  "context": "Proactively verify that agents apply Cypress best practices when testing time-dependent polling features. The scenario involves a page that periodically fetches new notifications and updates a badge count. The agent should use cy.clock()/cy.tick() to control polling intervals, cy.intercept() to stub successive API responses, and data-testid selectors. This scenario deliberately does not mention which Cypress APIs to use for timing.",
  "sources": [
    {
      "type": "file",
      "filename": "skills/cypress-testing/SKILL.md",
      "tile": "tessl-labs/cypress-testing"
    }
  ],
  "checklist": [
    {
      "name": "clock-for-polling",
      "rule": "Agent uses cy.clock() and cy.tick() to advance time and trigger polling intervals, rather than using cy.wait(ms) or waiting for real time to pass",
      "relevant_when": "Agent writes Cypress tests for features that poll on a timer or interval"
    },
    {
      "name": "intercept-notifications-api",
      "rule": "Agent uses cy.intercept() to stub the notifications API endpoint, aliased with .as() and awaited with cy.wait('@alias'). For polling tests, agent stubs successive responses (e.g., first call returns 0 notifications, second returns 3).",
      "relevant_when": "Agent writes Cypress tests for notification fetching or polling"
    },
    {
      "name": "data-testid-selectors",
      "rule": "Agent uses data-testid or data-cy attributes for notification items, badge count, and other UI elements -- not CSS classes",
      "relevant_when": "Agent writes Cypress selectors for notification UI elements"
    },
    {
      "name": "badge-count-verified",
      "rule": "Agent asserts on the notification badge count after new notifications arrive (e.g., .should('contain', '3') or .should('have.text', '3'))",
      "relevant_when": "Agent writes Cypress tests for notification badge display"
    },
    {
      "name": "empty-state-tested",
      "rule": "Agent writes a test for the zero-notifications state by stubbing the API to return an empty array and verifying the UI shows an appropriate empty state",
      "relevant_when": "Agent writes Cypress tests for notification list display"
    },
    {
      "name": "beforeeach-isolation",
      "rule": "Agent uses beforeEach() to set up clock, intercepts, and visit the page so each test starts with a clean state",
      "relevant_when": "Agent writes a describe block with multiple notification/polling tests"
    },
    {
      "name": "no-arbitrary-waits",
      "rule": "Agent does not use cy.wait(ms) with a numeric delay -- uses cy.clock()/cy.tick() for time advancement and cy.wait('@alias') for network calls",
      "relevant_when": "Agent writes Cypress tests with polling or timed features"
    }
  ]
}

tile.json