# RateRight QA Testing Preparation Document
**Version:** 1.0  
**Date:** 2026-02-15  
**App URL:** https://rivet.rateright.com.au  
**Test Window:** Michael's evening slot (7-8:30pm)  

## 🎯 Executive Summary

RateRight is demo-ready with seed data, smart matching, and phone collection. Builder (Claude Code) completed a bug audit overnight. The app needs comprehensive QA testing before launch, focusing on payment flows, user journeys, and edge cases.

## 📋 Test Scope

### Core User Flows
1. **Worker Signup** - Including voice recording and phone validation
2. **Contractor Signup** - Including ABN verification
3. **Job Posting** - Full job creation workflow
4. **Matching Algorithm** - Viewing matches and match scores
5. **Payment Flow** - Critical: Stripe test vs live mode verification
6. **Messaging** - Communication between matched workers/contractors
7. **Rating/Review System** - Post-job feedback
8. **Notifications** - Real-time updates

### Edge Cases
- Payment failures and recovery
- Browser refresh during payment
- Multiple hires from same contractor
- Concurrent user sessions
- Network interruptions

## 🧪 Test Environment

### Prerequisites ✅
- **Seed Data:** 10 workers, 3 contractors, 5 jobs (created by Builder)
- **App Deployment:** Live at https://rivet.rateright.com.au
- **Phone Validation:** AU format support added (04xx xxx xxx)
- **Smart Matching:** Algorithm verified and working
- **Build Status:** Clean, 0 errors, all tests passing

### Test Accounts
Create these before testing:
- **Contractor Account:** Use real email/phone
- **Worker Account:** Use secondary email
- **Test Worker Profiles:** Apply to jobs with different skill sets

## 🔍 Detailed Test Cases

### 1. Worker Signup Flow
**Time Estimate:** 5 minutes

**Steps:**
1. Navigate to homepage → Click "Sign Up as Worker"
2. Enter email, password (min 8 chars, 1 uppercase, 1 number)
3. Complete phone validation (AU format: 04xx xxx xxx)
4. Check email for verification → Click link
5. Complete profile (name, location, skills, experience)
6. **Voice Recording:** Test voice profile feature
7. Upload profile photo
8. Verify dashboard shows "Profile Complete"

**Expected Results:**
- Phone validation accepts only AU formats
- Voice recording works on mobile/desktop
- Profile completion tracking accurate
- No console errors during signup

**Test Data:**
- Email: testworker@example.com
- Phone: 0412 345 678
- Trade: Steel Fixer
- Experience: 3-5 years

### 2. Contractor Signup Flow
**Time Estimate:** 7 minutes

**Steps:**
1. Navigate to homepage → Click "Sign Up as Contractor"
2. Enter business email and ABN
3. **ABN Verification:** Test with real ABN (e.g., 53 104 690 743)
4. Complete business profile
5. Upload business documents (test PDF upload)
6. Connect Stripe account
7. Set up billing preferences

**Expected Results:**
- ABN verification works with real ABNs
- Document upload accepts PDF/JPG < 10MB
- Stripe connection redirects properly
- Contractor dashboard accessible post-signup

**Test Data:**
- ABN: 53 104 690 743 (Bunnings Group Ltd - known valid)
- Business Type: Construction Company
- Location: Sydney CBD

### 3. Job Posting Flow
**Time Estimate:** 5 minutes

**Steps:**
1. Login as contractor → Click "Post New Job"
2. Enter job details with AI assistance:
   - Title: "Steel Fixers Needed for CBD Project"
   - Location: Sydney CBD
   - Duration: 2 weeks
   - Rate: $35/hour
3. Test voice input for job description
4. Add required skills and experience level
5. Review and publish

**Expected Results:**
- AI job description generation works
- Voice input accurately converts speech to text
- Job appears in worker search results
- Can edit/unpublish job after posting

### 4. Matching Algorithm
**Time Estimate:** 5 minutes

**Steps:**
1. Post job with specific requirements
2. Login as different worker profiles
3. Check worker dashboard for job recommendations
4. Verify match scoring considers:
   - Location proximity
   - Skill matching
   - Experience level
   - Availability
5. Test search filters and sorting

**Expected Results:**
- Match scores visible (0-100%)
- Relevant jobs appear based on profile
- Distance calculation accurate
- No irrelevant job suggestions

### 5. Payment Flow (CRITICAL)
**Time Estimate:** 10 minutes

**Pre-Test Verification:**
1. Open browser console (F12)
2. Look for "Stripe test mode active" message
3. If "live mode" visible → STOP and contact Builder

**Test Cards:**
- ✅ Success: 4242 4242 4242 4242 (any future date, any CVC)
- ❌ Decline: 4000 0000 0000 0002
- 🔄 3D Secure: 4000 0025 0000 3155

**Steps:**
1. Worker applies to job
2. Contractor views application → Click "Hire"
3. Enter payment details with test card
4. Complete $50.00 payment
5. Verify post-payment:
   - Messaging unlocks between users
   - Worker's contact details visible
   - Payment confirmation email received
   - Job status updates to "Hired"

**Edge Cases:**
- Payment failure handling
- Browser refresh during payment
- Multiple hire attempts

**Expected Results:**
- Payment processes in < 5 seconds
- Clear success/error messages
- Immediate unlock of messaging
- Email confirmation received

### 6. Messaging System
**Time Estimate:** 5 minutes

**Steps:**
1. After successful hire, test messaging:
   - Send text messages
   - Attach images/PDFs
   - Check real-time notifications
2. Test message history persistence
3. Verify "Hire" button creates contract

**Expected Results:**
- Messages deliver instantly
- File uploads work (< 10MB)
- Notifications received on both ends
- Message thread persists

### 7. Rating/Review System
**Time Estimate:** 3 minutes

**Steps:**
1. Complete a job (mark as finished)
2. Navigate to rating page
3. Submit star rating (1-5) and comment
4. Check rating appears on worker profile
5. Verify contractor can view submitted ratings

**Expected Results:**
- Rating submission works
- Reviews visible on profiles
- Average rating calculated correctly
- Both parties can leave reviews

### 8. Notifications
**Time Estimate:** 2 minutes

**Steps:**
1. Test notification triggers:
   - New job application
   - Hire confirmation
   - New messages
   - Payment completion
2. Check notification bell icon
3. Verify unread count updates
4. Test marking notifications as read

**Expected Results:**
- Notifications appear in real-time
- Unread count accurate
- Deep linking to relevant pages
- Can mark as read/dismiss

## 🐛 Known Issues (Fixed by Builder)

From Builder's bug audit (2026-02-15):

### Fixed Issues ✅
1. **Stale JS chunks** - Fixed redirect issues
2. **Server action errors** - Build errors resolved
3. **Client reference manifest error** - Clean build
4. **MIME type issues** - Static assets loading
5. **Console.log cleanup** - No production logs
6. **TypeScript 'any' types** - Fixed type safety

### Current Status
- Build: Clean, 0 errors
- Tests: 6/6 passing
- Console: 0 errors
- Mobile UX: Verified working
- API endpoints: All functional

## ⚠️ What Can't Be Tested Autonomously

### Requires Real Accounts/Verification
1. **ABN Lookup** - Needs real ABN for full verification
2. **Email Delivery** - Requires access to admin email inbox
3. **SMS Notifications** - Needs SMS provider configuration
4. **Live Stripe Mode** - Currently in test mode only
5. **Real Payment Processing** - Test cards only

### Requires Michael's Input
1. **Contractor onboarding documents** - Real business licenses
2. **Insurance verification** - Actual insurance documents
3. **Business verification** - Real company details
4. **Domain configuration** - DNS settings for rateright.com.au

## 📊 Recommended Testing Approach

### Testing Order (90-minute session)
1. **Setup (10 min)** - Create test accounts, verify environment
2. **Worker Flows (20 min)** - Signup, profile, job search
3. **Contractor Flows (20 min)** - Signup, job posting, applications
4. **Payment Testing (25 min)** - Critical path, edge cases
5. **Messaging & Ratings (10 min)** - Post-hire features
6. **Wrap-up (5 min)** - Document issues, screenshots

### What to Watch For
- **Performance:** Page loads < 3 seconds, API responses < 500ms
- **Mobile Experience:** Touch targets, responsive design
- **Error Handling:** Clear messages, graceful failures
- **Data Integrity:** No lost data on refresh/navigation

### Documentation During Testing
- Screenshot all error messages
- Note exact steps to reproduce issues
- Record video for complex bugs
- Document browser/OS versions

## 🚨 Critical Success Criteria

### Must Pass Before Launch
- [ ] Payment flow works end-to-end
- [ ] All user signup flows complete without errors
- [ ] Matching algorithm shows relevant results
- [ ] Messaging unlocks after successful payment
- [ ] No console errors in any tested flow
- [ ] Mobile experience functional on iOS/Android

### Performance Benchmarks
- Page load: < 3 seconds
- API response: < 500ms
- Payment processing: < 5 seconds
- Search results: < 2 seconds

## 📞 Support During Testing

### If Issues Found
1. Screenshot the error immediately
2. Note exact steps to reproduce
3. Check browser console for errors
4. Document browser and OS version
5. Send via Telegram to Builder

### Emergency Contacts
- **Builder (Claude Code):** Via Rivet bridge
- **Rivet:** Direct message in Telegram
- **System Status:** https://rivet.rateright.com.au/health

---

**Document Version:** 1.0  
**Last Updated:** 2026-02-15  
**Next Review:** Post-QA testing completion