Skip to content

Latest commit

 

History

History
126 lines (83 loc) · 3.08 KB

File metadata and controls

126 lines (83 loc) · 3.08 KB

E2E Tests - Desktop

This folder contains the end-to-end (E2E) tests for the Ledger Wallet Desktop app. Dev teams are responsible for adding/updating tests when implementing new features.


Interactive Setup (Recommended)

Use the /e2e-desktop-onboard skill (from an agent tool that supports repo skills) for a guided walkthrough that checks every prerequisite, validates your environment, builds the app, and runs a smoke test.


Quick Start

All build and test commands below are run from the repo root (ledger-live/).

1. Prerequisites

  • Read the e2e environment guide
  • Docker Desktop installed and running (Speculos runs in Docker)
  • Pull the Speculos Docker image:
docker pull ghcr.io/ledgerhq/speculos:latest
  • Install mise, then from the repo root install the pinned toolchain:
mise install

2. Environment Variables

Set these environment variables before you run tests and change the values as per your testing needs:

export MOCK=0
export SPECULOS_IMAGE_TAG=ghcr.io/ledgerhq/speculos:latest
export SPECULOS_DEVICE=nanoSP       # Options: nanoSP | nanoX | nanoS | stax | flex | nanoGen5

Consider adding these exports to your profile so they persist.

3. Build

Before running tests, build the app and dependencies:

pnpm i --filter="ledger-live-desktop..."  --filter="live-cli..." --filter="ledger-live" --filter="@ledgerhq/dummy-*-app..." --filter="ledger-live-desktop-e2e-tests" --unsafe-perm
pnpm build:lld:deps
pnpm build:cli
pnpm desktop build:testing

🔹 Run this whenever the source code changes.

Install Playwright dependencies:

pnpm e2e:desktop test:playwright:setup

4. Run Tests

  • Run all tests
pnpm e2e:desktop test:playwright
  • Run a single test
pnpm e2e:desktop test:playwright <testFileName>

5. More Documentation

For detailed setup, debugging, and contribution guidelines, see: Ledger Wallet Desktop E2E Wiki

6. Custom feature flags with E2E_FEATURE_FLAGS_JSON override

You can inject extra feature flags globally for Desktop E2E by setting E2E_FEATURE_FLAGS_JSON.

Example shape:

{
  "myFeature": {
    "enabled": true,
    "params": {
      "foo": "bar"
    }
  }
}

Usage examples:

# Enable one feature with params
export E2E_FEATURE_FLAGS_JSON='{"myFeature":{"enabled":true,"params":{"foo":"bar"}}}'

Notes:

  • Arrays, scalars, or invalid JSON are rejected.
  • E2E_FEATURE_FLAGS_JSON OVERRIDES any other E2E feature flags.
  • Per-test featureFlags fixture values still override env-provided values when both set the same key.

7. Feature Flag presets

It is possible to choose an optional Feature Flag set for the test run.

Set the env var to the desired value, eg:

export E2E_DESKTOP_FEATURE_FLAGS="wallet40-q2"

Or use the "Choose a feature flag set" options dropdown on the Github workflow.