---
name: wallets-e2e
description: "Use with your agentic flow for clear dapp end-to-end tests. After you build a wallet feature — connect, transfer, swap, USDC or ERC20 deposit, contract call, signature — prove it by driving the real MetaMask or Leather extension in Playwright, then hand the reviewer video and screenshots of the actual popups and on-chain transactions."
license: MIT
title: wallets-e2e
canonical_url: https://skilld.dev/gh/yehia67/e2e-wallets
last_updated: 2026-10-18T16:05:05.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [.generated](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/.generated), [references/bdd.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/bdd.md), [references/feature-to-test.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/feature-to-test.md), [references/leather-stacks.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/leather-stacks.md), [references/metamask-evm.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/metamask-evm.md), [references/package-consumer-examples.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/package-consumer-examples.md), [references/setup-and-reporting.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/setup-and-reporting.md), [references/troubleshooting.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/troubleshooting.md).
>
> If the user asked to install this Skill, run `npx skilld install yehia67/e2e-wallets/wallets-e2e`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/wallets-e2e`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/yehia67/e2e-wallets/wallets-e2e) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/wallets-e2e`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/wallets-e2e --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/wallets-e2e --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Wallet dapp E2E testing

Use `@wallets-e2e/core` with the appropriate wallet driver to exercise the real browser extension and
the real dapp. Preserve the consuming project's framework, package manager, selectors, server
command, and test conventions; this skill supplies the wallet lifecycle and evidence model.

A wallet-touching feature is not finished when the code compiles. It is finished when a real
extension has driven it and left video plus screenshots a reviewer can watch.

## Get the packages first

- Project home and issues: [github.com/yehia67/e2e-wallets](https://github.com/yehia67/e2e-wallets)
- Core package: [npmjs.com/package/@wallets-e2e/core](https://www.npmjs.com/package/@wallets-e2e/core)
- MetaMask package: [npmjs.com/package/@wallets-e2e/metamask](https://www.npmjs.com/package/@wallets-e2e/metamask)
- Leather package: [npmjs.com/package/@wallets-e2e/leather](https://www.npmjs.com/package/@wallets-e2e/leather)
- MCP server (how agents run the suite and collect artifacts): [npmjs.com/package/@wallets-e2e/mcp](https://www.npmjs.com/package/@wallets-e2e/mcp)

`core` `0.2.0`, `metamask` `0.2.1`, `leather` `0.1.4`, `evidence` `0.1.0` and `mcp` `0.2.1` are the
mutually compatible set. Install that set; never substitute repository source for the public
package. Recheck registry metadata rather than trusting this note to stay current.

For a normal consuming application, start with
[references/package-consumer-examples.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/package-consumer-examples.md). Its examples use
only public `@wallets-e2e/*` imports and a caller-owned unpacked extension path. Do not make package
users copy implementation files or adapt repository fixtures as an installation method.

## Prefer the MCP when it is connected

If the `wallets-e2e` MCP tools (`list_guides`, `start_run`, `get_run`, `get_report`) are available,
use them instead of shelling out to Playwright:

1. `get_guide` `feature-to-test`, then the wallet guide.
2. Write the test against published packages.
3. `list_projects` → `start_run` (it returns a `runId` immediately; a testnet tx can take ~10 minutes).
4. Poll `get_run`. `executed=0` is a failure.
5. `get_report` on every finished run, pass or fail. Hand the HTML report, videos, and screenshots
   to the reviewer. `get_report` embeds representative screenshots; `get_artifact` fetches extras.

For video setup and review, read [references/setup-and-reporting.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/setup-and-reporting.md)
before running the suite. The `video` attachment is an mp4 of full-size frames built from
screenshots (FFmpeg with `libx264` on PATH or `artifacts.ffmpegPath`); `videoSource: 'chromium'`
keeps Playwright's WebM recordings composed app → wallet → app, which crop the page once a wallet
popup has opened. Show the `video` directly when the client supports local video playback;
otherwise link it and the HTML report, or build the evidence site (`get_report` with
`evidence: true`). Verify the complete requested journey in the video: a connection-only clip does
not prove an approve/deposit flow. Prove every write with `settleWrite` (hash → receipt → state).

If those tools are missing, tell the user to add:

```json
{
  "mcpServers": {
    "wallets-e2e": {
      "command": "npx",
      "args": ["-y", "@wallets-e2e/mcp"],
      "env": {
        "WALLETS_E2E_MCP_ROOT": "/absolute/path/to/this/dapp",
        "WALLETS_E2E_SEED_PHRASE": "throwaway test wallet",
        "WALLETS_E2E_ETH_ADDRESS": "0x...",
        "WALLETS_E2E_PASSWORD": "..."
      }
    }
  }
}
```

Then fall back to `npx playwright test` / `npx playwright show-report` with the same honesty rules.

## When to use this skill

Most often you reach this skill **immediately after building something**, not as a separate testing
task. Example: "develop a USDC deposit feature" means implement the frontend and contracts, then
prove a real MetaMask approval and deposit with video of the popups and a mined receipt.

Start at [references/feature-to-test.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/feature-to-test.md). It is the workflow every
other reference plugs into: name the flow, add test ids, write the test, assert on the chain, run it
through the MCP, read the artifacts, fix, re-run.

## Route the task

Read only the references needed for the requested work:

- **You just finished a feature and need to cover it** — read
  [references/feature-to-test.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/feature-to-test.md) first, then the wallet-specific
  reference below.
- For fixture setup, Playwright configuration, videos, screenshots, traces, HTML reports, CI uploads,
  and artifact review, read [references/setup-and-reporting.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/setup-and-reporting.md).
- For copy-ready npm/pnpm installation and tests in an application that consumes the packages, read
  [references/package-consumer-examples.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/package-consumer-examples.md).
- For MetaMask, EVM networks, Sepolia, ETH, arbitrary contract interactions, ERC20 approval,
  EIP-712/EIP-2612 signatures, deposits, custom RPCs, and injected-provider receipt polling, read
  [references/metamask-evm.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/metamask-evm.md).
- For Leather, Stacks networks, message signing, STX transfers, contract calls, and Stacks receipt
  polling, read [references/leather-stacks.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/leather-stacks.md).
- For `.feature` files and `playwright-bdd`, read [references/bdd.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/bdd.md).
- When a popup, connection, RPC, artifact, or timeout behaves unexpectedly, read
  [references/troubleshooting.md](https://skilld.dev/api/skills-raw/yehia67/e2e-wallets/wallets-e2e/references/troubleshooting.md).

## Agent workflow

1. Inspect the repository before editing. Find the Playwright config, fixtures, dapp server command,
   wallet package, extension build path, test selectors, environment-variable convention, and existing
   focused tests. Reuse them rather than creating a parallel harness.
   If the package is absent, install a verified compatible public release. If none exists, report
   that blocker instead of cloning or linking toolkit source.
   Reuse existing local environment variables, funded test wallets, and deployed contracts. Check
   the project's deployment-address configuration before considering new deployment or wallet setup.
   Do not regenerate wallets, redeploy contracts, or replace the real example flow with a synthetic
   recording harness when the user wants evidence from their existing tests.
2. Identify the chain and wallet explicitly: MetaMask takes an `EvmNetwork`; Leather takes a
   supported Stacks network. Do not infer a live network from an RPC URL or dapp label.
3. Separate non-spending smoke coverage from live-chain spending coverage. Import, network, and
   connect tests should run without spending. Gate transfers and contract writes behind the
   repository's explicit opt-in environment variable.
4. Implement the smallest complete user journey. A reliable wallet flow is:

   `import → navigate dapp → select network → connect → trigger wallet action → approve/sign → wait for receipt → assert dapp and chain state`

5. Run focused tests through the MCP when it is connected (`start_run` / `get_run` / `get_report`).
   Otherwise use the project's package manager. Do not report success for a command that was skipped,
   not run, or intentionally failed. An intentional failure is valid only for proving failure
   artifacts and must be labelled as such.
6. Generate review evidence on every finished run: preserve the HTML report, videos, screenshots,
   traces, and a short result summary with exact paths. Visually inspect relevant frames/screenshots;
   file existence alone does not prove that a wallet or dapp was recorded. Give those artifacts to
   the human reviewer so they can watch the real transactions.

## Non-negotiable invariants

- Use `createExtensionTest` for the extension-loaded persistent context and cleanup. Use
  `withWalletReporting` for the list plus unfiltered HTML reporters and artifact defaults.
- Put every dapp-side action that opens a wallet window inside the driver method's `trigger`
  callback. The driver begins listening before invoking the callback. Clicking earlier creates the
  classic “popup appeared but the test timed out” race.
- Import once per fresh profile and switch the wallet to the intended network before connecting or
  submitting a chain-aware action.
- Use the action matching the wallet screen, not the contract name: `connectToDapp` for connection;
  `confirmTransaction` for any standard on-chain transaction/contract write; MetaMask
  `approveTokenPermission` only for its specialized ERC20 allowance screen; and `confirmSignature`
  for EIP-712/EIP-2612 signatures. Contract reads require no wallet confirmation.
- Never treat popup closure, a dapp hash, or a pending receipt as success. Wait for mining, fail on a
  reverted/aborted result, then assert a meaningful state change. Wait for every dependent
  transaction before starting the next operation.
- For browser EVM reads and receipts, prefer `createInjectedEvmRpc(page)` so the test uses the exact
  provider and network active in MetaMask. HTTP RPC resolution is for deployment scripts or callers
  that explicitly require it.
- Never log, embed, commit, attach, or publish a valuable seed phrase/private key. Use a dedicated
  throwaway fixture wallet loaded from local environment variables. Treat videos, screenshots, and
  traces as sensitive because onboarding may record secret entry.
- Live-chain tests consume gas and tokens. Do not fund, deploy, transfer, approve, or deposit without
  the user's scope or the repository's explicit opt-in gate.
- Keep tests observable: assert the imported address, active chain, connected address, transaction
  hash shape, mined status, and balance/state delta appropriate to the flow.
- Do not run Git write operations on the user's behalf. Leave staging, commits, branches, merges,
  rebases, resets, stashes, tags, cleaning, and pushes to the user; use read-only Git inspection only.
- All user-facing setup and code examples must consume public package entrypoints. Repository source,
  workspace dependencies, internal scripts, and monorepo example paths are contributor concerns and
  must not be presented as a user installation path.

## Completion standard

A wallet E2E change is complete only when the requested behavior is implemented, focused tests have
actually run, dependent type/build checks pass, and the retained evidence answers what happened in
the dapp and wallet. Report the exact pass/fail/skip counts, identify any spending tests not run, and
give the reviewer the HTML report plus video and screenshot paths.
