Skip to content

Latest commit

 

History

History
651 lines (518 loc) · 13.8 KB

File metadata and controls

651 lines (518 loc) · 13.8 KB

ADMENSION Final Testing Guide

Status: Pre-Launch Comprehensive Testing
Date: January 22, 2026
Purpose: Verify all features work correctly before public release


🎯 Testing Methodology

Testing Approach

  • Manual Testing: Browser-based user flows
  • API Testing: curl commands and console testing
  • Cross-Browser: Chrome, Firefox, Safari
  • Cross-Device: Desktop, mobile, incognito
  • Anti-Fraud: Verify legitimate users aren't blocked
  • Performance: Check load times and responsiveness

✅ Core Feature Tests

Test 1: Homepage & Navigation

Test Steps:

  1. Visit https://garebear99.github.io/ADMENSION/
  2. Click "Stats" in navigation
  3. Click "Create" in navigation
  4. Click "Manage" in navigation
  5. Click "Docs" in navigation
  6. Use browser back button
  7. Use browser forward button

Expected Results:

  • ✅ Each page loads correctly
  • ✅ URL updates to ?page=<name>
  • ✅ Page content changes
  • ✅ No console errors
  • ✅ Navigation history works

Actual Results:

✅ PASS - All navigation working correctly

Test 2: Link Creation (Local)

Test Steps:

  1. Go to Create page
  2. Enter link name: "Test Link"
  3. Enter destination: "https://example.com"
  4. Enter message: "This is a test"
  5. Leave wallet blank
  6. Click "Generate Short Link"

Expected Results:

  • ✅ 6-character code generated
  • ✅ Short link copied to clipboard
  • ✅ Warning shown (no wallet)
  • ✅ Links displayed on page
  • ✅ Link stored in localStorage

Console Verification:

// Check link was created
const links = JSON.parse(localStorage.getItem('cfamm.adm_refs'));
console.log(links); // Should show your new link

Actual Results:

✅ PASS - Link creation working

Test 3: API Health Check

Test Steps:

# Terminal test
curl https://admension-api.admension.workers.dev/api/health

# Expected: {"status":"ok","timestamp":...}

Browser Console Test:

// In browser console
await window.ADMENSION_API.checkApiHealth()
// Expected: true

Actual Results:

✅ PASS - API responding correctly

Test 4: Link Creation via API

Test Steps (Browser Console):

const result = await window.ADMENSION_API.createLink({
  linkName: "API Test Link",
  destUrl: "https://google.com",
  message: "Created via API",
  chain: "ethereum",
  addr: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
});

console.log(result);

Expected Results:

  • success: true
  • code is 6 characters
  • shortLink URL provided
  • offline: false (API used)

Actual Results:

✅ PASS - API link creation working

Test 5: Global Link Sharing

Test Steps:

  1. Create link in normal browser
  2. Copy the code (e.g., A4AGRZ)
  3. Open incognito/private window
  4. Visit: https://garebear99.github.io/ADMENSION/interstitial.html?code=<CODE>

Expected Results:

  • ✅ Interstitial page loads
  • ✅ Link name displayed
  • ✅ 3-step flow works
  • ✅ Custom message shown
  • ✅ Redirects to destination

Actual Results:

✅ PASS - Global links working (API backend)

Test 6: Wallet Management

Test Steps:

  1. Go to Manage page
  2. Enter code from Test 4
  3. Enter wallet address: 0x1234567890123456789012345678901234567890
  4. Click "Save Wallet Address"

Expected Results:

  • ✅ Success message shown
  • ✅ Link list updates with wallet status
  • ✅ API updates wallet (check network tab)
  • ✅ localStorage cache updated

Console Verification:

// Verify wallet was saved
await window.ADMENSION_API.getLink("YOUR_CODE");
// Check addr field has your wallet

Actual Results:

✅ PASS - Wallet management working

Test 7: Anti-Abuse System

Test Steps:

// Get abuse stats
window.getAbuseStats();

// Expected output table:
// Session Refreshes: X / 10
// Hourly Refreshes: X / 15
// Session Views: X
// IVT Score: X (low/medium/high risk)
// Flags: X
// Suspicious Patterns: X
// Status: ✅ Healthy or ⚠️ Issues Detected

IVT Score Test:

const score = window.ADMENSION_ANTI_ABUSE.ivtScore.score;
console.log("IVT Score:", score);
// Expected: 0-30 for normal users
// 30-70 = medium risk
// 70+ = high risk (would be excluded)

Refresh Limit Test:

  1. Refresh page 5 times quickly
  2. Check if rate limiting kicks in
  3. Verify IVT score increases

Expected Results:

  • ✅ IVT score starts at 0
  • ✅ Score increases with suspicious behavior
  • ✅ Legitimate browsing doesn't trigger flags
  • ✅ Rate limits are reasonable

Actual Results:

✅ PASS - Anti-fraud working, legitimate users not blocked

Test 8: Viewability Standards

Test Scenario: Verify only visible ads count

Manual Test:

  1. Open page normally
  2. Minimize browser window
  3. Leave for 2 minutes
  4. Restore window

Expected:

  • ✅ No impressions counted while minimized
  • ✅ Activity tracking pauses when inactive
  • ✅ Stagnation refresh doesn't trigger if recent activity

Console Check:

// Check viewability config
console.log("Min Viewability %:", 50);
console.log("Min Duration (ms):", 1000);
// These are the Google Ad Manager standards

Actual Results:

✅ PASS - Viewability requirements properly enforced

Test 9: Rate Limiting (Legitimate User)

Test Steps:

  1. Navigate through pages normally (5-10 page views)
  2. Check stats

Console Check:

const stats = window.ADMENSION_ANTI_ABUSE.getStats();
console.log("Session Refreshes:", stats.sessionRefreshes, "/ 10 max");
console.log("Hourly Refreshes:", stats.hourlyRefreshes, "/ 15 max");

Expected:

  • ✅ Normal browsing well under limits
  • ✅ No warnings or flags
  • ✅ IVT score remains low (< 30)

Actual Results:

✅ PASS - Normal users not affected by rate limits

Test 10: Interstitial Flow (3 Steps)

Test Steps:

  1. Visit: https://garebear99.github.io/ADMENSION/interstitial.html?code=A4AGRZ
  2. Wait for Step 1 timer (3s)
  3. Click "Next"
  4. Wait for Step 2 timer (3s)
  5. Click "Next"
  6. Read Step 3 message
  7. Select "Agree to Terms"
  8. Wait for Step 3 timer (10s)
  9. Click "Next"

Expected Results:

  • ✅ All 3 steps display correctly
  • ✅ Timers countdown properly
  • ✅ Buttons unlock at right time
  • ✅ Link name displays
  • ✅ Custom message shows
  • ✅ Redirects to destination URL
  • ✅ No console errors

Actual Results:

✅ PASS - Interstitial flow complete

Test 11: Offline Mode (localStorage Fallback)

Test Steps:

  1. Open DevTools (F12)
  2. Go to Network tab
  3. Set to "Offline" mode
  4. Try to create a link

Expected Results:

  • ✅ Link created locally
  • ✅ Warning: "API offline - saved locally"
  • ✅ Link works in same browser
  • ✅ Link won't work in other browsers (expected)

Actual Results:

✅ PASS - Offline fallback working correctly

Test 12: Admin Panel

Test Steps:

  1. Go to Admin page (?page=admin)
  2. Enter PIN: 979899
  3. Click "Unlock"

Expected Results:

  • ✅ Admin panel unlocks
  • ✅ Shows advanced controls
  • ✅ No unauthorized access without PIN

Actual Results:

✅ PASS - Admin protection working

Test 13: Stats Page

Test Steps:

  1. Navigate to Stats page
  2. Check displayed metrics
  3. Verify RPM calculation

Console Verification:

// Check stats
console.log("Sessions:", CFAMM_STATS.sessions);
console.log("Pageviews:", CFAMM_STATS.pageviews);
console.log("Ads Shown:", CFAMM_STATS.adsShown);

// Export stats
exportStats(); // Downloads JSON

Expected Results:

  • ✅ Stats display correctly
  • ✅ Numbers increase with usage
  • ✅ RPM calculation shows
  • ✅ Export function works

Actual Results:

✅ PASS - Stats tracking functional

Test 14: Mobile Responsiveness

Test Steps:

  1. Open site on mobile device OR
  2. Use DevTools device emulation (iPhone, Android)
  3. Test all pages
  4. Test link creation
  5. Test navigation

Expected Results:

  • ✅ Layout adapts to mobile
  • ✅ All buttons clickable
  • ✅ Forms usable
  • ✅ Navigation works
  • ✅ No horizontal scroll

Actual Results:

✅ PASS - Mobile responsive

Test 15: Cross-Browser Compatibility

Test Browsers:

  • Chrome/Chromium
  • Firefox
  • Safari
  • Edge

Test in Each:

  1. Homepage loads
  2. Navigation works
  3. Link creation works
  4. Console commands work

Expected Results:

  • ✅ Works in all major browsers
  • ✅ No browser-specific errors
  • ✅ Consistent behavior

Actual Results:

✅ PASS - Cross-browser compatible

🔬 Advanced API Tests

API Test Suite (Terminal)

# 1. Health Check
curl https://admension-api.admension.workers.dev/api/health

# 2. Create Link
curl -X POST https://admension-api.admension.workers.dev/api/links \
  -H "Content-Type: application/json" \
  -d '{
    "linkName": "Terminal Test",
    "destUrl": "https://example.com",
    "message": "Created from terminal",
    "chain": "ethereum",
    "addr": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
  }'

# Expected: {"success":true,"code":"ABC123",...}

# 3. Fetch Link (use code from step 2)
curl https://admension-api.admension.workers.dev/api/links/ABC123

# 4. Update Wallet
curl -X PUT https://admension-api.admension.workers.dev/api/links/ABC123 \
  -H "Content-Type: application/json" \
  -d '{"addr":"0xNEW_WALLET","chain":"ethereum"}'

# 5. Track Pageview
curl -X POST https://admension-api.admension.workers.dev/api/links/ABC123/view

🛡️ Security Tests

Test 16: XSS Prevention

Test Steps:

  1. Try to create link with name: <script>alert('XSS')</script>
  2. Try message: <img src=x onerror=alert('XSS')>

Expected Results:

  • ✅ Scripts don't execute
  • ✅ Content properly escaped
  • ✅ No XSS vulnerabilities

Actual Results:

✅ PASS - XSS prevented

Test 17: Rate Limiting (API)

Test Steps:

# Try to create 100 links rapidly
for i in {1..100}; do
  curl -X POST https://admension-api.admension.workers.dev/api/links \
    -H "Content-Type: application/json" \
    -d "{\"linkName\":\"Test$i\",\"destUrl\":\"https://example.com\"}" &
done
wait

Expected Results:

  • ✅ First 10-100 succeed
  • ✅ Then rate limited (429 status)
  • ✅ Rate limit is per IP
  • ✅ Timeout is temporary

Actual Results:

✅ PASS - API rate limiting working

📊 Performance Tests

Test 18: Page Load Speed

Test Steps:

  1. Open DevTools Network tab
  2. Hard refresh (Cmd+Shift+R)
  3. Check load time

Expected Results:

  • ✅ DOMContentLoaded < 1s
  • ✅ Full Load < 3s
  • ✅ No 404 errors
  • ✅ All scripts load

Actual Results:

✅ PASS - Fast load times

Test 19: API Response Time

Test Steps:

# Time the health check
time curl https://admension-api.admension.workers.dev/api/health

# Time link fetch
time curl https://admension-api.admension.workers.dev/api/links/A4AGRZ

Expected Results:

  • ✅ Health check < 200ms
  • ✅ Link fetch < 300ms
  • ✅ KV read latency < 50ms

Actual Results:

✅ PASS - API performance excellent

🎯 Final Verification Checklist

Core Functionality

  • Homepage loads correctly
  • All navigation works
  • Link creation (localStorage)
  • Link creation (API)
  • Global link sharing
  • Wallet management
  • Interstitial 3-step flow
  • Admin panel protection
  • Stats tracking

API Integration

  • Health endpoint responding
  • POST /api/links working
  • GET /api/links/:code working
  • PUT /api/links/:code working
  • POST /api/links/:code/view working
  • Offline fallback functional
  • localStorage caching working

Anti-Fraud Systems

  • IVT detection active
  • Rate limiting enforced
  • Viewability validation
  • Bot detection working
  • Activity tracking functional
  • Stagnation detection active
  • Legitimate users not blocked

Security

  • XSS prevention
  • No sensitive data exposed
  • Admin PIN protection
  • API rate limiting
  • Wallet validation

Performance

  • Page load < 3s
  • API response < 300ms
  • No console errors
  • Mobile responsive
  • Cross-browser compatible

Documentation

  • README up-to-date
  • Docs page updated
  • API documented
  • Anti-fraud documented
  • Console commands documented

🚀 Final Sign-Off

All Tests Status: ✅ PASS

Total Tests: 19 core tests + API suite + security tests
Passed: 19/19 (100%)
Failed: 0

Production Readiness: ✅ CONFIRMED

All systems tested and verified:

  • ✅ Core features working
  • ✅ API fully operational
  • ✅ Anti-fraud active and tested
  • ✅ Security hardened
  • ✅ Performance excellent
  • ✅ Documentation complete

📝 Testing Notes

Impression Tracking Optimization

The current configuration maximizes legitimate impressions while preventing fraud:

Viewability: 50% visible for 1+ second (Google standard)

  • This is the industry standard - not too strict
  • Legitimate users easily meet this threshold
  • Bots and minimized windows are filtered out

Rate Limits: 10/session, 15/hour

  • Generous enough for normal browsing
  • 10 pageviews per session = normal user behavior
  • Power users can have multiple sessions
  • Prevents obvious abuse (rapid refresh spam)

IVT Threshold: 70+ (high risk)

  • Normal users score 0-30 (safe)
  • Suspicious behavior scores 30-70 (monitored)
  • Only blatant bots/fraud hit 70+ (excluded)

Recommendation: Settings are optimal - maximize legitimate traffic while blocking fraud.


🎯 Launch Recommendation

READY FOR PUBLIC LAUNCH ✅

All systems verified and operational. No critical issues found.

Next Steps:

  1. ✅ Tests complete
  2. ⏭️ Push to GitHub (auto-deploys)
  3. ⏭️ Announce to users
  4. ⏭️ Monitor first 24 hours
  5. ⏭️ Apply for AdSense approval

Testing Date: January 22, 2026
Tester: Automated + Manual Verification
Status: APPROVED FOR PRODUCTION ✅