Skip to content
Agentmart
Submit a tool

cypress-e2e

Cypress end-to-end testing patterns for reliable browser-based testing, covering selectors, custom commands, API mocking with cy.intercept, CI configuration…

Skill by dallay

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dallay-cypress-e2e

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Cypress end-to-end testing patterns for reliable browser-based testing, covering selectors, custom commands, API mocking with cy.intercept, CI configuration, and best practices for deterministic, maintainable E2E test suites. Use when the task involves `Cypress`, `E2E testing`, `cypress.config`, `end-to-end testing`, or `browser testing`.

Use cases: backend, testing, devops, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/cypress-e2e

What's inside

Skill name
cypress-e2e
Description
Cypress end-to-end testing patterns for reliable browser-based testing, covering selectors, custom commands, API mocking with cy.intercept, CI configuration, and best practices for deterministic, maintainable E2E test suites. Use when the task involves `Cypress`, `E2E testing`, `cypress.config`, `end-to-end testing`, or `browser testing`.
License
MIT
Metadata
version: 1.0.0
Instructions
250 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

## When to Use

- Writing end-to-end tests for web applications with Cypress.
- Setting up API mocking with `cy.intercept` for deterministic tests.
- Creating reusable custom commands for common workflows.
- Configuring Cypress for CI/CD pipelines.
- Debugging flaky E2E tests or improving test reliability.

## Critical Patterns

- **Use `data-cy` Attributes:** NEVER select elements by class name, tag, or content that changes
  with design or i18n. Use dedicated `data-cy` attributes that exist solely for testing.
- **No Arbitrary Waits:** NEVER use `cy.wait(5000)`. Always wait for specific conditions: route
  aliases, DOM elements, or assertions that Cypress retries automatically.
- **Test User Flows, Not Units:** E2E tests validate complete workflows (login → navigate → perform
  action → verify result). For isolated logic, use unit tests.
- **API-First Setup:** Use `cy.request()` or API calls to set up test state (create users, seed
  data) instead of navigating through the UI. Reserve UI interactions for what you're actually
  testing.
- **Each Test Stands Alone:** Tests must not depend on previous tests or shared state. Use
  `beforeEach` to set up and clean state for each test.

## Code Examples

### Test Structure with Selectors

```typescript
// cypress/e2e/dashboard.cy.ts
describe("Dashboard", () => {
  beforeEach(() => {
    // Set up state via API — fast and reliable
    cy.request("POST", "/api/test/seed", {fixture: "dashboard"});
    cy.loginByApi("admin@test.com", "password123");
    cy.visit("/dashboard");
  });

  it("displays project list with correct count", () => {
    cy.get("[data-cy=project-list]").should("be.visible");
    cy.get("[data-cy=project-card]").should("have.length", 3);
  });

  it("creates a new project", () => {
    cy.get("[data-cy=create-project-btn]").click();
    cy.get("[data-cy=project-name-input]").type("New Project");
    cy.get("[data-cy=project-form-submit]").click();

    // Assert on visible result, not internal state
    cy.get("[data-cy=project-card]").should("have.length", 4);
    cy.contains("[data-cy=project-card]", "New Project").should("exist");
  });

  it("filters projects by status", () => {
    cy.get("[data-cy=filter-dropdown]").click();
    cy.get("[data-cy=filter-option-active]").click();

    cy.get("[data-cy=project-card]").should("have.length", 2);
    cy.get("[data-cy=active-filter-badge]").should("be.visible");
  });
});
```

### Custom Commands

```typescript
// cypress/support/commands.ts
declare global {
  namespace Cypress {
    interface Chainable {
      loginByApi(email: string, password: string): Chainable<void>;

      getByDataCy(selector: string): Chainable<JQuery<HTMLElement>>;
    }
  }
}

// Login via API — skip the UI for non-login tests
Cypress.Commands.add("loginByApi", (email: string, password: string) => {
  cy.request("POST", "/api/auth/login", {email, password}).then((resp) => {
    window.localStorage.setItem("auth_token", resp.body.token);
  });
});

// Shorthand for data-cy selectors
Cypress.Commands.add("getByDataCy", (selector: string) => {
  return cy.get(`[data-cy=${selector}]`);
});
```

### API Mocking with cy.intercept

```typescript
describe("User Profile", () => {
  it("displays user data from API", () => {
    // Intercept and mock the API response
    cy.intercept("GET", "/api/users/me", {
      statusCode: 200,
      body: {
        id: "1",
        name: "Alice",
        email: "alice@test.com",
        role: "admin",
      },
    }).as("getProfile");

    cy.visit("/profile");
    cy.wait("@getProfile"); // Wait for the specific request

    cy.getByDataCy("user-name").should("contain", "Alice");
    cy.getByDataCy("user-role").should("contain", "admin");
  });

  it("handles API errors gracefully", () => {
    cy.intercept("GET", "/api/users/me", {
      statusCode: 500,
      body: {error: "Internal server error"},
    }).as("getProfileError");

    cy.visit("/profile");
    cy.wait("@getProfileError");

From dallay/agents-skills, MIT.

More from dallay/agents-skills

Signals

Stars
2
Forks
0
Open issues
3
Last commit (this folder)
Apr 4, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
1.0.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from dallay

Cite this page

cypress-e2e skill. Agent Mart. https://agentmart.dev/skills/dallay-cypress-e2e (last updated 2026-10-24)