Skip to content

Conversation

@N-45div
Copy link

@N-45div N-45div commented Dec 6, 2025

Summary

Adds a Playwright E2E testing package for wallet connection testing, addressing #77.

Changes

  • New package: @solana/e2e at tests/e2e/
  • Wallet harness abstraction: Resilient interface for Phantom, Solflare, Backpack
  • Happy path tests: Wallet connection/disconnection flows
  • CI workflow: .github/workflows/e2e.yml for automated E2E testing
  • Turbo integration: Added test:e2e task

Test Results

  • 2 tests pass (basic UI verification)
  • 4 tests skip gracefully (require wallet extensions)

How to Test Locally

pnpm install
pnpm --filter @solana/e2e exec playwright install chromium
pnpm --filter @solana/e2e test

Closes #77

- Add @solana/e2e package with Playwright test infrastructure
- Create wallet harness abstraction for Phantom, Solflare, Backpack
- Add happy path wallet connection tests
- Add CI workflow for E2E tests (.github/workflows/e2e.yml)
- Add test:e2e task to turbo.json
- Tests gracefully skip when wallet extensions are not available

Closes solana-foundation#77
@N-45div N-45div mentioned this pull request Dec 6, 2025
@GuiBibeau
Copy link
Collaborator

@N-45div Am i understanding that running the test in headed mode is needed to work with extension wallets? If that's the case i think we need to review a bit the approach i proposed in #77. The goal here was to have a higher level of confidence than the unit tests.

Let's either research a way to add a wallet-standard injected script or get the full test suite running here against extension in CI.

What do you think?

- Add mock wallet that implements wallet-standard interface
- Inject mock wallet via Playwright's addInitScript
- Add mock wallet E2E tests (5 passing, 2 skipped)
- Tests run without real browser extensions in CI
- Provides higher confidence than unit tests

This addresses the review feedback requesting wallet-standard
injected script approach for reliable CI testing.
@N-45div
Copy link
Author

N-45div commented Dec 8, 2025

Thanks for the feedback @GuiBibeau ! I've updated the PR with a mock wallet-standard implementation.

Changes

  • Added tests/e2e/src/mock-wallet/ with a wallet-standard compliant mock wallet
  • The mock wallet is injected via Playwright's addInitScript before page load
  • Tests now run without real browser extensions in CI

Test Results

  • 7 passed (5 mock wallet tests + 2 basic UI tests)
  • 6 skipped (extension-dependent tests)

How it works

The mock wallet implements the wallet-standard interface (standard:connect, standard:disconnect, standard:events, solana:signMessage, solana:signTransaction) and registers itself with the wallet-standard registry. This allows the framework-kit app to discover and connect to it just like a real wallet extension.

This approach provides higher confidence than unit tests while being reliable in CI without needing actual browser extensions.

Let me know if you'd like any changes!

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