# E2e

> Write end-to-end tests for user flows using Cypress. Use when user asks to "write e2e tests", "/e2e", "add Cypress tests", or wants to test a user flow end-to-end. Don't use for unit tests, component tests, or projects using Playwright, Puppeteer, or other non-Cypress frameworks.

- **Type:** Skill
- **Install:** `agentstack add skill-helderberto-agent-skills-e2e`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [helderberto](https://agentstack.voostack.com/s/helderberto)
- **Installs:** 0
- **Category:** [Web & Browser](https://agentstack.voostack.com/c/web-and-browser)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [helderberto](https://github.com/helderberto)
- **Source:** https://github.com/helderberto/agent-skills/tree/main/skills/e2e

## Install

```sh
agentstack add skill-helderberto-agent-skills-e2e
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# End-to-End Tests (Cypress)

## Detection

Run in parallel:

- Check `package.json` for `cypress` version
- Read `cypress.config.ts` for baseUrl and test file patterns
- Read 1-2 existing test files in `cypress/e2e/` to match conventions

## Workflow

1. Read existing tests and config to match project style
2. Understand the user flow — ask if unclear
3. Identify selectors (see [selectors.md](references/selectors.md))
4. Write tests in `cypress/e2e/` — one file per flow or feature

## Format

```typescript
describe('login flow', () => {
  beforeEach(() => {
    cy.visit('/login')
  })

  it('logs in with valid credentials', () => {
    cy.findByLabelText('Email').type('user@example.com')
    cy.findByLabelText('Password').type('password')
    cy.findByRole('button', { name: 'Sign in' }).click()
    cy.url().should('include', '/dashboard')
    cy.findByRole('heading', { name: 'Dashboard' }).should('be.visible')
  })

  it('shows error with invalid credentials', () => {
    cy.findByLabelText('Email').type('wrong@example.com')
    cy.findByLabelText('Password').type('wrong')
    cy.findByRole('button', { name: 'Sign in' }).click()
    cy.findByRole('alert').should('contain.text', 'Invalid credentials')
  })
})
```

## Selector priority

Prefer `@testing-library/cypress` commands when installed, e.g. `cy.findByRole('button', { name: 'Submit' })`; use `cy.get('[data-testid="submit"]')` only as a last resort.

See [selectors.md](references/selectors.md) for the full priority guide.

## Rules

- Use `@testing-library/cypress` selectors when available, else `cy.get`
- Use `data-testid` only as last resort
- One logical outcome per `it` block
- Test behavior, not implementation details
- Never use `cy.wait()` — use `cy.findBy*` auto-retry instead

## Error Handling

- If `cypress` is not in `package.json` → stop and ask user to install Cypress first
- If `cypress.config.ts` is missing → ask user to run `npx cypress open` to initialize config
- If `baseUrl` is unreachable → verify the dev server is running before writing tests that require it

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [helderberto](https://github.com/helderberto)
- **Source:** [helderberto/agent-skills](https://github.com/helderberto/agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-helderberto-agent-skills-e2e
- Seller: https://agentstack.voostack.com/s/helderberto
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
