web-test-wallet-setup
Skill1 starsChanged 10 months agoMITView on GitHub
Set up MetaMask wallet extension for Web3 DApp testing - download extension, import wallet from private key. Run at test start if tests/config.yaml has web3.enabled=true.
- Deletes or force-pushes
In this repository7 other files it gives its agents.
- web-test-case-genSkill
- web-test-cleanupSkill
- web-test-reportSkill
- web-test-researchSkill
- web-testSkill
- web-test-wallet-connectSkill
- web-test-wallet-signSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Run once at test start: - Before any test cases are executed
- Distinctive: line 119
Check network connection. The script downloads from GitHub releases.
- Distinctive: line 123
Check if headed mode is working (display available)
- Distinctive: line 124
Verify private key format (should start with 0x)
- Very specific: line 125
Check ./test-output/screenshots/ for error screenshots
- Very specific: line 129
If wallet was previously set up, it will be unlocked automatically using the password from .test-env.
- Distinctive: line 161
After wallet setup is complete:
- Very specific: line 169
Use web-test-cleanup without --keep-data to reset wallet
- Distinctive: line 170
Always use a test wallet with minimal funds for testing
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Wallet Setup
Set up MetaMask wallet extension for Web3 DApp testing.
Updated for MetaMask v13 with new UI support.
When to Use This Skill
This skill should be executed automatically at the start of testing when:
# In tests/config.yaml
web3:
enabled: true # <-- If this is true, run wallet-setup FIRSTExecution timing:
- Run once at test start - Before any test cases are executed
- NOT between tests - Setup only needs to run once per test session
- Automatic by web-test - The web-test skill checks config.yaml and calls this automatically
Prerequisites
tests/.test-envfile withWALLET_PRIVATE_KEYalready existstests/config.yamlexists withweb3.enabled: true- Project research completed (web-test-research)
Quick Start
SKILL_DIR="<path-to-this-skill>"
# Step 1: Download wallet extension
node $SKILL_DIR/scripts/wallet-setup-helper.js wallet-setup
# Step 2: Initialize wallet (reads WALLET_PRIVATE_KEY from .test-env, writes WALLET_PASSWORD)
node $SKILL_DIR/scripts/wallet-setup-helper.js wallet-init --wallet --headedHow It Works
- Reads
WALLET_PRIVATE_KEYfromtests/.test-env - Converts private key to 24-word mnemonic using BIP-39 algorithm
- Imports wallet using the generated mnemonic (first account = your private key's address)
- Writes
WALLET_PASSWORDtotests/.test-env(auto-generated if not set) - Private key is only used locally in Playwright browser, never exposed to AI APIs
Technical Note: The private key (256 bits) is used as entropy to generate a 24-word BIP-39 mnemonic. This mnemonic, when imported into MetaMask, creates a wallet where the first derived account corresponds exactly to the original private key.
Instructions
Step 1: Download Wallet Extension
SKILL_DIR="<path-to-this-skill>"
# Download and install MetaMask wallet extension
node $SKILL_DIR/scripts/wallet-setup-helper.js wallet-setupWhat this does:
- Downloads MetaMask wallet from GitHub releases
- Extracts to
./test-output/extensions/metamask/ - Prepares extension for browser loading
Expected Output:
{
"success": true,
"message": "MetaMask Wallet v13.13.1 installed successfully",
"extensionPath": "./test-output/extensions/metamask"
}Step 2: Initialize Wallet
SKILL_DIR="<path-to-this-skill>"
# Initialize wallet (reads from .test-env automatically)
node $SKILL_DIR/scripts/wallet-setup-helper.js wallet-init --wallet --headedWhat this does:
- Reads
WALLET_PRIVATE_KEYfromtests/.test-env - Launches browser with wallet extension
- Imports wallet using private key
- Generates and saves
WALLET_PASSWORDto.test-env - Verifies wallet is ready
Expected Output:
{
"success": true,
"message": "Wallet initialization completed successfully",
"nextStep": "Use web-test-wallet-connect to connect wallet to DApp"
}Troubleshooting
"WALLET_PRIVATE_KEY not found in .test-env file"
The .test-env file does not exist or does not contain the private key. Ensure tests/.test-env exists with WALLET_PRIVATE_KEY before running this skill.
"Extension download failed"
Check network connection. The script downloads from GitHub releases.
"Wallet initialization failed"
- Check if headed mode is working (display available)
- Verify private key format (should start with 0x)
- Check
./test-output/screenshots/for error screenshots
"Wallet already initialized"
If wallet was previously set up, it will be unlocked automatically using the password from .test-env.
To reset:
rm -rf ./test-output/chrome-profile/
node $SKILL_DIR/scripts/wallet-setup-helper.js wallet-setup
node $SKILL_DIR/scripts/wallet-setup-helper.js wallet-init --wallet --headedData Storage
<project-root>/
├── tests/
│ └── .test-env # Reads WALLET_PRIVATE_KEY, writes WALLET_PASSWORD
└── test-output/
├── extensions/
│ └── metamask/ # MetaMask extension files
├── chrome-profile/ # Browser profile with wallet state
└── screenshots/ # Setup screenshots for debuggingRelated Skills
- web-test-research - Analyze project, detect Web3 features
- web-test-case-gen - Generates config.yaml with web3.enabled setting
- web-test-wallet-connect - Called as test case or precondition (not mandatory after setup)
- web-test - Orchestrates test execution, calls wallet-setup if web3.enabled
- web-test-cleanup - Clean up wallet data when done
Next Steps
After wallet setup is complete:
- web-test will execute test cases from
tests/test-cases.yaml - web-test-wallet-connect will be invoked when needed by test cases (as a test or precondition)
Notes
- Wallet setup only needs to run once per test-output directory
- Wallet state persists in chrome-profile between test runs
- Use
web-test-cleanupwithout--keep-datato reset wallet - Always use a test wallet with minimal funds for testing
Technical Details (MetaMask v13)
The script supports both the new MetaMask v13 UI and older versions:
New UI Flow (v13+):
- Welcome Page: Click "I have an existing wallet"
- Sign-in Options: Click "Import using Secret Recovery Phrase"
- SRP Input: Single textarea (use
keyboard.type()for proper event handling) - Password: "Create new password" + "Confirm password" + checkbox
- Complete: Click through "Got it" / "Done" dialogs
Key Selectors (v13):
- Welcome:
button:has-text("I have an existing wallet") - Import SRP:
button:has-text("Import using Secret Recovery Phrase") - SRP Input:
textarea(NOT 12 separate inputs) - Continue:
button:has-text("Continue") - Password:
input[type="password"](2 inputs) - Create:
button:has-text("Create password") - Account menu:
[data-testid="account-menu-icon"] - Add account:
[data-testid="multichain-account-menu-popover-action-button"] - Import account:
[data-testid="multichain-account-menu-popover-add-imported-account"] - Private key:
#private-key-box
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

