Onboarding — End-to-End Test Scenarios
Overview
End-to-end test covering the full post-registration onboarding flow — from first login through context approval, strategy approval, and deliverable plan approval to a live dashboard.
Tested via: MCP Playwright browser (real browser, not CLI specs)
Portals: Dashboard (port 3000), Manage (port 3001)
Date verified: 2026-04-10
Prerequisites
Step 0 — Complete self-signup first.
The onboarding flow begins where the signup flow ends. Run Scenario A — Full Happy Path from the self-signup test scenarios doc to create a fresh tenant account before starting here.
- All Docker containers healthy (
docker ps) - All dev servers running (see startup procedure)
- Queue worker running:
pnpm --filter api worker - Scheduler worker running:
pnpm --filter @leadmetrics/server-scheduler dev - Tenant account created via signup (email:
moble+signup-a-1@leadmetrics.ai, company: BrightCoral Digital Pvt Ltd)
Actors
| Actor | Credentials | Portal |
|---|---|---|
| Tenant admin | moble+signup-a-1@leadmetrics.ai / Password123 | Dashboard (3000) |
| Super admin | superadmin@leadmetrics.ai / admin | Manage (3001) |
Dashboard Stage Reference
The dashboard GettingStartedView shows different content based on the pipeline stage:
| Stage | Trigger condition | Banner title |
|---|---|---|
| 1 (Analysing) | Context not yet completed or approved | ”AI agents are working on your account…” (if generating) or “Your account is ready to configure” |
| 2 (Strategy) | Context approved, no goals generated yet | ”Building your marketing strategy…“ |
| 3 (Goals set) | Goals exist, no activities yet | ”Goals & KPIs are set — agents will start working soon” |
| 5+ (Regular) | Activities and active period exist | Full RegularDashboard (stats, pipeline, etc.) |
Scenario A — Full Happy Path
Step 1 — First Login
- Navigate to
http://localhost:3000/login - Enter email:
moble+signup-a-1@leadmetrics.ai, password:Password123 - Click Sign in
Expected:
- Redirected to
/dashboard GettingStartedViewshown at Stage 1- Banner: “AI agents are working on your account…” (pulsing clock icon if generating, sparkles if not)
- Body: “We’re researching your business and building your strategy. This usually takes 5–15 minutes. You’ll receive an email when it’s ready.”
- 4-step workflow card: Step 1 = “In progress”, Steps 2–4 = upcoming
Step 2 — View Context (While Generating)
- Navigate to
http://localhost:3000/client-info?tab=context
Expected (if agents are still running):
- Blue banner: “AI agents are researching your business. This usually takes 3–8 minutes. The page will update automatically when done.”
- Agent status panel visible with streaming updates
Note:
/settings/contextredirects to/client-info?tab=context. Both URLs work.
Step 3 — Wait for Context to Complete
Poll /client-info?tab=context (or wait for the context_ready email) until the status changes to completed.
Expected when complete:
- Blue banner disappears
- Amber banner: “Context ready for review. Review the AI-generated profile below, then approve to unlock your marketing strategy.”
- Full business context profile rendered in markdown with 8 sections:
- Company Overview
- Products & Services
- Target Audience
- Brand Voice & Tone
- Competitors
- Geographic Focus
- Key Messages
- What NOT to Do
- Approve Context button visible (amber)
Step 4 — Approve Context
- Review the generated context on
/client-info?tab=context - Click Approve Context
Expected:
- Amber banner replaced with green banner: “Client context approved — strategy generation is underway.”
- Button disappears (context now read-only)
- Dashboard (
/dashboard) now shows Stage 2: “Building your marketing strategy…”
Step 5 — Wait for Strategy
Navigate to http://localhost:3000/strategy and wait for the strategy to appear.
Expected when ready:
- Strategy document rendered with sections:
- Executive Summary
- Situation Analysis / SWOT
- Target Audience Personas
- Marketing Goals & KPIs
- Channel Strategy
- Content Strategy
- SEO Strategy
- Monthly Execution Roadmap (Month 1–6)
- Budget & Resource Allocation
- Success Metrics
- Status badge: Pending Review (amber)
- Right sidebar: Timeline, Details, Revise tabs
Step 6 — Approve Strategy
- On
/strategy, click the Pending Review status badge/dropdown - Select Approved from the dropdown
Expected:
- Status badge changes to Approved (green)
- Deliverable planner agent is enqueued
- Dashboard (
/dashboard) now shows Stage 3: “Goals & KPIs are set — agents will start working soon”
Step 7 — Wait for Deliverable Plan
Navigate to http://localhost:3000/strategy/deliverable-plan and wait.
Expected when ready:
- Amber banner: “Review required — The AI has generated this deliverable plan from your approved strategy. Review the goals and monthly deliverables below, then click ‘Approve Plan’ to start executing.”
- Summary stats: number of Goals, Deliverable types, Estimated Monthly Credits
- Goals table: title, metric, target value, timeframe, channel, linked deliverable types
- Monthly Deliverables table: type, priority, rationale, platforms, volume/mo, credits/unit
- Approve Plan button (teal)
Step 8 — Approve Deliverable Plan
- Review the plan on
/strategy/deliverable-plan - Click Approve Plan
Expected:
- Status changes to Approved (green badge)
- Activity planner agent is enqueued for the current month period
- Dashboard eventually progresses to Stage 5 (RegularDashboard) once activities are created
Scenario B — Context Not Yet Generating
Immediately after first login (before agents have started):
- Navigate to
http://localhost:3000/dashboard
Expected (Stage 1, not generating):
- Banner: “Your account is ready to configure” (sparkles icon — no pulsing clock)
- Body: “Complete your business info so our AI agents can get started.”
- CTA link to
/client-info?tab=overview
This happens when the BullMQ setup chain hasn’t been picked up by the worker yet. Starting the worker (
pnpm --filter api worker) will trigger the chain.
Scenario C — Strategy Revision Request
After context is approved and strategy is generated (Step 5 above):
- Navigate to
/strategy - In the Revise tab of the right sidebar, enter revision instructions:
Focus more on LinkedIn B2B content and less on Instagram - Click Regenerate Strategy
Expected:
- Strategy status changes to Pending Review
- New version generated by strategy-writer agent
- Timeline tab shows: “Strategy revision requested” entry + “Marketing strategy vN generated” entry
- New strategy content reflects the revision instructions
Scenario D — Manage Portal Tenant Verification
After completing Scenario A’s signup (tenant created with status: onboarding):
- Log in to
http://localhost:3001assuperadmin@leadmetrics.ai/admin - Navigate to Tenants → search for “BrightCoral Digital”
- Click the tenant row to open the detail page
Expected:
- Tenant name: BrightCoral Digital Pvt Ltd
- Status badge: onboarding
createdVia: self-signup- Plan: Professional
- ▶ Activate button visible (green, top-right of tenant header)
- Subscriptions tab: one active Professional subscription entry
- Knowledge Base tab: 4 default datasets (client_docs, website_content, published_content, competitor_content)
Scenario E — Tenant Activation
Continuing from Scenario D:
- Click ▶ Activate
- Browser confirmation dialog: “Activate this tenant? This will generate the first invoice and send an email notification.”
- Click OK to confirm
Expected:
- Status badge changes to active (green)
- ▶ Activate button disappears
- Tenant status changer now shows
activewith transitions available tosuspended/cancelled - Invoices tab counter increments to 1
- Invoice row visible with:
- Invoice number:
INV-YYYY-MM-XXXX - Type: Subscription
- Status: pending
- Issued: today
- Due: 7 days from today
- Invoice number:
Sample Test Data
BrightCoral Digital Pvt Ltd (verified 2026-04-10)
- Email: moble+signup-a-1@leadmetrics.ai
- Company: BrightCoral Digital Pvt Ltd
- Location: Kochi, Kerala — GST
32AABCU9603R1ZX - Industry: Marketing & Advertising
- Plan: Professional (₹49,999/month)
- Payment ID: pay_SbpHDCOVywmKyn (Razorpay test mode)
- Post-signup URL:
/login?registered=1
Known Issues / Gotchas
| Issue | Detail |
|---|---|
Queue worker not started by pnpm dev | pnpm --filter api worker must be started separately. Without it, setup chain never runs and context stays at pending. |
Context stays pending (not generating) | Worker isn’t running or the BullMQ job failed. Check worker logs. |
| Strategy takes longer than expected | Strategy writer uses the full Claude API call. Can take 2–5 minutes on first run. Refresh /strategy manually — the page does not auto-poll. |
Strategy status dropdown: Approved triggers deliverable planner | Selecting Rejected does NOT trigger anything. Selecting Draft or Pending Review just changes the label. Only Approved enqueues the deliverable planner. |
| Deliverable plan missing channels | If no social channels are connected, the planner may exclude channel-specific deliverable types (e.g. GBP posts). The Planning Notes section will explain exclusions. |
▶ Activate confirm dialog is a native browser confirm() | Playwright must use browser_handle_dialog or page.on('dialog', ...) to accept it. |
| Manage portal session expiry | JWT session expires. Re-login with superadmin@leadmetrics.ai / admin if pages show 401. |
client-info?tab=context auto-refresh | The page does NOT automatically poll for context status changes. Refresh the page manually to see updated status. |