# Add E2E test

> Add E2E test is an open-source agent skill for developer tools. Guides an agent to write end-to-end tests that run the built CLI against real Metabase. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/metabase/metabase-cli/tree/main/.claude/skills/add-e2e-test
- **Repository:** https://github.com/metabase/metabase-cli
- **GitHub stars:** 20
- **License:** AGPL-3.0
- **Skill name:** add-e2e-test
- **Collection:** https://github.com/metabase/metabase-cli
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill teaches an agent how to add end-to-end tests for the Metabase CLI. The tests drive the built CLI binary against a live Metabase instance started with docker compose, without mocks, so they exercise real network and I/O behavior that unit tests cannot reach.

The skill sets out a pre-flight reading step through the existing e2e harness, then a runtime contract covering how to invoke the CLI, how to read bootstrap credentials, how to resolve seeded entity ids, how to gate suites on server capabilities, and how to isolate config homes per test. It also specifies strict assertion rules for exit codes, error messages and parsed JSON output.

It expects a TypeScript repository using bun and vitest, with a built CLI and a running Metabase stack. The skill includes a self-check grep list and a verification step that runs the project's check command before a test is reported as done.

## When your agent uses it

> Add an end-to-end test that drives the built CLI against a real Metabase via docker compose. Use whenever the user asks to "add an e2e test for `<command>`", "wire `<noun> <verb>` into tests/e2e", "cover the new command end-to-end", or anything that creates a file under `tests/e2e/`. Loading this skill is mandatory before generating any `tests/e2e/**/*.e2e.test.ts` file or modifying the e2e harness — the runtime contract is strict and easy to violate.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/metabase/metabase-cli/tree/HEAD/.claude/skills/add-e2e-test)
- [License: AGPL-3.0](https://github.com/metabase/metabase-cli/tree/HEAD/.claude/skills/add-e2e-test)

## Features

- **Harness-first test layout:** Points the agent to existing e2e files and harness modules before it writes anything new.
- **Strict CLI invocation rules:** Requires running the built CLI only through the shared runner with isolated config and no inherited environment.
- **Server capability gating:** Explains how suites skip or branch by Metabase feature so lanes pass or skip instead of failing.
- **Exact assertion guidance:** Specifies exact exit codes, full-object payload checks and envelope-aware error message matching.
- **Self-check and verification:** Provides grep checks for forbidden patterns and a final project check before a test is considered done.

## Good for

- Add an end-to-end test for a new Metabase CLI command
- Wire a new noun and verb into the e2e test folder
- Cover a CLI flag change against a real Metabase server
- Gate an e2e suite so it skips on servers lacking a feature

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/add-e2e-test` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/add-e2e-test &&
cp -R "$tmp/.claude/skills/add-e2e-test" ~/.claude/skills/add-e2e-test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/add-e2e-test` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/add-e2e-test` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/add-e2e-test &&
cp -R "$tmp/.claude/skills/add-e2e-test" ~/.agents/skills/add-e2e-test &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/add-e2e-test` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/add-e2e-test` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/add-e2e-test &&
cp -R "$tmp/.claude/skills/add-e2e-test" ~/.cursor/skills/add-e2e-test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/add-e2e-test` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/metabase/metabase-cli.git --path .claude/skills/add-e2e-test
```

Or copy the folder to `~/.gemini/skills/add-e2e-test` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/add-e2e-test`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/metabase/metabase-cli.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/add-e2e-test &&
cp -R "$tmp/.claude/skills/add-e2e-test" ~/.copilot/skills/add-e2e-test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/add-e2e-test` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/metabase/metabase-cli.git
```

Then copy `metabase-cli/.claude/skills/add-e2e-test` into your agent's skills folder as `add-e2e-test`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When should Add E2E test be used?

When adding an e2e test for a new command, when a command gains a flag or behavior unit tests cannot cover, or when creating a file under the e2e test folder.

### Should every new command get an e2e test?

Every new command needs one, but if the command can be fully covered by colocated unit tests, the skill says not to add an e2e test.

### Are mocks allowed in these tests?

No. The skill forbids vi.mock, vi.spyOn, vi.hoisted and vi.fn anywhere under the e2e folder.

### What must be running before the e2e suite runs?

The skill's local workflow requires building the CLI, starting the e2e stack and running bootstrap before the test command.

### How do I install Add E2E test in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/add-e2e-test to use it in all your projects, or to .claude/skills/add-e2e-test in one project.

### Does Add E2E test run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Add E2E test?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Add E2E test?

The closest alternatives to Add E2E test are Add resource command, E2E testing, E2E testing, E2E testing edho ferdian and Byot E2E validation.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Add resource command](https://ai-powered.com/skills/add-resource-command): Add resource command is an open-source agent skill for analytics and data.
- [E2E testing](https://ai-powered.com/skills/e2e-testing): E2E testing is an open-source agent skill for developer tools.
- [E2E testing](https://ai-powered.com/skills/e2e-testing-fmarzochi): E2E testing is an open-source agent skill for developer tools.
- [E2E testing edho ferdian](https://ai-powered.com/skills/e2e-testing-edho-ferdian): E2E testing edho ferdian is an open-source agent skill for developer tools.
- [Byot E2E validation](https://ai-powered.com/skills/byot-e2e-validation): Byot E2E validation is an open-source agent skill for developer tools.
- [Playwright E2E testing](https://ai-powered.com/skills/playwright-e2e-testing): Playwright E2E testing is an open-source agent skill for developer tools.
- [Metabase CLI](https://ai-powered.com/skills/metabase-cli): Metabase CLI is an open-source agent skill for analytics and data.
- [E2E playwright](https://ai-powered.com/skills/e2e-playwright): E2E playwright is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/add-e2e-test
