You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Start the development servercd frontend
npm run dev
# 2. Open browser to http://localhost:3000# 3. Open DevTools Console (F12)# 4. Clear localStoragelocalStorage.clear()
⚡ 10-Minute Smoke Test (Critical Path)
Test 1: Complete Creator Journey (5 min)
// 1. Connect MetaMask wallet// 2. Go to /creator// 3. Register:// Name: "Test Creator"// Organization: "Test Org"// Password: "test123"// 4. Go to /admin// 5. Click "Approve" on Test Creator// 6. Note the security key shown// 7. Back to /creator, login with credentials// 8. Go to Inbox, copy security key// 9. Go to Upload tab, paste key, click Unlock// 10. Upload content:// Title: "Test Article"// Description: "Test description"// Content: "This is test content for verification"// Type: "article"// Origin Proof: "https://test.com/source"// 11. Wait for verification animation// 12. Check "My Content" tab - should show article// ✅ PASS if: Content appears with hash, v1, timestamp
Test 2: Verify Content (2 min)
// 1. Copy the hash from "My Content"// 2. Go to /verify// 3. Select "Hash" method// 4. Paste the hash// 5. Click "Verify Content"// ✅ PASS if: Shows "Authentic Content" (blue), matches title and creator
Test 3: Explore & Search (2 min)
// 1. Go to /explore// 2. Should see your uploaded content + 5 mock items// 3. Search for "Test Article"// 4. Click on the card to view details// ✅ PASS if: Content shows in search, modal displays full details
Test 4: Content Update & Version History (1 min)
// 1. Go to /creator → My Content// 2. Click "Edit" on your article// 3. Change title to "Updated Test Article"// 4. Click Upload// 5. Check version shows "v2"// ✅ PASS if: Version increments, history shows v1
🧪 Automated Console Tests
Run in Browser Console
// TEST SUITE: TruthChain Functionality Checkerconsole.log("🧪 Starting TruthChain Test Suite...\n");// Test 1: LocalStorage Structureconsole.log("Test 1: LocalStorage Structure");consttruthchainContent=localStorage.getItem('truthchain_content');constadminCreators=localStorage.getItem('admin_creators');constcreatorCreds=localStorage.getItem('truthchain_creator_creds');console.log("✓ Content Storage:",truthchainContent ? "EXISTS" : "EMPTY");console.log("✓ Admin Creators:",adminCreators ? "EXISTS" : "EMPTY");console.log("✓ Creator Credentials:",creatorCreds ? "EXISTS" : "EMPTY");// Test 2: Content Countif(truthchainContent){constcontent=JSON.parse(truthchainContent);console.log(`✓ Total Content Items: ${content.length}`);console.log("✓ Content Types:",[...newSet(content.map(c=>c.contentType))].join(", "));}// Test 3: Creator Countif(adminCreators){constcreators=JSON.parse(adminCreators);console.log(`✓ Total Creators: ${creators.length}`);constapproved=creators.filter(c=>c.status==='approved').length;constpending=creators.filter(c=>c.status==='pending').length;constrejected=creators.filter(c=>c.status==='rejected').length;console.log(` - Approved: ${approved}`);console.log(` - Pending: ${pending}`);console.log(` - Rejected: ${rejected}`);}// Test 4: Hash Verificationif(truthchainContent){constcontent=JSON.parse(truthchainContent);console.log("\n✓ Hash Verification:");content.slice(0,3).forEach((item,i)=>{console.log(` ${i+1}. ${item.title}`);console.log(` Hash: ${item.hash}`);console.log(` Version: v${item.version}`);});}console.log("\n✅ Test Suite Complete!");
📊 Data Interlinking Verification
Check Data Consistency Across Pages
// Run this after uploading contentconstverifyDataInterlinking=()=>{constcontent=JSON.parse(localStorage.getItem('truthchain_content')||'[]');if(content.length===0){console.log("❌ No content found. Upload content first.");return;}consttestItem=content[0];console.log("🔗 Testing Data Interlinking for:",testItem.title);console.log("\n1. Creator Portal → Content exists:",!!testItem.id);console.log("2. Explore Page → Should be visible:",!testItem.blocked);console.log("3. Verify Page → Hash searchable:",testItem.hash);console.log("4. Admin Panel → Manageable:",!!testItem.creator);// Check creator existsconstcreators=JSON.parse(localStorage.getItem('admin_creators')||'[]');constcreator=creators.find(c=>c.address.toLowerCase()===testItem.creator.toLowerCase());console.log("5. Creator Registered:",!!creator);console.log("6. Creator Verified:",creator?.status==='approved');console.log("\n✅ All data properly interlinked!");};verifyDataInterlinking();
🔄 Dynamic Update Tests
Test Real-time Updates
// Test 1: Upload → Explore Updateconsole.log("Test: Upload → Explore Update");console.log("1. Upload content in Creator Portal");console.log("2. Go to Explore page (should appear immediately)");console.log("3. Refresh page (should persist)");// Test 2: Admin Block → Explore Updateconsole.log("\nTest: Admin Block → Explore Update");console.log("1. Block content in Admin panel");console.log("2. Check Explore page (should be hidden)");console.log("3. Unblock in Admin");console.log("4. Check Explore (should reappear)");// Test 3: Edit → Version Updateconsole.log("\nTest: Edit → Version Update");console.log("1. Edit content in Creator Portal");console.log("2. Version should increment (v1 → v2)");console.log("3. Old version should be in history");console.log("4. New hash should be generated");
🎯 Feature-Specific Tests
Verification Portal Tests
// Test all 4 verification methodsconsttestVerificationMethods=()=>{console.log("🔍 Verification Methods Test:\n");console.log("1. Hash Method:");console.log(" Input: 0xabcd1234efgh5678");console.log(" Expected: Authentic (Blue)");console.log("\n2. Text Method:");console.log(" Input: Any text");console.log(" Expected: Hash computed, verification result");console.log("\n3. File Method:");console.log(" Input: Upload any file");console.log(" Expected: Binary hash computed");console.log("\n4. Creator Method:");console.log(" Input: 0x1234abc567def890");console.log(" Expected: Redirect to profile");};testVerificationMethods();
Tamper Detection Test
consttestTamperDetection=()=>{console.log("🛡️ Tamper Detection Test:\n");console.log("Step 1: Upload content 'Hello World'");console.log("Step 2: Copy the generated hash");console.log("Step 3: Go to Verify → Text method");console.log("Step 4: Enter 'Hello World Modified'");console.log("Step 5: Paste original hash in 'Reference Hash' field");console.log("Step 6: Click Verify");console.log("\nExpected: Yellow Alert - 'Content Edited / Tampered'");};testTamperDetection();
📈 Performance Checks
// Check localStorage sizeconstcheckStorageSize=()=>{lettotal=0;for(letkeyinlocalStorage){if(localStorage.hasOwnProperty(key)){total+=localStorage[key].length+key.length;}}console.log(`📦 Total localStorage size: ${(total/1024).toFixed(2)} KB`);// Warn if approaching limit (5MB)if(total>4*1024*1024){console.warn("⚠️ localStorage approaching limit!");}};checkStorageSize();
🐛 Common Issues & Solutions
Issue 1: Content Not Appearing in Explore
// Debug:constcontent=JSON.parse(localStorage.getItem('truthchain_content')||'[]');console.log("Content count:",content.length);console.log("Blocked items:",content.filter(c=>c.blocked).length);// Solution: Check if content is blocked in Admin panel
Issue 2: Can't Upload Content
// Debug:constaccount="YOUR_WALLET_ADDRESS";// Replace with actualconstcreators=JSON.parse(localStorage.getItem('admin_creators')||'[]');constmyCreator=creators.find(c=>c.address.toLowerCase()===account.toLowerCase());console.log("Creator status:",myCreator?.status);console.log("Security key:",myCreator?.securityKey);// Solution: Ensure admin approved and security key entered
Issue 3: Verification Shows Unverified
// Debug:consthash="YOUR_HASH";// Replace with actualconstcontent=JSON.parse(localStorage.getItem('truthchain_content')||'[]');constfound=content.find(c=>c.hash===hash);console.log("Hash found:",!!found);console.log("Hash matches:",found?.hash===hash);// Solution: Ensure exact hash match (case-sensitive)
✅ Success Criteria
All Tests Pass If:
✅ Content uploads successfully with verification animation
✅ Content appears in Explore page immediately
✅ Hash verification returns "Authentic" for uploaded content
✅ Tamper detection shows "Edited" for modified content
✅ Version history tracks all edits
✅ Admin controls affect content visibility
✅ Creator authentication works (register/login/logout)
✅ Security key unlocks upload feature
✅ Data persists after page refresh
✅ All pages show cosmos background
🎬 Video Recording Test Session
# Use browser's built-in recorder or:# 1. Open DevTools → Performance tab# 2. Click Record# 3. Execute test scenarios# 4. Stop recording# 5. Analyze timeline for any errors
📝 Test Report Template
Test Date: [DATE]
Tester: [NAME]
Environment: [Browser + Version]
| Test ID | Test Name | Status | Notes |
|---------|-----------|--------|-------|
| TC-001 | Navigation | ✅ PASS | All links work |
| TC-006 | Registration | ✅ PASS | Success message shown |
| TC-024 | Upload | ✅ PASS | Content created |
| TC-042 | Verify Hash | ✅ PASS | Authentic result |
| TC-067 | Full Journey | ✅ PASS | End-to-end works |
Overall Result: ✅ PASS / ❌ FAIL