test: add Playwright E2E for wallets SDK (staging) with getOrCreateWallet sample
Description
Implements end-to-end Playwright testing scaffolding for the @crossmint/wallets-sdk package as requested by @alberto-crossmint. This adds:
- Complete E2E test setup under
packages/wallets/e2e/ - GitHub Actions workflow that runs on PRs and main branch pushes
- Sample test for
getOrCreateWalletusing real Crossmint staging environment - Browser-based test harness using Vite (required since getOrCreateWallet is client-side only)
⚠️ Current Status: Test fails due to API key requirements
The test requires a CLIENT API key (ck_staging_...) to be configured as the CROSSMINT_STAGING_API_KEY GitHub secret. Server keys (sk_staging_...) will fail because getOrCreateWallet can only be called from client-side code.
Test plan
- Added comprehensive E2E test for
getOrCreateWalletthat verifies wallet creation succeeds and returns an address - Test runs in browser environment using Playwright + Vite harness to satisfy client-side API requirements
- CI workflow validates the E2E test passes on every PR and main branch push
- Local testing verified with proper client API key setup
Human Review Checklist
Critical items to verify:
- [ ] API Key Security: Confirm
CROSSMINT_STAGING_API_KEYGitHub secret is configured with a CLIENT key (ck_staging_...), not server key - [ ] Test Approach: Validate browser-based harness approach vs direct SDK testing is appropriate for client-side-only methods
- [ ] Real API Dependency: Review implications of tests hitting live staging environment (reliability, cleanup, rate limits)
- [ ] Parameter Passing: URL parameter approach for test configuration is unconventional - confirm this is acceptable
- [ ] CI Dependencies: Playwright browser installation adds complexity - ensure this is justified
Package updates:
- Added
@playwright/test: 1.54.2,vite: ^5.4.0,dotenv: ^16.3.1,dotenv-cli: ^7.4.1to wallets package devDependencies - No changesets required as these are dev-only dependencies
Link to Devin run: https://app.devin.ai/sessions/952ab99d26c64024857ab74ca3e680fc
Requested by: @alberto-crossmint
Original prompt from Alberto
In this crossmint-sdk repository, I'd like to implement end to end testing for my wallet package in packages/wallets
You should use playwright for that, and it should use the real Crossmint staging environment for all API operations. The API key will be provided via environment variable
Create the scaffolding for that:
- Playwright test suite
- Script under package.json to run the test (should work locally using .env and in github actions)
- CI job to run tests and report results, run on each PR and main branch
- Sample test that tests calling the getOrCreateWallet and checks it succeeded
Prioritize making the code elegant
You only need to look in the following repo: Crossmint/crossmint-sdk
🤖 Devin AI Engineer
I'll be helping with this pull request! Here's what you should know:
✅ I will automatically:
- Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
- Look at CI failures and help fix them
Note: I can only respond to comments from users who have write access to this repository.
⚙️ Control Options:
- [ ] Disable automatic comment and CI monitoring
⚠️ No Changeset found
Latest commit: aa62920482b56d3c743101218fe96ce81d96052e
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| crossmint-sdk-quickstart-devkit | Preview | Comment | Sep 29, 2025 9:58am |
1 Skipped Deployment
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| smart-wallet-auth-demo | Sep 29, 2025 9:58am |