e2e-earn

Runs and maintains Earn E2E tests for Ledger Wallet Desktop and Mobile.

615|491|Updated Jan 4, 2022
One-click install
npx skills add https://github.com/LedgerHQ/ledger-live --skill e2e-earn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: e2e-earn
Source: https://github.com/LedgerHQ/ledger-live/tree/main/.agents/skills/e2e-earn
Command: npx skills add https://github.com/LedgerHQ/ledger-live --skill e2e-earn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running and debugging Earn end-to-end tests in the Ledger Live monorepo involves fragile setup: Speculos device emulation, feature-flag routing, stale Electron builds, and webview context switching. This Skill guides you through running the earn.v2 and delegate suites correctly and triaging failures by category.

Core Features & Use Cases

  • Guided test execution: Confirms scope (earn.v2, delegate, desktop, mobile), verifies environment variables (MOCK, SEED, COINAPPS, SPECULOS_IMAGE_TAG), checks build freshness, then runs the correct Playwright or Detox commands.
  • Failure triage taxonomy: Classifies failures as environment, build, or test-flow mismatch with concrete fixes, such as rebuilding .webpack for domcontentloaded timeouts or pinning the Speculos image tag.
  • Page object maintenance: Documents current desktop and mobile Earn page objects, feature-flag model (EARN_V2_DESKTOP_FLAGS, FF_STAKE_PROGRAMS_MODAL), and webview resolution patterns for updating specs.
  • Use Case: A developer's Earn E2E run fails with a Speculos argument error; the Skill identifies the stale cached Docker image and provides the exact pin-and-pull fix.

Quick Start

Ask the assistant to run the Earn v2 desktop E2E tests and triage any failures that come up.

Frequently Asked Questions about e2e-earn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Earn E2E tests for Ledger Live Desktop?

Run pnpm e2e:desktop test:playwright earn.v2 or delegate from the repo root with MOCK=0, SEED, and COINAPPS set. Ensure Docker is running with the Speculos image pulled and the desktop app built via pnpm desktop build:testing.

How do I run Earn E2E tests on mobile with Detox?

From e2e/mobile, run pnpm test:android <earnSpecFile> or pnpm test:ios:debug <earnSpecFile> after building the app. Mobile runs require a built app plus a simulator or emulator, so confirm scope before starting.

Why does my Playwright test fail with a domcontentloaded timeout?

This almost always means a stale or partial .webpack build of the desktop app. Fix it with rm -rf apps/ledger-live-desktop/.webpack && pnpm desktop build:testing, then validate with a simple spec like add.account.

Why does Speculos fail with 'unrecognized arguments: -p'?

The cached Speculos Docker image is older than what the speculos-transport code expects. Pin SPECULOS_IMAGE_TAG to the SHA the code defaults to and run docker pull, since :latest is a moving tag that does not refresh automatically.

How do feature flags control native staking vs Earn dashboard redirect?

FF_STAKE_PROGRAMS_MODAL routes currencies: params.list uses native staking UI while params.redirects sends users into the Earn web app. For native ETH the redirect needs cryptoAssetId, intent deposit, and an ethDepositCohort value or the wrong screen appears.

Can I run only a single Earn test case instead of the whole suite?

Yes, append --grep to the Playwright command to filter by test title, for example pnpm e2e:desktop test:playwright earn.v2 --grep "Ethereum". The earn.v2 or delegate argument itself is a path substring filter matching spec file names.