/defi-ui-testing:defi-ui-synpress-metamaskfrom defi-ui-testing
This skill should be used when implementing DeFi UI E2E with Synpress, Playwright, MetaMask, and Hardhat/Anvil — wallet setup cache, connect, approve, deposit/borrow/liquidate flows.
Ships in defi-ui-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Real-wallet E2E for DeFi UIs. Based on patterns from the Coinmonks Synpress guide and Synpress v4 docs.
pnpm add -D @synthetixio/synpress @playwright/test
npx playwright install chromium
// wallet-setup/metamask.setup.ts
import { defineWalletSetup } from '@synthetixio/synpress'
import { MetaMask } from '@synthetixio/synpress/playwright'
const SEED = 'test test test test test test test test test test test junk'
const PASSWORD = 'Tester@1234'
export default defineWalletSetup(PASSWORD, async (context, walletPage) => {
const metamask = new MetaMask(context, walletPage, PASSWORD)
await metamask.importWallet(SEED)
await metamask.addNetwork({
name: 'Anvil',
rpcUrl: 'http://127.0.0.1:8545',
chainId: 31337,
symbol: 'ETH',
})
await metamask.switchNetwork('Anvil', true)
})
npx synpress wallet-setup
// tests/e2e/lending.spec.ts
import { testWithSynpress } from '@synthetixio/synpress'
import { MetaMask, metaMaskFixtures } from '@synthetixio/synpress/playwright'
import setup from '../../wallet-setup/metamask.setup'
const test = testWithSynpress(metaMaskFixtures(setup))
const { expect } = test
test('borrower deposits collateral', async ({
context,
page,
metamaskPage,
extensionId,
}) => {
const metamask = new MetaMask(
context,
metamaskPage,
setup.walletPassword,
extensionId
)
const lending = new LendingPage(page, metamask)
await page.goto('/')
await lending.connectWallet()
await lending.deposit('1')
await lending.confirmTx()
await expect(page.getByTestId('supplied-balance')).not.toHaveText('0')
})
export class LendingPage {
constructor(
private page: Page,
private metamask: MetaMask
) {}
async connectWallet() {
await this.page.getByRole('button', { name: /Connect Wallet/i }).click()
await this.metamask.connectToDapp()
}
async deposit(amount: string) {
await this.page.getByTestId('deposit-input').fill(amount)
await this.page.getByTestId('deposit-button').click()
}
async confirmTx() {
await this.metamask.confirmTransaction()
}
async approveToken() {
await this.metamask.approveTokenPermission({ spendLimit: 'max' })
}
}
importWalletFromPrivateKey for Anvil account 2 as liquidatorswitchAccount('Liquidator') — ensure dApp refreshes accountconfirmTransaction# terminal or webServer
anvil # or npx hardhat node
npx synpress wallet-setup # once
npx playwright test
MetaMask lives on another page/tab. Capture popup via context.waitForEvent('page') and attach screenshots with testInfo.attach for HTML reports.
Keep Method B for paths that say “works with MetaMask” in release notes.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
defi-ui-testing@cyotee is listed by cyotee/cyotee-claude-plugins — review the source before installing
npx claudepluginhub cyotee/cyotee-claude-plugins --plugin defi-ui-testing5 skills in this plugin
/defi-ui-anvil-fixturesThis skill should be used when building Anvil-backed Playwright fixtures for DeFi UI tests — snapshots, time travel, mining, impersonation, and multi-account chain helpers./defi-ui-mock-connectorThis skill should be used when implementing DeFi UI E2E with Playwright, Anvil, and Wagmi mock connector — window._setupAccount, fixtures, error features, without MetaMask extension./defi-ui-testing-overviewThis skill should be used when planning or implementing DeFi UI E2E tests — choosing between Wagmi mock connector vs Synpress MetaMask, stack layout with Anvil, and test strategy for dApps./defi-ui-test-patternsThis skill should be used when designing DeFi UI E2E test cases — connect wallet, token approve, swap, lend/borrow, health factor, liquidation, and multi-account journeys for mock or Synpress.