Version: 1.0.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Last Updated: 2026-02-09
Module: HR (Human Resources) - Hiring to Onboarding Integration
Status: Active
Overview
This document defines comprehensive end-to-end (E2E) test scenarios for the HR module, focusing on real-world workflows from job posting through employee onboarding. Each scenario includes step-by-step instructions, test data setup, validation assertions, and database verification queries.Scope
- HR-09: Applicant Tracking System (ATS) - Job postings, applications, offers
- HR-03: Onboarding - Checklists, credentials, benefits, tax forms, skills
- HR-01: Employee Directory - Employee records and profiles
- Cross-Module: Event-driven integration between ATS and Onboarding
Test Environment
- Organization: NorthSight Recovery (Test Org ID:
75fc234d-79e9-461f-8cab-1cbe0384b1d2) - Database: Lovable Cloud (Supabase)
- Test Users: See Test Data Setup
- Duration: ~30-45 minutes per full scenario
Test Data Setup
Users
| Role | Department | Organization | |
|---|---|---|---|
jbloom@northsightrecovery.com | org_admin | Admin | Encore Health OS |
hiring-manager@northsightrecovery.com | department_manager | Clinical | Encore Health OS |
hr-admin@northsightrecovery.com | hr_admin | HR | Encore Health OS |
test-candidate@example.com | candidate (external) | N/A | N/A |
Required Database Records
Before running E2E tests, ensure these records exist:Journey 5: Hiring to Onboarding (Full Cycle)
Objective: Test the complete workflow from job posting through employee onboarding initiation when an offer is accepted. Scenario: Hire a new Clinical Therapist through the ATS and verify automatic onboarding creation. Expected Duration: 30-45 minutesPhase 1: Job Posting (Steps 1-8)
Step 1: Log in as Hiring Manager
- Actor: Hiring Manager (
hiring-manager@northsightrecovery.com) - Action: Log in to application
- Expected Result: Redirect to HR dashboard with hiring manager role
Step 2: Navigate to Job Postings
- Actor: Hiring Manager
- Path: HR → Recruitment → Job Postings
- Expected Result: Job postings list displays
Step 3: Create New Job Posting
- Actor: Hiring Manager
- Action: Click “Create Job Posting”
- Form Data:
- Position Title: Clinical Therapist - Test
- Position Level: 3 (Full Time)
- Department: Clinical
- Status: Active
- Description: “Test position for E2E testing”
- Qualifications: “LCSW license required”
- Salary Min: 55000
- Salary Max: 75000
- Expected Result: Job posting created, receives UUID
Step 4: Publish Job Posting
- Actor: Hiring Manager
- Action: Update job posting status to “Published”
- Expected Result: Status changes, posting becomes visible to candidates
Step 5: Navigate to Candidates
- Actor: Hiring Manager
- Path: HR → Recruitment → Candidates
- Expected Result: Candidates list displays (initially empty or with existing candidates)
Step 6: Create Candidate Manually (or use external application)
- Actor: Hiring Manager OR Candidate submits through portal
- Option A - Manual Creation:
- Click “Add Candidate”
- Form Data:
- First Name: John
- Last Name: Applicant
- Email:
test-candidate-e2e-001@example.com - Phone: 480-555-0001
- Source: Direct Application
- Click “Save”
- Expected Result: Candidate created with UUID
Step 7: Create Application
- Actor: Hiring Manager
- Action:
- Go to candidate detail
- Click “Create Application”
- Select the job posting created in Step 3
- Click “Submit”
- Expected Result: Application created in “applied” stage
Step 8: Verify Application in Pipeline
- Actor: Hiring Manager
- Path: HR → Recruitment → Applications or Pipeline
- Expected Result: Application appears in “Applied” stage with candidate name and position
Phase 2: Application Screening & Interview (Steps 9-16)
Step 9: Screen Application
- Actor: Hiring Manager
- Action:
- Open application detail
- Scroll to “Screening” section
- Click “Screen Candidate”
- Form Data:
- Screening Result: Approved
- Notes: “Strong background, excellent references”
- Expected Result: Application moves to “screened” stage
Step 10: Schedule Interview
- Actor: Hiring Manager
- Action:
- In application detail, scroll to “Interview” section
- Click “Schedule Interview”
- Form Data:
- Interview Type: Phone Screening
- Scheduled Date: [Today + 3 days at 10:00 AM]
- Interviewer: Hiring Manager
- Notes: “Initial phone screening with candidate”
- Expected Result: Interview scheduled
Step 11: Complete Interview (as Hiring Manager)
- Actor: Hiring Manager
- Action:
- Open application
- Navigate to scheduled interview
- Click “Complete Interview”
- Form Data:
- Interview Result: Passed
- Rating: 4/5
- Feedback: “Excellent communication skills, demonstrates strong knowledge of evidence-based practices”
- Next Step: Proceed to offer
- Expected Result: Interview marked complete, application moves to “interviewed” stage
Step 12: Move to Offer (Alternative: Skip to Offer)
- Actor: Hiring Manager
- Action:
- In application detail, click “Create Offer” button
- OR go to Offers list and create new offer
- Expected Result: Offer creation form displays
Step 13: Create Job Offer
- Actor: Hiring Manager
- Action: Create offer with form data
- Form Data:
- Position: Clinical Therapist - Test
- Applicant: John Applicant
- Start Date: [Today + 30 days]
- Salary: 65000
- Employment Type: Full-Time
- Status: Draft
- Notes: “Welcome to the team!”
- Expected Result: Offer created in “draft” status
Step 14: Send Offer
- Actor: Hiring Manager
- Action:
- Open offer detail
- Click “Send Offer to Candidate”
- Confirm sending
- Expected Result: Offer status changes to “pending”, candidate receives notification
Step 15: Candidate Reviews Offer (Manual or Automated)
- Actor: Candidate OR Hiring Manager on behalf of candidate
- Action (if manual via candidate portal):
- Candidate receives email link or logs into candidate portal
- Views offer details
- Accepts or declines offer
- Action (if testing via backend directly):
- Skip to Step 16 - simulate acceptance
- Expected Result: Offer status updates based on candidate action
Step 16: Accept Offer (Trigger Hiring)
- Actor: Hiring Manager (acting as administrator) OR Candidate (in portal)
- Action:
- Open offer detail
- Click “Accept Offer” button
- Add optional acceptance notes
- Confirm acceptance
- Expected Result:
- Offer status changes to “accepted”
accepted_attimestamp recorded- Employee record created automatically (via database trigger)
hr_employee_hiredevent published- Onboarding instance created (if auto_create_onboarding enabled)
Phase 3: Employee Record Verification (Steps 17-20)
Step 17: Verify Employee Created
- Actor: HR Admin
- Path: HR → Employee Directory → All Employees
- Expected Result: New employee appears in list with:
- Name: John Applicant
- Hire Date: [Start date from offer]
- Department: Clinical
- Status: Active (or New)
Step 18: View Employee Detail
- Actor: HR Admin
- Action: Click on new employee
- Expected Result: Employee profile displays with:
- Full contact information
- Hire date
- Department and manager
- Employment status
- Link to onboarding
Step 19: Verify Hire Transitions Recorded
- Actor: HR Admin (optional deep dive)
- Query: Database verification only
Step 20: Verify Event Published (optional)
- Actor: System/Audit (verification only)
- Query: Check event logs (if available in your infrastructure)
Phase 4: Onboarding Instance Creation & Configuration (Steps 21-28)
Step 21: Verify Onboarding Instance Created
- Actor: Employee OR HR Admin
- Expected Result: Onboarding instance exists with correct configuration
Step 22: Navigate to Employee Onboarding Hub
- Actor: New Employee (simulated)
- Path: HR → My Onboarding (or as new employee)
- Expected Result: Onboarding hub loads with:
- Overall progress (should be 0% or minimal)
- 6 section cards: Tasks, Credentials, Benefits, Tax Forms, Skills, Job Description
- Timeline view showing Day 1 to Day 90
- Milestone indicators
Step 23: Verify Onboarding Task Instances Created
- Actor: System verification
- Expected Result: Tasks created from template
Step 24: Verify Task Count and Types
- Expected Result: Standard Onboarding template creates ~15-20 tasks including:
- IT setup tasks
- Compliance tasks
- Department-specific tasks
Step 25: Access Tasks Section
- Actor: New Employee
- Path: Onboarding Hub → Your Tasks
- Expected Result: Task list displays with:
- Task names and descriptions
- Due dates
- Status indicators
- Ability to mark complete
Step 26: Complete First Task
- Actor: New Employee
- Action:
- Click first task (usually IT-related)
- Read instructions
- Click “Mark Complete”
- Expected Result: Task status changes to “completed”, overall progress updates
Step 27: Verify Progress Updated
- Actor: New Employee
- Expected Result:
- Task shows as completed
- Overall progress percentage increased
- Dashboard updates to show new progress
Step 28: Check Benefits Section
- Actor: New Employee
- Path: Onboarding Hub → Benefits Enrollment
- Expected Result: Benefits section displays:
- Available plans
- Enrollment deadline
- “Not Started” status until employee enrolls
Phase 5: Manager Monitoring (Steps 29-36)
Step 29: Navigate to Onboarding Command Center
- Actor: Manager (
hiring-manager@northsightrecovery.com) - Path: HR → Admin → Onboarding Command Center
- Expected Result: Dashboard displays with:
- Summary cards (active onboardings, at-risk count)
- Status grid showing all team member onboardings
Step 30: Find New Employee in Status Grid
- Actor: Manager
- Expected Result: New employee (John Applicant) appears in grid showing:
- Name
- Progress percentage (currently low, ~5%)
- Status in each section (Checklist, Credentials, Benefits, Tax, Skills, Job Description)
Step 31: View Employee Detail from Command Center
- Actor: Manager
- Action: Click on new employee row
- Expected Result: Detailed onboarding view displays showing:
- Current milestone (Day 1)
- Section progress breakdown
- At-risk indicators (if applicable)
- Quick actions menu
Step 32: Schedule 30-Day Check-in
- Actor: Manager
- Action:
- In employee onboarding detail
- Find “Milestones” section
- Click “Schedule 30-Day Check-in”
- Form Data:
- Date: [Today + 30 days]
- Time: 2:00 PM
- Location: Zoom (or in-person)
- Notes: “Review first month progress”
- Expected Result: Check-in scheduled
Step 33: Send Reminder to Employee
- Actor: Manager
- Action:
- In employee onboarding detail
- Click “Send Reminder”
- Select sections to remind about
- Confirm
- Expected Result:
- Notification created for employee
- HR system records reminder sent
- Employee receives notification/email
Step 34: View HR Settings (Optional)
- Actor: HR Admin
- Path: HR → Settings → Onboarding Configuration
- Expected Result: Settings page shows:
auto_create_onboardingtoggle (should be ON)default_onboarding_template_id(should be set)- Milestone date configuration
- Task deadline defaults
Step 35: Verify Auto-Onboarding Setting
- Query: Confirm auto-create is enabled
Step 36: Monitor Overall Progress
- Actor: Manager
- Action: Periodically refresh Command Center to see progress updates
- Expected Result: Progress percentage increases as employee completes sections
Phase 6: Credentials & Compliance (Steps 37-44)
Step 37: Navigate to Credentials Section
- Actor: New Employee
- Path: Onboarding Hub → Professional Credentials
- Expected Result: Credentials section displays:
- Required credentials list
- “Not Started” status
- “Upload Credential” button
Step 38: Upload License/Certification
- Actor: New Employee
- Action:
- Click “Upload Credential”
- Select credential type (e.g., “LCSW License”)
- Upload document (PDF or image)
- Enter expiration date [Today + 3 years]
- Submit
- Expected Result: Credential uploaded and shown as “Pending Verification”
Step 39: HR Verifies Credential
- Actor: HR Admin
- Path: HR → Compliance → Credentials or Onboarding Command Center
- Action:
- Find employee’s credential
- Review uploaded document
- Click “Verify” or “Approve”
- Add notes if needed
- Expected Result: Credential status changes to “Verified”
Step 40: Verify Credential Progress Updated
- Actor: New Employee
- Expected Result: Credentials section now shows:
- 1 of 1 verified
- Status changed to “In Progress” or “Completed”
- Overall progress percentage increased
Step 41: Test Expiring Soon Alert
- Actor: System (optional - requires advanced date manipulation)
- Query: Test credential approaching expiration
Step 42: Repeat for Additional Credentials
- Actor: New Employee
- Action: If multiple credentials required, repeat Steps 38-40
- Expected Result: All required credentials uploaded and verified
Step 43: Verify Credentials Completion
- Query: Confirm all required credentials verified
Step 44: Check Credentials Section Status
- Actor: New Employee
- Expected Result: Credentials section shows green checkmark, 100% completion
Phase 7: Tax & Payroll Setup (Steps 45-52)
Step 45: Navigate to Tax & Payroll Section
- Actor: New Employee
- Path: Onboarding Hub → Tax & Payroll
- Expected Result: Tax & Payroll section displays:
- W-4 form status (“Not Started”)
- Direct deposit status (“Not Started”)
- Progress indicator
Step 46: Start W-4 Form
- Actor: New Employee
- Action:
- Click “Complete W-4 Form”
- Follow wizard steps
- Form Data (Step 1):
- First Name: John
- Last Name: Applicant
- SSN: 123-45-6789 (test SSN)
- Address: 1234 Test St, Phoenix, AZ 85001
- Form Data (Step 2):
- Filing Status: Single
- Claim Dependents: 0
- Other Income: None
- Deductions: Standard
- Expected Result: W-4 submitted and marked as pending
Step 47: Set Up Direct Deposit
- Actor: New Employee
- Action:
- In Tax & Payroll section, click “Set Up Direct Deposit”
- Enter banking information
- Form Data:
- Bank Name: Chase Bank
- Routing Number: 021000021 (test routing)
- Account Number: 123456789
- Account Type: Checking
- Expected Result: Direct deposit configured
Step 48: HR Verifies Tax Setup
- Actor: HR Admin or Payroll Staff
- Action:
- Review W-4 form
- Verify direct deposit information
- Mark as processed
- Expected Result: Tax setup marked complete
Step 49: Verify Tax Section Status
- Actor: New Employee
- Expected Result: Tax & Payroll section shows:
- W-4: ✅ Complete
- Direct Deposit: ✅ Complete
- Progress: 100%
Step 50: Test W-4 Update (Optional)
- Actor: New Employee
- Action:
- If W-4 form updateable, modify claiming information
- Resubmit
- Expected Result: New W-4 version created, previous archived
Step 51: Verify Payroll Integration
- Query: Confirm tax data linked to employee payroll record
Step 52: Check Tax Section Status
- Actor: New Employee
- Expected Result: Tax & Payroll section shows green checkmark, 100% completion
Phase 8: Skills Assessment (Steps 53-60)
Step 53: Navigate to Skills Section
- Actor: New Employee
- Path: Onboarding Hub → Skills Assessment
- Expected Result: Skills section displays:
- List of required job skills
- Self-assessment rating scale
- “Not Started” status
Step 54: Complete Skills Self-Assessment
- Actor: New Employee
- Action:
- For each skill, select rating:
- Novice / Intermediate / Advanced / Expert
- Add comments for key skills
- Submit
- For each skill, select rating:
- Form Data Examples:
- Evidence-Based Therapy: Intermediate
- Assessment & Evaluation: Advanced
- Documentation: Intermediate
- Crisis Intervention: Novice
- Clinical Supervision: Advanced
- Expected Result: Self-assessment submitted
Step 55: Manager Verifies Skills
- Actor: Manager
- Path: Onboarding Command Center → Employee Detail → Skills Section
- Action:
- Review employee’s self-assessment
- For each skill, confirm or adjust rating
- Add manager feedback/coaching notes
- Submit
- Expected Result: Manager verification recorded
Step 56: Identify Development Needs
- Actor: Manager (Optional - system analysis)
- Expected Result: Skills where self-assessment > manager verification identified as development areas
Step 57: Repeat Skills Verification
- Actor: Manager
- Action: Complete all required skills verification
- Expected Result: All skills have manager verification
Step 58: View Skills Verification Summary
- Actor: New Employee
- Expected Result: Skills section shows:
- All skills listed with verified ratings
- Manager feedback visible
- Status: ✅ Complete
Step 59: Verify Skills Section Status
- Query: Confirm all required skills verified
Step 60: Check Overall Progress Update
- Actor: New Employee
- Expected Result: Overall onboarding progress now ~70% (tasks, credentials, tax, skills mostly done)
Phase 9: Benefits Enrollment & Job Description (Steps 61-68)
Step 61: Navigate to Benefits Section
- Actor: New Employee
- Path: Onboarding Hub → Benefits Enrollment
- Expected Result: Benefits section displays available plans with details
Step 62: Review Benefit Plans
- Actor: New Employee
- Action:
- Click each plan category to view details:
- Medical plans
- Dental plans
- Vision plans
- 401(k) plan
- Review coverage, costs, deductibles
- Click each plan category to view details:
- Expected Result: Plan information displays clearly
Step 63: Enroll in Benefits
- Actor: New Employee
- Action:
- For each plan type, select to Enroll or Decline
- If enrolling, select coverage level:
- Medical: Employee + Spouse
- Dental: Employee Only
- Vision: Employee Only
- 401(k): $300/pay period
- Review selections
- Confirm enrollment
- Expected Result: Elections submitted
Step 64: Verify Benefits Enrollment
- Actor: HR Admin
- Action: Review employee’s benefits elections
- Expected Result: All elections recorded correctly
Step 65: Navigate to Job Description Section
- Actor: New Employee
- Path: Onboarding Hub → Job Description
- Expected Result: Job description displays:
- Position title
- Key responsibilities
- Reporting structure
- “Acknowledge” button
Step 66: Review and Acknowledge Job Description
- Actor: New Employee
- Action:
- Read job description
- Click “I Acknowledge”
- Confirm understanding
- Expected Result: Acknowledgment recorded with timestamp
Step 67: Verify All Sections Complete
- Actor: New Employee
- Expected Result: Dashboard shows:
- ✅ Your Tasks: ~90% (most complete)
- ✅ Credentials: 100% (all verified)
- ✅ Benefits: 100% (all enrolled)
- ✅ Tax Forms: 100% (W-4 + Direct Deposit)
- ✅ Skills: 100% (all verified)
- ✅ Job Description: 100% (acknowledged)
- Overall Progress: ~95-100%
Step 68: Complete Onboarding (Optional - Requires Day 90 Check-in)
- Actor: Manager or HR Admin
- Action:
- After Day 90 milestone check-in completed
- Click “Complete Onboarding”
- Mark as successful transition to standard employee status
- Expected Result:
- Onboarding status changes to “completed”
- Employee moved to full active status (if applicable)
- Onboarding instance archived/closed
Success Criteria
Phase 1: Job Posting ✅
- Job posting created and published
- Application created from candidate
- Status workflow functioning (applied → screened → interviewed)
Phase 2: Hiring Process ✅
- Interviews can be scheduled and completed
- Offer created and sent to candidate
- Offer acceptance triggers employee creation
Phase 3: Employee Record ✅
- Employee record created on offer acceptance
- Hire date correctly set from offer start date
- Employee visible in directory within 5 seconds
- Hire transitions recorded in audit table
Phase 4: Auto-Onboarding ✅
- Onboarding instance created automatically on offer acceptance
- Onboarding instance uses configured default template
- Onboarding tasks created from template (15-20 tasks)
- Employee can access onboarding hub immediately
Phase 5: Manager Monitoring ✅
- Manager can view employee in Command Center
- Manager can see real-time progress updates
- Manager can schedule check-ins
- Manager can send reminders to employee
Phase 6: Credentials ✅
- Credentials section displays required credentials
- Employee can upload documents
- HR can verify credentials
- Progress updates when credentials verified
Phase 7: Tax & Payroll ✅
- W-4 form completable and submittable
- Direct deposit setup completable
- Tax data linked to employee record
- Tax section shows completion status
Phase 8: Skills ✅
- Skills assessment available for employee
- Manager can verify skills with feedback
- All required skills can be verified
- Skills section reflects completion
Phase 9: Benefits & Job Description ✅
- Benefits enrollment available with plan details
- Employee can enroll in multiple plans
- Job description acknowledgment recordable
- Overall progress reaches 95-100% on completion
Integration Points ✅
- Event published on offer acceptance
- Onboarding created within 2-5 seconds of offer acceptance
- No gaps in data flow from hiring to onboarding
- Multi-tenant security enforced throughout (only see own data)
- All timestamps accurate and consistent
Troubleshooting & Edge Cases
Issue: Onboarding Not Created
Symptoms: Employee hired but no onboarding instance visible Checks:- Verify
auto_create_onboarding = truein hr_module_settings - Verify
default_onboarding_template_idis set to valid template - Check for errors in browser console during offer acceptance
- Check database logs for RPC call errors
Issue: Progress Not Updating
Symptoms: Task completed but progress percentage stays same Checks:- Refresh page to see updated progress
- Verify task is actually marked complete in database
- Check if progress calculation is accurate
Issue: Employee Can See Others’ Onboarding
Symptoms: RLS policy not enforcing multi-tenant security Checks:- Verify RLS policies enabled on all hr tables
- Verify current_user_id() function available
- Check policy conditions reference auth.uid()
Regression Tests (Quick Verification)
For quick smoke testing of the hiring-to-onboarding flow, run these steps:- Create job posting
- Add candidate
- Create application
- Accept offer
- Verify employee created
- Verify onboarding instance created
- Verify tasks exist
- Verify manager can see employee in Command Center
Appendix: Test Data Cleanup
After E2E testing, clean up test data in reverse dependency order:Document Status: Complete and tested
Last Updated: 2026-02-09
Next Review: 2026-05-09 or after major ATS/Onboarding changes