Complete testing guide using test-simple-sdk.html
Test all SDK functions with real API calls
See generated QR codes instantly
Monitor all API interactions
# Start Docker containers
cd Docker
docker-compose -f docker-compose.dev.yml up -d
# Start SDK API
cd sdk-api
npm run dev
# Verify health
curl http://localhost:3001/api/v1/health
# Register a test partner
curl -X POST http://localhost:3001/api/v1/partners/register \
-H "Content-Type: application/json" \
-d '{
"name": "Test Partner",
"email": "test@example.com"
}'
# Save the API key from response!
# Option 1: Direct file
open test-simple-sdk.html
# Option 2: Python server
python -m http.server 8000
# Option 3: Node server
npx http-server
publicId.secret
test_user_001
http://localhost:3001/api/v1
Test the happy path with default settings
Test encryption functionality
Test quota exhaustion and payment
Test QR image upload
Test various error conditions
Test custom text backup
// test-suite.js
class SimpleSDKTestSuite {
constructor(apiKey, apiUrl) {
this.apiKey = apiKey;
this.apiUrl = apiUrl;
this.results = [];
}
async runAllTests() {
await this.testBasicBackup();
await this.testEncryption();
await this.testQuotaExhaustion();
await this.testInvalidInputs();
this.printResults();
}
async testBasicBackup() {
const sead = new SeadSimpleWithAPI({
apiUrl: this.apiUrl,
apiKey: this.apiKey,
userId: 'test_' + Date.now()
});
const result = await sead.backup({
seedPhrase: 'test seed phrase'
});
this.results.push({
test: 'Basic Backup',
passed: result.success
});
}
}
// Load test with concurrent operations
async function loadTest(concurrent = 10) {
const promises = [];
for (let i = 0; i < concurrent; i++) {
promises.push(
performBackup(`user_${i}`, `seed ${i}`)
);
}
console.time('Load Test');
const results = await Promise.allSettled(promises);
console.timeEnd('Load Test');
const successful = results.filter(r => r.status === 'fulfilled');
console.log(`Success rate: ${successful.length}/${concurrent}`);
}
| Operation | Target | Acceptable | Maximum |
|---|---|---|---|
| SDK Init | < 50ms | < 100ms | 200ms |
| Backup (3 shares) | < 200ms | < 500ms | 1000ms |
| Restore (2 shares) | < 150ms | < 300ms | 500ms |
| QR Generation | < 100ms | < 200ms | 500ms |
| API Call | < 50ms | < 100ms | 500ms |
// Valid BIP39 seed phrases
const validSeeds = [
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
"legal winner thank year wave sausage worth useful legal winner thank yellow",
"letter advice cage absurd amount doctor acoustic avoid letter advice cage above"
];
// Test user IDs
const testUsers = [
"test_user_001",
"0x742d35Cc6634C0532925a3b844Bc9e7595f0fA77",
"user_" + Date.now(),
"wallet_address_hash_123"
];
// Test API keys (format examples)
const testApiKeys = [
"a1b2c3d4e5f67890a1b2c3d4e5f67890.1234567890abcdef1234567890abcdef",
"0000000000000000000000000000000.00000000000000000000000000000000"
];
// Payment proof examples
const paymentProofs = {
ethereum: {
transactionId: "0x1234567890abcdef...",
proof: "0xsignature..."
},
bitcoin: {
transactionId: "abc123def456...",
proof: "btc_proof_data"
}
};
The test interface provides comprehensive testing capabilities for SimpleSDK integration:
See QR codes and results immediately
Monitor all network traffic
Test all scenarios thoroughly