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.
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analyticsSkill
- batch-feature-devSkill
- ci-runnersSkill
- ci-workflow-refsSkill
- cleanupSkill
- client-idsSkill
- cloud-sync-moduleSkill
- codeownershipSkill
- coin-families-contractSkill
- coin-modulesSkill
- commentsSkill
- configurationSkill
- console-logSkill
- create-changesetSkill
- create-prSkill
- data-layer-advancedSkill
- debug-rn-native-crashSkill
- dependency-patchesSkill
- detect-data-leaksSkill
- device-intent-executorSkill
- devtools-import-boundarySkill
- dialogs-sliceSkill
- docs-migrateSkill
- docs-update-or-createSkill
- domain-dataSkill
- e2e-desktop-add-or-updateSkill
- e2e-desktop-onboardSkill
- e2e-earnSkill
- e2e-mobile-add-or-updateSkill
- e2e-mobile-onboardSkill
- errorsSkill
- feature-devSkill
- fix-ciSkill
- flow-packageSkill
- get-pr-commentsSkill
- git-conventionsSkill
- i18n-keysSkill
- impacting-prsSkill
- knip-migrationSkill
- ldls-nativeSkill
- ldls-webSkill
- ledger-wallet-cliSkill
- legacy-migrationSkill
- mvvm-architectureSkill
- new-packageSkill
- package-public-apiSkill
- pnpm-resolutionSkill
- prefer-set-hasSkill
- pre-reviewSkill
- react-generalSkill
- rebuild-to-fix-lib-import-errorsSkill
- remove-feature-flagSkill
- run-buildsSkill
- run-e2e-ciSkill
- runner-imagesSkill
- run-testsSkill
- slack-pr-messageSkill
- The first 60 shown.
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
- Distinctive: line 48
Do not reintroduce removed helpers:
- Very specific: line 67
Do not reintroduce tapSwapOnMultiStepApproval() unless a regression is proven and the reason is written down.
- Very specific: line 71
Do not add unused icon selector fields (networkFeesInfoIcon, rateInfoIcon).
≈ “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.
Files
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/desktopore2e/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.tse2e/mobile/specs/swap/**/*.spec.ts
- Mobile page objects:
e2e/mobile/page/liveApps/swapLiveApp.tse2e/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 pageselectProviderQuoteWithRetry(...)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 typecheckand/orpnpm --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.
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
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.

