agentleFS
LedgerHQLedgerHQ/ledger-live/.agents/skills/e2e-swap/SKILL.md

e2e-swap

Skill627 starsChanged 10 days agoMITView on GitHub

Write or update Swap E2E tests for Ledger Live Desktop (Playwright) and Mobile (Detox). Use when working on swap spec updates, provider flows, multi-step approvals, page-object refactors, swap-history checks, KYC/validation banners, and review-driven cleanup.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not reintroduce removed helpers:

    line 48
  2. Very specific:

    Do not reintroduce tapSwapOnMultiStepApproval() unless a regression is proven and the reason is written down.

    line 67
  3. Very specific:

    Do not add unused icon selector fields (networkFeesInfoIcon, rateInfoIcon).

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Swap E2E Skill

Writing rules: when editing desktop, follow Desktop E2E. When editing mobile, follow Mobile E2E.

Use this skill when

  • Updating swap tests in e2e/desktop or e2e/mobile.
  • Refactoring swap page objects or moving reusable flow logic out of specs.
  • Fixing PR review comments about dead code, selector ownership, brittle amounts, or multi-step approval assertions.

Current source of truth

  • Desktop specs: e2e/desktop/tests/specs/*swap*.spec.ts
  • Desktop swap shared utils: e2e/desktop/tests/utils/swapUtils.ts
  • Desktop page objects:
    • e2e/desktop/tests/page/swap.page.ts — swap webview.
    • e2e/desktop/tests/page/drawer/swap.confirmation.drawer.ts — main window.
  • Mobile builders/specs:
    • e2e/mobile/specs/swap/otherTestCases/swap.other.ts
    • e2e/mobile/specs/swap/**/*.spec.ts
  • Mobile page objects:
    • e2e/mobile/page/liveApps/swapLiveApp.ts
    • e2e/mobile/page/trade/swap.page.ts

Swap rules

  • Reuse selectSpecificProvider(...) before adding a new provider helper.
  • Assert what the UI shows. Do not assert swap state by reading another repo on disk.
  • Fragile amounts come from the provider minimum, not a hardcoded value:
    • app.swap.getMinimumAmount(...) (desktop)
    • app.swapLiveApp.getMinimumAmount(...) (mobile)

Desktop API

Quote selection takes a SwapProvider. SwapProvider.CHANGELLY is disabled.

  • performSwapUntilQuoteSelectionStep({ app, swap, minAmount })
  • app.swap.selectSpecificProvider(provider)
  • await app.swap.getAmountToSend() only when a later assertion needs the amount

selectSpecificProvider and getAmountToSend do not take electronApp.

Do not reintroduce removed helpers:

  • checkBannerVisibility(...)
  • verifyContinueButtonVisible() on the desktop swap page
  • selectProviderQuoteWithRetry(...) in swap utils

Mobile API

Quote selection uses the provider UI name:

  • performSwapUntilQuoteSelectionStep(...)
  • app.swapLiveApp.selectSpecificProvider(provider.uiName)
  • await app.swapLiveApp.getAmountToSend() only when a later assertion needs the amount

A multi-step flow asserts progression, not only the click:

  • tapExecuteSwap(provider.uiName)
  • tapExecuteSwapOnStepApproval() waits for the approval button to become enabled and taps it; assert the post-click destination separately (for example, app.walletApiSignatureDrawer.expectVisible()).

Do not reintroduce tapSwapOnMultiStepApproval() unless a regression is proven and the reason is written down.

Swap history feedback is page-object driven: app.swap.checkSwapHistoryFeedbackFormUrl(expectedUrl). Assert the URL with value on iOS and label on Android.

Do not add unused icon selector fields (networkFeesInfoIcon, rateInfoIcon).

Quick checklist

  • Follow the conventions docs and typecheck each changed package (pnpm --filter ledger-live-desktop-e2e-tests typecheck and/or pnpm --filter ledger-live-mobile-e2e-tests typecheck).
  • Multi-step mobile flow has a post-click state assertion.
  • Amounts are not hardcoded where the minimum is provider-dependent.
  • Removed helpers above were not reintroduced.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.