Skip to content

feat: add testing scenarios and testing agent#11491

Merged
gomesalexandre merged 2 commits intodevelopfrom
automate-testing
Dec 22, 2025
Merged

feat: add testing scenarios and testing agent#11491
gomesalexandre merged 2 commits intodevelopfrom
automate-testing

Conversation

@NeOMakinG
Copy link
Collaborator

@NeOMakinG NeOMakinG commented Dec 18, 2025

Description

Include a bunch of claude files to automate testing features, discovering

It's a WIP and we will want to improve it a lot during the long run but it works quite well for now (tested on a release and a few PRs)

Issue (if applicable)

No issue

Risk

Low, nothing at runtime

High Risk PRs Require 2 approvals

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

Testing

Engineering

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

Screenshots (if applicable)

Summary by CodeRabbit

  • Documentation

    • Added comprehensive testing agent documentation, quick-start guide, and test scenario templates for improved test coverage.
    • Introduced detailed test scenarios for critical features including wallet connection, asset swaps, chain integration, and cross-chain transactions.
    • Added feature discovery guide and reporting framework for systematic application testing.
  • Tests

    • Established test scenario bank with prioritized scenarios covering critical workflows, high-priority features, and regression testing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

📝 Walkthrough

Walkthrough

Introduces comprehensive testing framework documentation for ShapeShift Web, including an AI-powered Testing Agent, test scenario templates, multiple end-to-end test examples covering critical flows (wallet connection, asset swaps, chain integration), feature discovery guides, and quality assurance procedures. No executable code or public API changes are introduced.

Changes

Cohort / File(s) Change Summary
Test Agent Framework
\.claude/commands/test-agent.md, \.claude/test-scenarios/QUICK-START.md
New agent documentation defining persona, responsibilities, tools, and workflows; quick-start guide with prerequisites, commands, and example scenarios.
Test Scenarios Infrastructure
\.claude/test-scenarios/README.md, \.claude/test-scenarios/TEMPLATE.md, \.claude/test-scenarios/chain-integration-template.md
Directory structure, naming conventions, priority levels, usage commands, maintenance schedules, and standardized markdown templates for test scenario creation.
Critical Test Scenarios
\.claude/test-scenarios/critical/wallet-connection-flow.md, \.claude/test-scenarios/critical/asset-swap-flow.md
Step-by-step test procedures for wallet connection and DEX asset swap flows, including prerequisites, validation points, edge cases, and known issues.
High-Priority Feature Validation
\.claude/test-scenarios/high-priority/feature-flags-validation.md
Test scenario for feature flag validation with environment setup, flag behavior verification, and comprehensive testing checklist.
Feature Discovery
\.claude/test-scenarios/feature-discovery-guide.md, \.claude/test-scenarios/shapeshift-feature-discovery-report.md
Discovery process guide with navigation tree mapping, categorization methodology, automation pseudo-code, and comprehensive feature inventory report for ShapeShift Web.
Example Test Scenarios
\.claude/test-scenarios/markets-discovery-exploration.md, \.claude/test-scenarios/solana-chain-integration.md, \.claude/test-scenarios/swap-eth-to-btc-same-chain.md, \.claude/test-scenarios/relay-usdc-arbitrum-to-solana.md, \.claude/test-scenarios/swapper-testing.md
End-to-end test examples covering market exploration, Solana integration verification, cross-chain swaps, same-chain swaps, and multi-swapper aggregation testing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Template consistency & coverage: Verify test scenario templates are consistently applied across critical, high-priority, and example scenarios
  • Technical accuracy: Validate chain identifiers (CAIP-19, BIP-44), asset details, and blockchain-specific configuration in integration examples
  • Clarity & completeness: Review agent command documentation and quick-start guide for user clarity and step completeness
  • Feature discovery scope: Assess adequacy of identified features and test scenario coverage against application functionality

Suggested reviewers

  • gomesalexandre
  • premiumjibles

Poem

🐰 A warren of tests now guides our way,
With templates, scenarios, bright and gay,
From wallets to swaps, each flow's outlined clear—
The Testing Agent hops in without fear!
Documentation blooms in markdown delight,
Our QA journey now shines ever bright! 🎯

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: addition of testing scenarios and a testing agent framework for automation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch automate-testing

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 79f5545 and 0c4b5b5.

📒 Files selected for processing (15)
  • .claude/commands/test-agent.md
  • .claude/test-scenarios/QUICK-START.md
  • .claude/test-scenarios/README.md
  • .claude/test-scenarios/TEMPLATE.md
  • .claude/test-scenarios/chain-integration-template.md
  • .claude/test-scenarios/critical/asset-swap-flow.md
  • .claude/test-scenarios/critical/wallet-connection-flow.md
  • .claude/test-scenarios/feature-discovery-guide.md
  • .claude/test-scenarios/high-priority/feature-flags-validation.md
  • .claude/test-scenarios/markets-discovery-exploration.md
  • .claude/test-scenarios/relay-usdc-arbitrum-to-solana.md
  • .claude/test-scenarios/shapeshift-feature-discovery-report.md
  • .claude/test-scenarios/solana-chain-integration.md
  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
  • .claude/test-scenarios/swapper-testing.md
🧰 Additional context used
🧠 Learnings (34)
📓 Common learnings
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11170
File: patches/@shapeshiftoss+bitcoinjs-lib+7.0.0-shapeshift.0.patch:9-19
Timestamp: 2025-11-25T21:43:10.838Z
Learning: In shapeshift/web, gomesalexandre will not expand PR scope to fix latent bugs in unused API surface (like bitcoinjs-lib patch validation methods) when comprehensive testing proves the actual used code paths work correctly, preferring to avoid costly hdwallet/web verdaccio publish cycles and full regression testing for conceptual issues with zero runtime impact.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/pages/RFOX/components/Stake/components/StakeSummary.tsx:112-114
Timestamp: 2025-08-22T13:00:44.879Z
Learning: NeOMakinG prefers to keep PR changes minimal and focused on the core objectives, avoiding cosmetic or defensive code improvements that aren't directly related to the PR scope, even when they would improve robustness.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10128
File: .cursor/rules/error-handling.mdc:266-274
Timestamp: 2025-07-29T10:35:22.059Z
Learning: NeOMakinG prefers less nitpicky suggestions on documentation and best practices files, finding overly detailed suggestions on minor implementation details (like console.error vs logger.error) too granular for cursor rules documentation.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10380
File: src/pages/Dashboard/components/AccountList/AccountTable.tsx:60-0
Timestamp: 2025-09-02T08:34:08.157Z
Learning: NeOMakinG prefers code review comments to focus only on actual PR changes, not pre-existing code issues, unless there are critical security or correctness concerns directly related to the new functionality.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10234
File: src/components/MultiHopTrade/hooks/useGetTradeQuotes/hooks/useTrackTradeQuotes.ts:42-86
Timestamp: 2025-08-08T11:41:22.794Z
Learning: NeOMakinG prefers not to include refactors in move-only PRs; such suggestions should be deferred to follow-up issues instead of being applied within the same PR.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10380
File: src/components/Table/Table.theme.ts:177-180
Timestamp: 2025-09-02T12:38:46.940Z
Learning: NeOMakinG prefers to defer technical debt and CSS correctness issues (like improper hover selectors) to follow-up PRs when the current PR is already large and focused on major feature implementation, even when the issues are valid from a usability/technical perspective.
📚 Learning: 2025-10-22T22:11:22.918Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10879
File: src/context/WalletProvider/WalletConnectV2/components/WalletConnectDirectRow.tsx:64-81
Timestamp: 2025-10-22T22:11:22.918Z
Learning: In early WalletConnect POC/features behind a flag, gomesalexandre prioritizes connection correctness/stability over UX polish; minimal safety guards (like preventing concurrent connects) are preferred, while visuals will be wired later by reallybeard.

Applied to files:

  • .claude/test-scenarios/critical/wallet-connection-flow.md
📚 Learning: 2025-10-01T07:42:40.195Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10596
File: src/components/Layout/Header/NavBar/WalletConnectedMenu.tsx:77-99
Timestamp: 2025-10-01T07:42:40.195Z
Learning: In WalletConnectedMenu.tsx's handleReconnectWallet handler, gomesalexandre prefers throwing an error for unsupported wallet types in the default case rather than gracefully handling with a fallback. His reasoning: "if we have a problem here, we have bigger problems" - only supported wallets (KeepKey, Ledger, MetaMask, Coinbase, Phantom) should reach the reconnect flow when disconnected/locked, so encountering an unsupported type indicates a larger architectural issue that should be surfaced explicitly rather than masked with graceful degradation.

Applied to files:

  • .claude/test-scenarios/critical/wallet-connection-flow.md
📚 Learning: 2025-09-13T15:31:38.011Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/modals/SessionProposal.tsx:55-67
Timestamp: 2025-09-13T15:31:38.011Z
Learning: gomesalexandre tested WalletConnect method permissions with MetaMask and WalletConnect's official demo, finding that neither strictly honors method filtering by intersection of requested/supported methods. He prefers aligning with industry standard practices (granting broader EIP-155 method permissions) over theoretical security restrictions when real-world testing shows permissive behavior is the norm.

Applied to files:

  • .claude/test-scenarios/critical/wallet-connection-flow.md
📚 Learning: 2025-11-19T16:59:50.569Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11012
File: src/context/WalletProvider/Vultisig/components/Connect.tsx:24-59
Timestamp: 2025-11-19T16:59:50.569Z
Learning: In src/context/WalletProvider/*/components/Connect.tsx files across the ShapeShift web codebase, the established pattern for handling null/undefined adapter from getAdapter() is to simply check `if (adapter) { ... }` without an else clause. All wallet Connect components (Coinbase, Keplr, Phantom, Ledger, MetaMask, WalletConnectV2, KeepKey, Vultisig) follow this pattern—they reset loading state after the if block but do not show error messages when adapter is null. This is an intentional design decision and should be maintained for consistency.

Applied to files:

  • .claude/test-scenarios/critical/wallet-connection-flow.md
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: To add a new feature flag: (1) Add to `FeatureFlags` type in `src/state/slices/preferencesSlice/preferencesSlice.ts`, (2) Add environment variable validation in `src/config.ts`, (3) Add to initial state in `preferencesSlice.ts`, (4) Add to test mock in `src/test/mocks/store.ts`, (5) Set appropriate values in `.env`, `.env.development`, and `.env.production`

Applied to files:

  • .claude/test-scenarios/high-priority/feature-flags-validation.md
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Feature flags are stored in Redux state under `preferences.featureFlags`

Applied to files:

  • .claude/test-scenarios/high-priority/feature-flags-validation.md
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : Use `useFeatureFlag('FlagName')` hook to access feature flag values in components

Applied to files:

  • .claude/test-scenarios/high-priority/feature-flags-validation.md
📚 Learning: 2025-08-22T13:02:38.078Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/pages/Explore/Explore.tsx:91-92
Timestamp: 2025-08-22T13:02:38.078Z
Learning: In the ShapeShift web codebase, feature flags are consistently used as string literals with the useFeatureFlag hook (e.g., useFeatureFlag('RfoxFoxEcosystemPage')), not as enums. The hook accepts keyof FeatureFlags which provides type safety through the TypeScript type system rather than requiring an enum. This is the established pattern used throughout the entire codebase.

Applied to files:

  • .claude/test-scenarios/high-priority/feature-flags-validation.md
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: The `/flags` route provides a hidden UI for toggling feature flags at runtime (click settings modal header 5 times)

Applied to files:

  • .claude/test-scenarios/high-priority/feature-flags-validation.md
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Feature flags are NOT persisted between sessions (blacklisted in redux-persist)

Applied to files:

  • .claude/test-scenarios/high-priority/feature-flags-validation.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/**/*.test.ts : Write unit tests for swapper methods and API endpoints

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
  • .claude/test-scenarios/critical/asset-swap-flow.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/**/*.ts : Avoid side effects in swap logic; ensure swap methods are deterministic and stateless

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/**/*.ts : Use TypeScript with explicit types (e.g., SupportedChainIds) for all code in the Swapper system

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/*.ts : Reuse executeEvmTransaction utility for EVM-based swappers instead of implementing custom transaction execution

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
📚 Learning: 2025-08-17T21:53:03.806Z
Learnt from: 0xApotheosis
Repo: shapeshift/web PR: 10290
File: scripts/generateAssetData/color-map.json:41-47
Timestamp: 2025-08-17T21:53:03.806Z
Learning: In the ShapeShift web codebase, native assets (using CAIP-19 slip44 namespace like eip155:1/slip44:60, bip122:.../slip44:..., cosmos:.../slip44:...) are manually hardcoded and not generated via the automated asset generation script. Only ERC20/BEP20 tokens go through the asset generation process. The validation scripts should only validate generated assets, not manually added native assets.

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/chain-integration-template.md
  • .claude/test-scenarios/solana-chain-integration.md
  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
  • .claude/test-scenarios/critical/asset-swap-flow.md
  • .claude/test-scenarios/shapeshift-feature-discovery-report.md
📚 Learning: 2025-11-25T21:43:10.838Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11170
File: patches/@shapeshiftoss+bitcoinjs-lib+7.0.0-shapeshift.0.patch:9-19
Timestamp: 2025-11-25T21:43:10.838Z
Learning: In shapeshift/web, gomesalexandre will not expand PR scope to fix latent bugs in unused API surface (like bitcoinjs-lib patch validation methods) when comprehensive testing proves the actual used code paths work correctly, preferring to avoid costly hdwallet/web verdaccio publish cycles and full regression testing for conceptual issues with zero runtime impact.

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/shapeshift-feature-discovery-report.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/*.ts : All swappers must implement the Swapper interface from packages/swapper/src/types.ts

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
📚 Learning: 2025-11-12T12:18:00.863Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11016
File: packages/swapper/src/swappers/NearIntentsSwapper/swapperApi/getTradeQuote.ts:109-145
Timestamp: 2025-11-12T12:18:00.863Z
Learning: NEAR Intents swapper: The NEAR 1Click API does not provide gas limit estimation logic like other swappers (e.g., magic gasLimit fields). For ERC20 token swaps in getTradeQuote, accurate fee estimation requires token approval and sufficient balance; without these prerequisites, fees may display as 0 or use inaccurate native transfer estimates. This is a known limitation of the NEAR Intents integration.

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/critical/asset-swap-flow.md
📚 Learning: 2025-11-03T22:31:30.786Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10985
File: packages/swapper/src/swappers/PortalsSwapper/getPortalsTradeQuote/getPortalsTradeQuote.ts:0-0
Timestamp: 2025-11-03T22:31:30.786Z
Learning: In packages/swapper/src/swappers/PortalsSwapper, the rate and quote files intentionally use different approaches for calculating buyAmountBeforeSlippageCryptoBaseUnit: getPortalsTradeRate.tsx uses minOutputAmount / (1 - buffer) for conservative estimates, while getPortalsTradeQuote.ts uses outputAmount / (1 - buffer) for final quote display. This difference is validated by on-chain simulation testing and is intentional.

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/critical/asset-swap-flow.md
📚 Learning: 2025-08-04T15:36:25.122Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10171
File: src/components/MultiHopTrade/components/TradeConfirm/components/ExpandedStepperSteps.tsx:458-458
Timestamp: 2025-08-04T15:36:25.122Z
Learning: In swap transaction handling, buy transaction hashes should always use the swapper's explorer (stepSource) because they are known by the swapper immediately upon swap execution. The conditional logic for using default explorers applies primarily to sell transactions which need to be detected/indexed by external systems like Thorchain or ViewBlock.

Applied to files:

  • .claude/test-scenarios/swapper-testing.md
  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Use descriptive test names that explain behavior

Applied to files:

  • .claude/test-scenarios/TEMPLATE.md
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Write tests for critical business logic

Applied to files:

  • .claude/commands/test-agent.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/*.ts : Implement filterBuyAssetsBySellAssetId method to filter assets by supported chain IDs in the buy property

Applied to files:

  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
  • .claude/test-scenarios/critical/asset-swap-flow.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/*.ts : Implement filterAssetIdsBySellable method to filter assets by supported chain IDs in the sell property

Applied to files:

  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/endpoints.ts : Reuse checkEvmSwapStatus utility for checking EVM swap status instead of implementing custom status checks

Applied to files:

  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
📚 Learning: 2025-11-20T12:00:45.005Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11078
File: src/setupVitest.ts:11-15
Timestamp: 2025-11-20T12:00:45.005Z
Learning: In shapeshift/web, src/setupVitest.ts must redirect 'ethers' to 'ethers5' for shapeshiftoss/hdwallet-trezor (and -trezor-connect), same as ledger and shapeshift-multichain. Removing 'trezor' from the regex causes CI/Vitest failures due to ethers v6 vs v5 API differences.

Applied to files:

  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
📚 Learning: 2025-11-24T21:20:17.804Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/error-handling.mdc:0-0
Timestamp: 2025-11-24T21:20:17.804Z
Learning: Applies to **/swapper{s,}/**/*.{ts,tsx} : ALWAYS use `makeSwapErrorRight` for swapper errors with `TradeQuoteError` enum for error codes and provide detailed error information

Applied to files:

  • .claude/test-scenarios/swap-eth-to-btc-same-chain.md
  • .claude/test-scenarios/critical/asset-swap-flow.md
📚 Learning: 2025-11-12T13:01:06.086Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11016
File: packages/swapper/src/swappers/NearIntentsSwapper/swapperApi/getTradeRate.ts:25-38
Timestamp: 2025-11-12T13:01:06.086Z
Learning: In the swapper architecture (packages/swapper), input validation for sell amounts (e.g., checking sellAmount > 0) is handled by the application layer before reaching individual swapper implementations. Swapper methods like getTradeRate and getTradeQuote can assume inputs have already been validated upstream, so defensive guards for basic input validation (amount > 0, valid addresses, etc.) are unnecessary at the swapper layer.

Applied to files:

  • .claude/test-scenarios/critical/asset-swap-flow.md
📚 Learning: 2025-08-04T16:02:27.360Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10171
File: src/components/MultiHopTrade/components/TradeConfirm/components/ExpandedStepperSteps.tsx:458-458
Timestamp: 2025-08-04T16:02:27.360Z
Learning: In multi-hop swap transactions, last hop sell transactions might not be detected by the swapper (unlike buy transactions which are always known immediately). The conditional stepSource logic for last hop buy transactions (`isLastHopSellTxSeen ? stepSource : undefined`) serves as defensive programming for future multi-hop support with intermediate chains, even though multi-hop functionality is not currently supported in production.

Applied to files:

  • .claude/test-scenarios/critical/asset-swap-flow.md
📚 Learning: 2025-08-08T15:00:49.887Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/components/AssetSearch/components/AssetList.tsx:2-2
Timestamp: 2025-08-08T15:00:49.887Z
Learning: Project shapeshift/web: NeOMakinG prefers avoiding minor a11y/UI nitpicks (e.g., adding aria-hidden to decorative icons in empty states like src/components/AssetSearch/components/AssetList.tsx) within feature PRs; defer such suggestions to a follow-up instead of blocking the PR.

Applied to files:

  • .claude/test-scenarios/shapeshift-feature-discovery-report.md
📚 Learning: 2025-08-08T15:00:22.321Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10231
File: src/components/MultiHopTrade/components/TradeInput/components/HighlightedTokens.tsx:14-14
Timestamp: 2025-08-08T15:00:22.321Z
Learning: In shapeshift/web reviews for NeOMakinG, avoid nitpicks to change deep-relative imports to '@/…' alias paths within feature/non-refactor PRs; defer such style-only changes to a dedicated follow-up refactor unless they fix an issue.

Applied to files:

  • .claude/test-scenarios/shapeshift-feature-discovery-report.md
📚 Learning: 2025-10-13T11:55:57.439Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10751
File: src/Routes/RoutesCommon.tsx:190-190
Timestamp: 2025-10-13T11:55:57.439Z
Learning: In the shapeshift/web codebase, there are multiple independent claim systems: Arbitrum bridge claims (removed in PR #10751), RFOX claims (in src/pages/RFOX/components/Claim/), and TCY claims (in src/pages/TCY/). Each has its own routes, components, and logic. When reviewing claim-related changes, distinguish which system is being modified and avoid suggesting changes to unrelated claim systems.

Applied to files:

  • .claude/test-scenarios/shapeshift-feature-discovery-report.md
📚 Learning: 2025-08-27T09:47:06.275Z
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/components/ButtonWalletPredicate/ButtonWalletPredicate.tsx:7-7
Timestamp: 2025-08-27T09:47:06.275Z
Learning: In shapeshift/web project, NeOMakinG consistently prefers to defer UI/UX improvements and refactoring work (like the Drawer.Close hack fix in ButtonWalletPredicate.tsx) to follow-up PRs rather than expanding the scope of feature PRs, even when the improvements would enhance robustness.

Applied to files:

  • .claude/test-scenarios/shapeshift-feature-discovery-report.md
🪛 Gitleaks (8.30.0)
.claude/test-scenarios/relay-usdc-arbitrum-to-solana.md

[high] 205-205: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 LanguageTool
.claude/test-scenarios/QUICK-START.md

[uncategorized] ~60-~60: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...ortfolio loading - Chain switching ### High Priority Scenarios 📊 Test weekly: - Staking flo...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~68-~68: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... Feature flags - Account switching ### Medium Priority Scenarios ✅ Test bi-weekly: - i18n vali...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

.claude/test-scenarios/chain-integration-template.md

[style] ~428-~428: Consider removing “of” to be more concise
Context: ...iteria Chain integration passes when ALL of the following are true: ✅ **Account Mana...

(ALL_OF_THE)

.claude/test-scenarios/markets-discovery-exploration.md

[grammar] ~169-~169: Use a hyphen to join words.
Context: ...renders appropriately --- #### 2.6 One Click DeFi Assets Category ⬜ **Location...

(QB_NEW_EN_HYPHEN)

.claude/commands/test-agent.md

[style] ~273-~273: Consider using a different verb for a more formal wording.
Context: ...ducible - Clear reports help developers fix issues quickly --- ## How to Use This...

(FIX_RESOLVE)

🪛 markdownlint-cli2 (0.18.1)
.claude/test-scenarios/QUICK-START.md

79-79: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


87-87: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


96-96: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


196-196: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


296-296: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

.claude/test-scenarios/chain-integration-template.md

75-75: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


217-217: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


260-260: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


309-309: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

.claude/test-scenarios/relay-usdc-arbitrum-to-solana.md

233-233: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

.claude/test-scenarios/solana-chain-integration.md

119-119: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


122-122: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


515-515: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


598-598: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


641-641: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

.claude/commands/test-agent.md

164-164: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


280-280: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


285-285: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


290-290: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


295-295: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


300-300: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

.claude/test-scenarios/swap-eth-to-btc-same-chain.md

149-149: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


154-154: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


162-162: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

.claude/test-scenarios/shapeshift-feature-discovery-report.md

5-5: Bare URL used

(MD034, no-bare-urls)

.claude/test-scenarios/feature-discovery-guide.md

11-11: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Call / Static
🔇 Additional comments (15)
.claude/test-scenarios/high-priority/feature-flags-validation.md (1)

1-254: Excellent test scenario documentation.

This feature flags validation scenario is comprehensive and accurately reflects the ShapeShift feature flag system. The test steps, validation points, and development guidance all align with the actual implementation (useFeatureFlag hook, Redux state structure, non-persistence by design). The prerequisite information, edge cases, and known issues section provide solid coverage for testing and future maintenance.

.claude/test-scenarios/critical/wallet-connection-flow.md (1)

1-144: Solid critical path scenario.

The wallet connection flow captures essential user workflows appropriately marked as critical priority. The test steps progress logically from initial navigation through disconnection and persistence verification. Edge cases (modal closure, refresh during connection, network mismatch) are reasonable and worth testing. This scenario will serve well as a pre-release validation checkpoint.

.claude/test-scenarios/TEMPLATE.md (1)

1-97: Well-designed template for consistency.

This template provides a clear structure that balances standardization with flexibility. The sections flow logically (prerequisites → steps → edge cases → metadata), and the inclusion of fields like automation level, dependencies, and tags supports the test bank's organization goals. The revision history section will be useful for tracking scenario evolution over time.

.claude/test-scenarios/README.md (1)

1-176: Clear and well-organized test bank documentation.

The README effectively serves as both overview and navigation guide. The directory structure, priority levels, and contributing guidelines are clearly defined. The usage section provides concrete commands, and the maintenance schedule (daily/weekly/monthly) sets appropriate testing cadence expectations. The scenario status indicators and quick stats give team members immediate visibility into test coverage status.

.claude/test-scenarios/markets-discovery-exploration.md (1)

1-548: Comprehensive markets feature scenario with excellent detail.

This scenario provides thorough coverage of the Markets discovery feature across eight test phases. The structured approach—from initial load through filtering, interactions, navigation, data accuracy, performance, and error handling—creates a reusable test path. The inclusion of specific asset examples, variance tolerances for data accuracy (±2%), and performance benchmarks (5-second page load, 500ms filter response) gives the scenario concrete success criteria. The results summary table format enables clear pass/fail tracking.

.claude/test-scenarios/QUICK-START.md (1)

1-334: Excellent Quick Start guide for rapid onboarding.

This guide effectively brings developers up to speed with realistic examples and practical guidance. The command examples are concrete and immediately actionable. The "What Gets Tested" categorization with examples helps set expectations. The "Understanding Test Results" section clearly explains pass/fail/warning indicators, and the "Common Issues" troubleshooting section addresses realistic problems (dev server not running, Browser MCP issues, missing scenarios). The final quick reference card is a handy one-page summary for ongoing use.

.claude/test-scenarios/solana-chain-integration.md (1)

1-641: Exceptional chain integration test report with strong technical depth.

This Solana integration report demonstrates comprehensive understanding of the implementation. The technical details are accurate: CAIP-19 asset ID formats with correct slip44:501 for native SOL, proper BIP-44 derivation path (m/44'/501'/0'/0'), and base58 address formats. The three-phase test structure (account derivation, chain visibility, asset pages) provides thorough coverage with realistic test data. The 100% pass rate across 10 test cases gives confidence in the integration. The key findings section appropriately distinguishes true issues (none) from expected non-blocking console messages. The recommendations for future enhancement (related assets, bulk account activation, chain-specific filtering) show thoughtful forward-looking perspective.

.claude/commands/test-agent.md (1)

1-306: Clear and comprehensive test agent documentation.

This persona document effectively frames the testing agent's role and provides actionable workflows for running, discovering, and creating test scenarios. The ShapeShift-specific patterns section demonstrates understanding of actual codebase practices: feature flag testing via the /flags route and flag toggle validation, wallet connection flows with test wallets, i18n validation checking for hardcoded text, Redux state inspection via browser console, and multi-chain asset testing. The test execution workflow is logical and repeatable. The reporting format with clear ✅/❌/⚠️ indicators will help developers quickly understand test results. Priority examples appropriately place wallet connection, swap, and send flows as critical paths.

.claude/test-scenarios/shapeshift-feature-discovery-report.md (1)

1-722: Well-structured feature inventory document. This comprehensive discovery report effectively catalogs all major ShapeShift Web features with clear navigation structure, categories, and use-case flows. The coverage matrix and recommended test scenarios tie directly to the broader testing framework introduced in this PR.

.claude/test-scenarios/critical/asset-swap-flow.md (1)

1-240: Clear, comprehensive test scenario for critical swap flow. The 12-step procedure with validation points, edge cases, and related scenario references provides a solid foundation for testing the core swap feature. Prerequisites and known issues sections are appropriately scoped.

.claude/test-scenarios/chain-integration-template.md (1)

1-514: Comprehensive chain integration test template. The three-phase structure (account derivation, chain visibility, asset pages) with detailed success criteria and troubleshooting guidance provides a strong template for onboarding new blockchain integrations. The test results summary table and automation recommendations support both manual and future automated testing.

.claude/test-scenarios/relay-usdc-arbitrum-to-solana.md (1)

1-240: Well-executed test example with comprehensive verification. This completed test scenario demonstrates all critical verification points for cross-chain swaps (toast notifications, action center logging, balance updates, blockchain confirmation). The key findings section accurately captures observed behavior including API errors and their non-blocking nature, providing useful context for future Relay integration testing.

.claude/test-scenarios/swapper-testing.md (1)

1-541: Comprehensive swapper testing documentation with valuable insights. The systematic testing approach across same-chain and cross-chain pairs, combined with concrete quote examples and capability matrix, effectively documents the multi-swapper aggregation behavior. The key finding that "swapper availability is pair-dependent" (line 283) provides important context for test planning. The test results summary tables and performance metrics offer a useful baseline for regression testing.

.claude/test-scenarios/feature-discovery-guide.md (1)

1-396: Thorough feature discovery methodology with practical guidance. The eight-phase discovery process, comprehensive checklist, and documentation template provide a solid framework for systematically mapping application features. The regular discovery schedule and success metrics ensure consistent ongoing coverage, while the automated discovery pseudo-code concept supports future test agent enhancement.

.claude/test-scenarios/swap-eth-to-btc-same-chain.md (1)

1-387: Well-structured test template ready for execution. The eight-phase procedure with clear placeholders, comprehensive edge cases (amounts, network conditions, wallet scenarios), and results summary table provide a complete framework for testing same-chain ETH→BTC swaps. The connection to related scenarios and blockchain explorer verification steps ensure thorough validation.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@NeOMakinG NeOMakinG marked this pull request as ready for review December 22, 2025 11:11
@NeOMakinG NeOMakinG requested a review from a team as a code owner December 22, 2025 11:11
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested Plasma integration with Claude Code chrome extension (admittedly would be much faster with Playwright but don't feel like losing another day trying to set it up and failing again, I'll piggyback to this with Playwright later on!).

Confirmed she's a beaut 🐐

Image

@gomesalexandre gomesalexandre merged commit d970ba9 into develop Dec 22, 2025
4 checks passed
@gomesalexandre gomesalexandre deleted the automate-testing branch December 22, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants