| .. | ||
| alex-newcomer.spec.ts | ||
| all-personas.spec.ts | ||
| generate-feedback.mjs | ||
| helpers.ts | ||
| marcus-degen.spec.ts | ||
| playwright.config.ts | ||
| priya-institutional.spec.ts | ||
| README.md | ||
| sarah-yield-farmer.spec.ts | ||
| setup-chain-state.ts | ||
| test-a-passive-holder.spec.ts | ||
| test-b-staker-v2.spec.ts | ||
| test-b-staker.spec.ts | ||
| test-landing-variants.spec.ts | ||
| tyler-retail-degen.spec.ts | ||
User Testing Scripts
This directory contains 5 Playwright test scripts simulating different user personas interacting with the Kraiken DeFi protocol.
Personas
-
Marcus "Flash" Chen (
marcus-degen.spec.ts) - Degen/MEV Hunter- Anvil account #1
- Tests edge cases, probes snatching mechanics, looks for exploits
- Skeptical, technical, profit-driven
-
Sarah Park (
sarah-yield-farmer.spec.ts) - Cautious Yield Farmer- Anvil account #2
- Researches thoroughly, seeks sustainable returns
- Conservative, reads everything, compares to Aave
-
Tyler "Bags" Morrison (
tyler-retail-degen.spec.ts) - Retail Degen- Anvil account #3
- YOLOs in without reading, gets confused easily
- Impulsive, mobile-first, community-driven
-
Dr. Priya Malhotra (
priya-institutional.spec.ts) - Institutional/Analytical Investor- Anvil account #4
- Analyzes mechanism design with academic rigor
- Methodical, game-theory focused, large capital allocator
-
Alex Rivera (
alex-newcomer.spec.ts) - Crypto-Curious Newcomer- Anvil account #0
- First time in DeFi, intimidated but willing to learn
- Needs hand-holding, compares to Coinbase
Prerequisites
-
Running stack (required before tests):
cd /home/debian/harb ./scripts/dev.sh start -
Wait for stack health:
- Anvil on port 8545
- Ponder/GraphQL on port 42069
- Web-app on port 5173 (proxied on 8081)
- Contracts deployed (deployments-local.json populated)
Running Tests
All personas:
cd /home/debian/harb
npx playwright test tests/e2e/usertest/
Individual persona:
npx playwright test tests/e2e/usertest/marcus-degen.spec.ts
npx playwright test tests/e2e/usertest/sarah-yield-farmer.spec.ts
npx playwright test tests/e2e/usertest/tyler-retail-degen.spec.ts
npx playwright test tests/e2e/usertest/priya-institutional.spec.ts
npx playwright test tests/e2e/usertest/alex-newcomer.spec.ts
With UI (headed mode):
npx playwright test tests/e2e/usertest/marcus-degen.spec.ts --headed
Debug mode:
npx playwright test tests/e2e/usertest/marcus-degen.spec.ts --debug
Output
Screenshots
Saved to test-results/usertest/<persona-name>/:
- Landing page
- Wallet connection
- Swap transactions
- Stake forms
- Error states
- Final dashboard
JSON Reports
Saved to /home/debian/harb/tmp/usertest-results/<persona-name>.json:
{
"personaName": "Marcus Flash Chen",
"testDate": "2026-02-13T21:45:00.000Z",
"pagesVisited": [
{
"page": "Landing",
"url": "http://localhost:8081/app/",
"timeSpent": 2000,
"timestamp": "2026-02-13T21:45:02.000Z"
}
],
"actionsAttempted": [
{
"action": "Connect wallet",
"success": true,
"timestamp": "2026-02-13T21:45:05.000Z"
}
],
"screenshots": ["test-results/usertest/marcus-flash-chen/..."],
"uiObservations": [
"Lands on app, immediately skeptical - what's the catch?"
],
"copyFeedback": [
"Landing page needs 'Audited by X' badge prominently displayed"
],
"tokenomicsQuestions": [
"What prevents someone from flash-loaning to manipulate VWAP?"
],
"overallSentiment": "Intrigued but cautious. Mechanics are novel..."
}
Console Logs
Each test logs observations in real-time:
[Marcus] Lands on app, immediately skeptical - what's the catch?
[Marcus - COPY] Landing page needs "Audited by X" badge prominently displayed
[Marcus - TOKENOMICS] What prevents someone from flash-loaning to manipulate VWAP?
[SCREENSHOT] landing-page: test-results/usertest/marcus-flash-chen/...
What Each Test Does
Marcus (Degen)
- Lands on app, looks for audit/docs
- Connects wallet immediately
- Tests small swap (0.01 ETH) then large swap (1.5 ETH)
- Stakes at low tax rate (2%) to test snatching
- Looks for snatch targets among other positions
- Examines statistics for meta trends
Sarah (Yield Farmer)
- Reads landing page thoroughly
- Looks for About/Docs/Team FIRST
- Checks for audit badge
- Connects wallet hesitantly
- Studies statistics and tax rates
- Small test purchase (0.1 ETH)
- Conservative stake at 15% tax
- Compares to Aave mentally
Tyler (Retail)
- Glances at landing, immediately connects wallet
- Looks for buy button (gets confused)
- Finds cheats page randomly
- Buys $150 worth without research
- Stakes at random tax rate (5%)
- Checks for immediate gains
- Gets confused about tax/snatching
- Looks for Discord to ask questions
Priya (Institutional)
- Looks for whitepaper/technical docs
- Checks for audit and governance info
- Analyzes liquidity snapshot
- Tests large swap (5 ETH) to measure slippage
- Reviews tax rate distribution for Nash equilibrium
- Stakes at calculated optimal rate (12%)
- Evaluates risk, composability, exit liquidity
- Writes detailed assessment
Alex (Newcomer)
- Reads landing page carefully but confused
- Looks for tutorial/getting started
- Nervous about connecting wallet (scam fears)
- Reads info tooltips, still confused
- Looks for FAQ (risk disclosures)
- Tiny test purchase (0.05 ETH)
- Overwhelmed by tax rate choices
- Stakes conservatively at 15%, worried about snatching
- Compares to Coinbase staking
Analyzing Results
Key Metrics:
- Time spent per page - Which pages confuse users? Where do they linger?
- Failed actions - What breaks? What error messages are unclear?
- UI observations - What's confusing, missing, or broken?
- Copy feedback - What messaging needs improvement?
- Tokenomics questions - What concepts aren't explained?
Common Themes to Look For:
- Onboarding friction - Do newcomers understand what to do?
- Trust signals - Are audit/security concerns addressed?
- Tax rate confusion - Can users choose optimal rates?
- Snatching fear - Is the mechanism explained clearly?
- Return visibility - Can users see earnings potential?
Extending Tests
To add a new persona:
- Copy an existing spec file
- Update persona details and behaviors
- Use a different Anvil account (keys in wallet-provider.ts)
- Implement persona-specific journey
- Add to this README
Troubleshooting
Tests fail immediately:
- Check stack is running:
./scripts/dev.sh status - Check deployments exist:
cat onchain/deployments-local.json
Wallet connection fails:
- Check wallet-provider.ts is creating correct context
- Verify RPC URL is accessible
Screenshots missing:
- Check
test-results/usertest/directory exists - Verify filesystem permissions
JSON reports empty:
- Check
tmp/usertest-results/directory exists - Verify writeReport() is called in finally block