Test Optimize Workflow 4 Steps
Test optimized workflow with auto win themes generation and combined strategy/generate screen.
Claude CodeGeneric
# E2E Test: Optimized 4-Step Workflow
Test optimized workflow with auto win themes generation and combined strategy/generate screen.
**CRITICAL EXECUTION RULE:** If any test step fails, immediately fix the issue (debug, update code, resolve error), then restart from step 1. Iterate until ALL steps pass without errors.
## User Story
As a tender response team member
I want win themes to auto-generate when I continue to strategy
So that I can proceed faster to content generation without extra clicks
## Pre-configured Test User
Use credentials from test_e2e.md:
- Email: test@tendercreator.dev
- Password: TestPass123!
## Prerequisites
- Dev server running at http://localhost:3000
- Test project exists with at least one work package
- Test organization with uploaded documents
- Work package has extracted requirements
## Test Steps
### 1. Navigate to Work Package and Verify 4 Tabs
**Steps:**
- Open browser to http://localhost:3000
- Sign in as test user (test@tendercreator.dev / TestPass123!)
- Navigate to Projects page
- Click on existing test project
- Find work package card with status "Not Started" or "In Progress"
- Click "Open" button on work package card
- **Verify** URL is `/work-packages/[id]`
- Take screenshot: `01_work_package_loaded.png`
**Expected:**
- Work package detail page loads
- **4 tabs visible** (NOT 5): Requirements, Strategy & Generate, Edit, Export
- Requirements tab is active (default)
- No console errors
**Verify Zero Regression:**
- ❌ OLD: 5 tabs (Requirements, Strategy, Generate, Edit, Export)
- ✅ NEW: 4 tabs (Requirements, Strategy & Generate, Edit, Export)
### 2. Review Requirements
**Steps:**
- **Verify** Requirements tab shows:
- Document type heading (e.g., "Technical Specification")
- Document description (if present)
- Total requirement count badge
- Mandatory requirements section
- Optional requirements section (if present)
- Each requirement shows: text, priority badge, source reference
- **Verify** "Back to Dashboard" button present
- **Verify** "Continue" button present (NOT "Continue to Strategy")
- Take screenshot: `02_requirements_view.png`
- Click "Continue" button
**Expected:**
- All requirements displayed correctly
- Button text simplified to "Continue"
- Navigation to Strategy & Generate tab works
### 3. Auto Win Themes Generation (NO MANUAL CLICK)
**Steps:**
- **Verify** "Strategy & Generate" tab is now active (tab label changed)
- **Verify** page heading shows "Strategy & Content Generation"
- **CRITICAL: Verify win themes auto-generate immediately (NO manual "Generate" button click)**
- **Verify** loading state appears automatically:
- Skeleton or spinner in win themes section
- "Generating win themes..." message
- Wait for generation to complete (10-30 seconds)
- **Verify** 3-5 win themes appear in left panel
- Take screenshot: `03_auto_themes_generated.png`
**Expected:**
- **Win themes generation triggered automatically** when tab loads
- No manual "Generate Win Themes" button needed
- API call to `/api/work-packages/[id]/win-themes` happens on mount
- Toast notification shows "Win themes generated successfully"
- Win themes displayed in editable list on left side
**Verify Zero Regression:**
- ❌ OLD: User clicks "Generate Win Themes" button manually
- ✅ NEW: Win themes generate automatically on tab load
### 4. Verify Combined Screen Layout
**Steps:**
- **Verify** split-panel layout:
- **Left Panel (40% width):**
- Section 1: "Requirements" heading
- Requirements list (read-only, same as Requirements tab)
- Section 2: "Win Themes" heading
- Win themes list (editable, with edit/delete/add buttons)
- "Regenerate" button next to Win Themes heading
- **Right Panel (60% width):**
- "Content Generation" card
- Document type display
- Requirements count badge
- Win themes count badge
- "Estimated generation time: 2-3 minutes" message
- "Generate Content" button (large, prominent)
- Take screenshot: `04_combined_layout.png`
**Expected:**
- Requirements visible on left (no need to switch tabs)
- Win themes visible on left (editable)
- Generation controls on right
- Layout is responsive and clear
**Verify Zero Regression:**
- ❌ OLD: Separate Strategy tab (only win themes), then separate Generate tab (only generation card)
- ✅ NEW: Combined tab with requirements + win themes on left, generation on right
### 5. Edit Win Theme
**Steps:**
- In left panel, click edit icon on first win theme
- Input field appears with theme text
- Modify text slightly (e.g., add "enhanced")
- Click check/save button
- **Verify** change persists (text updates in display)
- **Verify** win themes count badge on right updates (should still show same count)
**Expected:**
- Inline editing works smoothly
- Changes saved to local state
- Right panel reflects updated count/state
### 6. Add New Win Theme
**Steps:**
- Click "Add Win Theme" button in left panel
- New theme appears with default text "New win theme..."
- Edit the new theme text to something custom
- Click save/check button
- **Verify** new theme added to list
- **Verify** win themes count badge on right increments
**Expected:**
- Can add themes manually
- Count updates correctly
### 7. Test Regenerate Win Themes
**Steps:**
- Click "Regenerate" button next to Win Themes heading
- **Verify** loading state appears
- Wait for regeneration to complete (10-30 seconds)
- **Verify** new themes replace old themes
- **Verify** count badge on right updates immediately (NOT showing zero)
- Take screenshot: `05_themes_regenerated.png`
**Expected:**
- Regeneration works
- **CRITICAL: Zero-count bug is FIXED** - count badge shows correct number immediately
- No stale data displayed
**Verify Zero Regression:**
- ❌ OLD BUG: After regeneration, generation screen showed "0 themes" badge
- ✅ NEW FIX: After regeneration, count updates immediately (themes visible in same screen)
### 8. Generate Document Content
**Steps:**
- **Verify** "Generate Con
Maintain Test Optimize Workflow 4 Steps?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Test Optimize Workflow 4 Steps on getagentictools](https://getagentictools.com/loops/varuntree-e2e-test-optimized-4-step-workflow?ref=badge) npx agentictools info loops/varuntree-e2e-test-optimized-4-step-workflow The second line is the CLI lookup for this page — handy in READMEs and docs.