Reorganize documentation: move all docs to /docs subdirectories

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-17 00:33:02 +00:00
parent dc73b3c3cd
commit 34ca7d2c20
49 changed files with 22 additions and 281 deletions

View File

@@ -0,0 +1,187 @@
# Connection 1:1 Constraint Test Plan
## Issue Description
Two purple arrows (or multiple arrows) coming from the same connection point on an idea card. Each handle should support exactly ONE connection (1:1 constraint).
## Implementation Details
### Core Logic
The `validateAndRemoveConflicts` function enforces the 1:1 constraint:
- For any new connection, it checks all existing edges
- Removes edges that conflict with the source handle OR target handle
- Returns filtered edges, count of removed edges, and conflict descriptions
### Key Functions Modified
1. **onConnect** - Creates new connections with conflict resolution
2. **onReconnect** - Remaps existing connections with conflict resolution
3. **validateAndRemoveConflicts** - Core validation logic (new)
## Test Cases
### Test Case 1: Basic Connection Creation
**Steps:**
1. Go to Feature Idea Cloud
2. Click the 🔍 Debug button to open the debug panel
3. Drag from Idea A's right handle to Idea B's left handle
4. Verify in debug panel that:
- Idea A's right handle shows ✓ (occupied)
- Idea B's left handle shows ✓ (occupied)
- Total edges increased by 1
**Expected Result:** Connection created successfully, both handles marked as occupied
### Test Case 2: Prevent Multiple Connections from Same Source Handle
**Steps:**
1. Create connection: Idea A[right] → Idea B[left]
2. Verify connection exists in debug panel
3. Try to create: Idea A[right] → Idea C[left]
4. Check debug panel and toast notification
**Expected Result:**
- Toast shows "Connection remapped! (1 old connection removed)"
- Idea A's right handle now connects to Idea C only
- Old connection to Idea B is removed
- Debug panel shows only 1 connection from Idea A's right handle
### Test Case 3: Prevent Multiple Connections to Same Target Handle
**Steps:**
1. Create connection: Idea A[right] → Idea B[left]
2. Try to create: Idea C[right] → Idea B[left]
3. Check debug panel
**Expected Result:**
- Toast shows "Connection remapped! (1 old connection removed)"
- Idea B's left handle now connects from Idea C only
- Old connection from Idea A is removed
- Debug panel shows only 1 connection to Idea B's left handle
### Test Case 4: Reconnection (Remapping) from Source
**Steps:**
1. Create connection: Idea A[right] → Idea B[left]
2. Drag the source end (at Idea A) to Idea A's bottom handle
3. Check debug panel
**Expected Result:**
- Connection now goes from Idea A[bottom] → Idea B[left]
- Idea A's right handle is now free (○)
- Idea A's bottom handle is now occupied (✓)
- Toast shows "Connection remapped!"
### Test Case 5: Reconnection (Remapping) to Different Target
**Steps:**
1. Create connection: Idea A[right] → Idea B[left]
2. Drag the target end (at Idea B) to Idea C's left handle
3. Check debug panel
**Expected Result:**
- Connection now goes from Idea A[right] → Idea C[left]
- Idea B's left handle is now free (○)
- Idea C's left handle is now occupied (✓)
### Test Case 6: Reconnection with Conflict Resolution
**Steps:**
1. Create connection 1: Idea A[right] → Idea B[left]
2. Create connection 2: Idea C[right] → Idea D[left]
3. Drag connection 2's target from Idea D to Idea B's left handle
4. Check debug panel
**Expected Result:**
- Connection 1 is removed (conflict on Idea B's left handle)
- Connection 2 now goes: Idea C[right] → Idea B[left]
- Toast shows "Connection remapped! (1 conflicting connection removed)"
- Idea B's left handle shows only 1 connection total
### Test Case 7: Database Persistence
**Steps:**
1. Create several connections with various conflict resolutions
2. Note the final state in the debug panel
3. Refresh the page (F5)
4. Open debug panel again
**Expected Result:**
- All connections persist exactly as they were
- No duplicate connections on any handle
- Debug panel shows same state as before refresh
### Test Case 8: Console Logging Verification
**Steps:**
1. Open browser DevTools console
2. Create a new connection
3. Look for log entries starting with `[Connection]`
**Expected Result:**
```
[Connection] New connection attempt: { source: "idea-X[right]", target: "idea-Y[left]" }
[Connection Validator] Conflicts detected and resolved: [...] // (if conflicts exist)
[Connection] New edge created: edge-123456789
[Connection] Total edges after addition: N
[Connection] Edges by handle: [...]
```
### Test Case 9: Multiple Handles Per Node
**Steps:**
1. Create 4 different connections from a single idea using all 4 handles:
- Idea A[left] ← Idea B[right]
- Idea A[right] → Idea C[left]
- Idea A[top] ← Idea D[bottom]
- Idea A[bottom] → Idea E[top]
2. Check debug panel for Idea A
**Expected Result:**
- All 4 handles show ✓ (occupied)
- Total connections for Idea A: 4
- Each handle has exactly 1 connection
- No conflicts exist
### Test Case 10: Edge Case - Same Source and Target
**Steps:**
1. Create connection: Idea A[right] → Idea B[left]
2. Create connection: Idea C[right] → Idea D[left]
3. Remap connection 2 to: Idea A[right] → Idea B[left]
**Expected Result:**
- Connection 1 is removed (conflicts on BOTH source AND target)
- Connection 2 takes over both handles
- Toast shows "Connection remapped! (1 conflicting connection removed)"
- Only 1 arrow exists between Idea A and Idea B
## Visual Indicators in Debug Panel
The debug panel shows a grid for each idea card with 4 handle positions:
- `← ✓` or `← ○` (left handle - incoming)
- `→ ✓` or `→ ○` (right handle - outgoing)
- `↑ ✓` or `↑ ○` (top handle - incoming)
- `↓ ✓` or `↓ ○` (bottom handle - outgoing)
Green background = Handle is occupied (✓)
Gray background = Handle is free (○)
## Success Criteria
✅ All test cases pass
✅ No multiple arrows from/to same connection point
✅ Automatic conflict resolution works correctly
✅ Changes persist to database
✅ Console logs provide clear debugging information
✅ Toast notifications inform user of remapping
✅ Debug panel accurately reflects connection state
## How to Run Tests
1. Navigate to Feature Idea Cloud page in the app
2. Click the 🔍 debug icon in the top-right panel
3. Follow each test case step-by-step
4. Verify expected results using:
- Visual inspection of arrows on canvas
- Debug panel handle occupancy display
- Toast notifications
- Browser console logs
5. Test persistence by refreshing the page
## Notes for Developer
- The debug panel is ONLY for testing and can be removed once all tests pass
- All console.log statements with `[Connection]` and `[Reconnection]` prefixes are for debugging
- The validateAndRemoveConflicts function is the core of the 1:1 constraint
- Each handle ID is either 'left', 'right', 'top', 'bottom', or 'default'
- The logic treats missing sourceHandle/targetHandle as 'default'

View File

@@ -0,0 +1,295 @@
# E2E Test Summary
## Overview
Comprehensive Playwright test suite created to ensure CodeForge functions correctly and generates code as expected.
## What Was Added
### 1. **Playwright Configuration** (`playwright.config.ts`)
- Configured to run tests across Chromium, Firefox, and WebKit
- Automatic dev server startup during test execution
- Screenshots and traces on failure
- HTML report generation
### 2. **Comprehensive Test Suite** (`e2e/codeforge.spec.ts`)
21 test suites covering all major features:
#### Core Features
- ✅ Application loads successfully
- ✅ All navigation tabs display
- ✅ Tab switching works
- ✅ Export functionality present
#### Code Editor
- ✅ File explorer displays
- ✅ Monaco editor loads
- ✅ Add new files
- ✅ File management
#### Model Designer (Prisma)
- ✅ Designer opens
- ✅ Add model button
- ✅ Create new models
- ✅ Model management
#### Component Designer
- ✅ Component tree builder
- ✅ Add components
- ✅ Component management
#### Style Designer
- ✅ Theme editor opens
- ✅ Light/dark variants
- ✅ Color pickers functional
#### Export & Code Generation
- ✅ Export dialog opens
- ✅ Files generated
- ✅ ZIP download button
- ✅ Copy functionality
- ✅ Valid package.json
- ✅ Prisma schema generated
- ✅ Theme configuration generated
#### Settings
- ✅ Next.js configuration
- ✅ NPM settings
- ✅ Package management
#### Feature Toggles
- ✅ Toggle settings display
- ✅ Features can be enabled/disabled
- ✅ Tabs hide when features disabled
#### Workflows
- ✅ n8n-style workflow designer
- ✅ Workflow creation
#### Flask API
- ✅ Flask designer opens
- ✅ Configuration options
- ✅ Blueprint management
#### Testing Tools
- ✅ Playwright designer
- ✅ Storybook designer
- ✅ Unit test designer
#### PWA Features
- ✅ PWA settings
- ✅ Manifest configuration
- ✅ Service worker options
#### Additional Features
- ✅ Favicon designer
- ✅ Documentation view
- ✅ Dashboard statistics
- ✅ Keyboard shortcuts
- ✅ Project save/load
- ✅ Error handling
- ✅ Responsive design (mobile/tablet)
- ✅ No console errors
### 3. **Smoke Test Suite** (`e2e/smoke.spec.ts`)
Quick validation tests for CI/CD (17 critical tests):
- ✅ App loads successfully with correct branding
- ✅ All major tabs navigation (Dashboard, Code Editor, Models, Components, Component Trees, Workflows, Lambdas, Styling, Flask API, Settings, PWA, Features)
- ✅ Project export and code generation dialog
- ✅ Monaco editor loads in code editor
- ✅ Model designer functionality
- ✅ Component tree manager loads
- ✅ Workflow designer loads
- ✅ Lambda designer with Monaco editor
- ✅ Style designer with color pickers
- ✅ Flask API designer
- ✅ PWA settings
- ✅ Feature toggles functionality
- ✅ Project save/load manager
- ✅ Dashboard metrics display
- ✅ Keyboard shortcuts dialog
- ✅ No critical console errors
- ✅ Responsive mobile viewport
### 4. **NPM Scripts** (package.json)
```bash
npm run test:e2e # Run all tests
npm run test:e2e:ui # Interactive UI mode
npm run test:e2e:headed # Watch tests run
npm run test:e2e:smoke # Quick smoke tests
npm run test:e2e:debug # Debug mode
npm run test:e2e:report # View HTML report
```
### 5. **CI/CD Integration**
#### GitHub Actions (`.github/workflows/e2e-tests.yml`)
- Runs on push/PR to main/develop
- Installs Playwright browsers
- Executes full test suite
- Uploads reports as artifacts
#### GitLab CI (`.gitlab-ci.yml`)
- Updated to use latest Playwright image
- Runs E2E tests in test stage
- Artifacts include reports and test results
- No longer allows failure
#### CircleCI (`.circleci/config.yml`)
- Updated Playwright executor to v1.57.0
- Proper browser installation
- Test results and artifacts stored
- Slack notifications on failure
#### Jenkins (`Jenkinsfile`)
- E2E stage with Playwright installation
- HTML report publishing
- Test results archiving
- Branch-specific execution
### 6. **Documentation** (`e2e/README.md`)
Comprehensive guide including:
- Quick start instructions
- Test structure explanation
- Coverage matrix
- Writing new tests
- Best practices
- Debugging guide
- CI/CD examples
- Common issues and solutions
## Test Execution
### Local Development
```bash
# Install browsers first
npx playwright install
# Run smoke tests (fastest - ~30s)
npm run test:e2e:smoke
# Run all tests with UI (recommended)
npm run test:e2e:ui
# Run all tests headless
npm run test:e2e
```
### CI/CD Pipeline
Tests automatically run on:
- Every push to main/develop
- Pull requests
- Manual workflow trigger
## Coverage Statistics
| Category | Tests | Coverage |
|----------|-------|----------|
| Navigation | 8 | 100% |
| Code Editor | 4 | 90% |
| Designers | 15 | 85% |
| Export | 6 | 100% |
| Settings | 4 | 100% |
| PWA | 3 | 100% |
| Testing Tools | 3 | 100% |
| Workflows | 2 | 80% |
| Feature Toggles | 3 | 100% |
| Error Handling | 2 | 90% |
| Responsive | 2 | 100% |
| **TOTAL** | **52+** | **~92%** |
## Key Benefits
1. **Confidence**: Every feature tested automatically
2. **Regression Prevention**: Catches breaking changes
3. **Code Quality**: Validates generated code structure
4. **Documentation**: Tests serve as living documentation
5. **CI/CD Integration**: Automated testing in all pipelines
6. **Fast Feedback**: Smoke tests run in ~30 seconds
7. **Debugging Tools**: UI mode, headed mode, traces, screenshots
## What Gets Validated
### Functional Testing
- All tabs accessible
- All designers open and functional
- Buttons are enabled and clickable
- Forms accept input
- Monaco editor loads
- Code generation works
### Code Generation Quality
- package.json is valid JSON
- Prisma schemas generated
- Theme files created
- Flask API configuration
- Next.js settings preserved
- NPM dependencies included
### Error Detection
- No critical console errors
- UI renders without crashes
- Feature toggles work
- State persists correctly
### Cross-Browser
- Chromium (Chrome/Edge)
- Firefox
- WebKit (Safari)
### Responsive Design
- Desktop (1920x1080)
- Tablet (768x1024)
- Mobile (375x667)
## Next Steps
### Immediate Actions
1. Run smoke tests locally: `npm run test:e2e:smoke`
2. Review test output
3. Fix any failing tests
4. Commit and push to trigger CI
### Future Enhancements
- [ ] Add tests for AI generation feature
- [ ] Test drag-and-drop in component tree
- [ ] Test Lambda editor interactions
- [ ] Add visual regression testing
- [ ] Test Sass styles showcase
- [ ] Test CI/CD config generation
- [ ] Add performance benchmarks
- [ ] Test offline PWA functionality
## Troubleshooting
### If tests fail:
1. Check if dev server is running
2. Clear browser cache: `npx playwright cache clean`
3. Reinstall browsers: `npx playwright install --force`
4. Run in UI mode to debug: `npm run test:e2e:ui`
5. Check screenshots in `test-results/`
### Common Issues:
- **Monaco not loading**: Increase timeout to 15000ms
- **Selectors not found**: Check if feature toggle is enabled
- **Timing issues**: Add `waitForTimeout()` after navigation
## Success Criteria
Tests are passing when:
- ✅ All smoke tests pass (required for every commit)
- ✅ Full test suite passes on main/develop
- ✅ No critical console errors
- ✅ Code generation produces valid files
- ✅ All major features accessible
- ✅ Cross-browser compatibility confirmed
## Maintenance
Update tests when:
- Adding new features
- Modifying UI structure
- Changing navigation
- Adding new designers
- Updating dependencies
Keep test coverage above 85% for all new features.

170
docs/testing/RUN_TESTS.md Normal file
View File

@@ -0,0 +1,170 @@
# How to Run Smoke Tests
## Prerequisites
Ensure Playwright browsers are installed:
```bash
npx playwright install
```
## Running Smoke Tests
### Quick Run (Recommended)
```bash
npm run test:e2e:smoke
```
This will:
1. Start the Vite dev server on port 5173
2. Run 17 critical smoke tests
3. Test across Chromium, Firefox, and WebKit
4. Generate an HTML report if any tests fail
**Expected Duration**: ~30-60 seconds
## What the Smoke Tests Validate
### ✅ Core Application
- App loads with correct branding ("CodeForge")
- No critical JavaScript console errors
- Responsive design works on mobile viewports
### ✅ Navigation
- All major tabs are accessible and clickable
- Tab panels render when selected
- Tabs include: Dashboard, Code Editor, Models, Components, Component Trees, Workflows, Lambdas, Styling, Flask API, Settings, PWA, Features
### ✅ Code Editor
- Monaco editor loads properly
- File explorer is visible
- Editor has syntax highlighting
### ✅ Designers
- **Model Designer**: Opens with "Add Model" button enabled
- **Component Tree Manager**: Displays component trees
- **Workflow Designer**: Shows workflow creation interface
- **Lambda Designer**: Loads with Monaco editor support
- **Style Designer**: Color pickers are functional
- **Flask API Designer**: Configuration interface loads
- **PWA Settings**: Progressive Web App options available
- **Favicon Designer**: Icon design tools accessible
### ✅ Project Management
- Export project button works
- Generated code dialog appears
- Download as ZIP button is enabled
- package.json is visible in generated files
- Project save/load functionality exists
### ✅ Features
- Feature toggles are accessible
- Toggle switches work properly
- Keyboard shortcuts dialog opens
- Dashboard displays project metrics
## Test Results
### Success Indicators
- All tests show ✓ (green checkmark)
- Exit code 0
- Message: "17 passed"
### If Tests Fail
1. Check the console output for specific failures
2. View the HTML report: `npm run test:e2e:report`
3. Run in UI mode for visual debugging: `npm run test:e2e:ui`
4. Run in headed mode to watch: `npm run test:e2e:headed`
## Debugging Failed Tests
### View HTML Report
```bash
npm run test:e2e:report
```
Opens a browser with detailed test results, screenshots, and traces.
### Interactive UI Mode
```bash
npm run test:e2e:ui
```
Opens Playwright's interactive UI to step through tests.
### Watch Tests Run
```bash
npm run test:e2e:headed
```
Runs tests with browser windows visible.
### Debug Mode
```bash
npm run test:e2e:debug
```
Runs tests with Playwright Inspector for step-by-step debugging.
## Common Issues
### Issue: "Target closed" or "Navigation timeout"
**Solution**: Increase timeout in playwright.config.ts webServer settings or check if port 5173 is available.
### Issue: "Cannot find element"
**Solution**: Check if feature toggles are enabled. Some tabs only appear when features are active.
### Issue: "Monaco editor not found"
**Solution**: Monaco takes time to load. Tests already wait up to 15 seconds, but may need adjustment on slower systems.
### Issue: Browser not installed
**Solution**: Run `npx playwright install` to download test browsers.
## CI/CD Integration
These smoke tests run automatically in:
- ✅ GitHub Actions (on push/PR)
- ✅ GitLab CI (test stage)
- ✅ CircleCI (e2e job)
- ✅ Jenkins (E2E Tests stage)
## Full Test Suite
To run the complete test suite (all features):
```bash
npm run test:e2e
```
This includes 50+ tests covering all functionality in detail.
## Test Coverage
The smoke tests provide ~85% coverage of critical user paths:
- ✅ 100% of navigation flows
- ✅ 100% of core designers
- ✅ 100% of code export functionality
- ✅ 90% of editor integrations
- ✅ 85% of feature toggles
## Next Steps After Running Tests
1. ✅ All tests pass → Proceed with confidence
2. ⚠️ Some tests fail → Review failures, fix issues, rerun
3. ❌ Many tests fail → Check if dev server started correctly, verify dependencies installed
## Performance Benchmarks
On a typical development machine:
- **Smoke tests**: 30-60 seconds
- **Full test suite**: 3-5 minutes
- **Per-browser**: ~20 seconds additional
## Support
If tests consistently fail or you encounter issues:
1. Check `E2E_TEST_SUMMARY.md` for detailed documentation
2. Review `e2e/README.md` for test structure
3. Check Playwright documentation: https://playwright.dev/
4. Verify all dependencies are installed: `npm install`
---
**Last Updated**: Iteration 22
**Test Count**: 17 smoke tests
**Browsers**: Chromium, Firefox, WebKit
**Framework**: Playwright v1.57.0

View File

@@ -0,0 +1,337 @@
# 🧪 Smoke Test Quick Reference
## TL;DR - Run Tests Now
```bash
# 1. Install browsers (first time only)
npx playwright install
# 2. Run smoke tests
npm run test:e2e:smoke
```
**Expected Result**: ✅ All 17 tests pass across 3 browsers in ~30-60 seconds
---
## What Gets Tested
### ✅ 17 Critical Smoke Tests
1. **App Loads** - CodeForge branding appears
2. **Tab Navigation** - All major tabs accessible
3. **Code Export** - Project generation works
4. **Monaco Editor** - Code editor loads
5. **Model Designer** - Prisma tool functional
6. **Component Trees** - Tree manager loads
7. **Workflows** - n8n-style designer works
8. **Lambdas** - Function editor with Monaco
9. **Styling** - Theme color pickers
10. **Flask API** - Backend designer
11. **PWA Settings** - Progressive web app config
12. **Feature Toggles** - Toggle switches work
13. **Project Manager** - Save/load buttons
14. **Dashboard** - Metrics display
15. **Keyboard Shortcuts** - Dialog opens
16. **No Console Errors** - Clean execution
17. **Mobile Responsive** - Works at 375px width
### 🌐 Tested Across 3 Browsers
- Chromium (Chrome/Edge)
- Firefox
- WebKit (Safari)
**Total Test Executions**: 51 (17 tests × 3 browsers)
---
## Quick Commands
```bash
# Validate test setup
bash validate-tests.sh
# Smoke tests (fastest)
npm run test:e2e:smoke
# Interactive UI mode (best for debugging)
npm run test:e2e:ui
# Watch tests run (see browser)
npm run test:e2e:headed
# Full test suite (50+ tests)
npm run test:e2e
# View last test report
npm run test:e2e:report
```
---
## Expected Output
### ✅ Success Looks Like
```
Running 17 tests using 3 workers
✓ app loads successfully (Chromium)
✓ can navigate to all major tabs (Chromium)
✓ can export project and generate code (Chromium)
✓ Monaco editor loads in code editor (Chromium)
✓ model designer is functional (Chromium)
...
✓ no critical console errors (WebKit)
✓ app is responsive on mobile viewport (WebKit)
51 passed (45s)
```
### ❌ Failure Looks Like
```
Running 17 tests using 3 workers
✓ app loads successfully (Chromium)
✓ can navigate to all major tabs (Chromium)
✗ Monaco editor loads in code editor (Chromium)
Error: Timed out waiting for selector ".monaco-editor"
...
48 passed (1m 12s)
3 failed
```
**Action**: Check `test-results/` for screenshots and traces
---
## Troubleshooting
### Issue: Browsers not installed
```bash
npx playwright install
```
### Issue: Port 5173 already in use
```bash
# Kill existing dev server
npm run kill
# Or use a different port in playwright.config.ts
```
### Issue: Tests timeout
```bash
# Increase timeout in playwright.config.ts
# Or run with more time:
npm run test:e2e:smoke -- --timeout=60000
```
### Issue: Tests are flaky
```bash
# Run in UI mode to debug
npm run test:e2e:ui
# Run specific test
npm run test:e2e:smoke -- -g "app loads"
```
### Issue: Monaco editor not found
**Solution**: Already handled! Tests wait up to 15 seconds for Monaco to load.
---
## Test Files
| File | Purpose | Tests |
|------|---------|-------|
| `e2e/smoke.spec.ts` | Quick validation | 17 |
| `e2e/codeforge.spec.ts` | Comprehensive suite | 50+ |
| `playwright.config.ts` | Test configuration | - |
---
## CI/CD Integration
Tests run automatically on:
- ✅ Every push to main/develop
- ✅ All pull requests
- ✅ Manual triggers
**Platforms Configured:**
- GitHub Actions
- GitLab CI
- CircleCI
- Jenkins
---
## Performance Benchmarks
| Test Suite | Duration | Coverage |
|------------|----------|----------|
| Smoke Tests | 30-60s | ~85% |
| Full Suite | 3-5min | ~92% |
**Per Browser**: +15-20 seconds
---
## Validation Checklist
Before running tests, ensure:
- [ ] Node.js installed
- [ ] npm dependencies installed (`npm install`)
- [ ] Playwright browsers installed (`npx playwright install`)
- [ ] Port 5173 available
- [ ] No dev server already running
**Quick Validation**: `bash validate-tests.sh`
---
## Understanding Results
### Test Status Icons
-**Green checkmark** = Test passed
-**Red X** = Test failed
-**Circle with slash** = Test skipped
-**Pause** = Test flaky/retried
### Exit Codes
- `0` = All tests passed
- `1` = One or more tests failed
### Artifacts Generated
- `test-results/` - Screenshots and traces
- `playwright-report/` - HTML report
- Console output with test summary
---
## Next Steps After Running Tests
### ✅ All Tests Pass
1. Proceed with deployment/merge
2. Review performance metrics
3. Check for any warnings
### ⚠️ Some Tests Fail
1. Check which tests failed
2. View screenshots: `test-results/`
3. Open HTML report: `npm run test:e2e:report`
4. Debug failing test: `npm run test:e2e:ui`
5. Fix issues and rerun
### ❌ Many Tests Fail
1. Verify dev server starts: `npm run dev`
2. Check for console errors in app
3. Ensure all dependencies installed
4. Reinstall Playwright browsers
5. Run validation script: `bash validate-tests.sh`
---
## Getting Help
### Documentation
- `e2e/README.md` - Detailed E2E test guide
- `E2E_TEST_SUMMARY.md` - Complete test coverage
- `RUN_TESTS.md` - Full test execution guide
- `SMOKE_TEST_REPORT.md` - Test report template
### Debugging Tools
```bash
# Interactive UI (recommended)
npm run test:e2e:ui
# Playwright Inspector
npm run test:e2e:debug
# Headed mode (watch browser)
npm run test:e2e:headed
# View trace file
npx playwright show-trace test-results/.../trace.zip
```
### Resources
- [Playwright Docs](https://playwright.dev/)
- [GitHub Issues](https://github.com/microsoft/playwright/issues)
---
## Success Metrics
### Test Passes ✅ When:
- All 17 smoke tests execute successfully
- No critical console errors detected
- All major features are accessible
- Code generation produces valid files
- Tests complete in < 90 seconds
- Works across all 3 browsers
### Known Safe Warnings:
- React DevTools not installed
- favicon.ico 404 errors
- manifest.json 404 warnings
- Source map missing warnings
---
## Pro Tips
1. **Run smoke tests before every commit**
```bash
npm run test:e2e:smoke
```
2. **Use UI mode for development**
```bash
npm run test:e2e:ui
```
3. **Filter tests by name**
```bash
npm run test:e2e:smoke -- -g "Monaco"
```
4. **Run on single browser**
```bash
npm run test:e2e:smoke -- --project=chromium
```
5. **Update snapshots if needed**
```bash
npm run test:e2e:smoke -- -u
```
---
## Test Coverage Summary
| Feature | Covered | Notes |
|---------|---------|-------|
| App Loading | ✅ | Branding, no errors |
| Navigation | ✅ | All tabs clickable |
| Code Editor | ✅ | Monaco loads |
| Designers | ✅ | All 8+ designers |
| Export | ✅ | Code generation |
| Project Mgmt | ✅ | Save/load buttons |
| PWA | ✅ | Settings accessible |
| Features | ✅ | Toggles work |
| Responsive | ✅ | Mobile viewport |
**Overall Coverage**: ~85% of critical user paths
---
**Last Updated**: Iteration 22
**Playwright Version**: 1.57.0
**Test Count**: 17 smoke tests
**Browsers**: Chromium, Firefox, WebKit
**Execution Time**: 30-60 seconds

View File

@@ -0,0 +1,309 @@
# Smoke Test Execution Report
**Date**: [Automatically filled by test run]
**Environment**: Local Development / CI/CD
**Test Suite**: e2e/smoke.spec.ts
**Total Tests**: 17
**Browsers**: Chromium, Firefox, WebKit
---
## Test Execution Summary
| Browser | Passed | Failed | Skipped | Duration |
|----------|--------|--------|---------|----------|
| Chromium | -/17 | -/17 | -/17 | - |
| Firefox | -/17 | -/17 | -/17 | - |
| WebKit | -/17 | -/17 | -/17 | - |
| **TOTAL**| **-/51**| **-/51**| **-/51**| **-** |
---
## Test Results by Category
### ✅ Core Application (3 tests)
- [ ] App loads successfully with CodeForge branding
- [ ] No critical console errors detected
- [ ] Responsive on mobile viewport (375x667)
### ✅ Navigation (1 test)
- [ ] All major tabs accessible and clickable
### ✅ Code Editor (1 test)
- [ ] Monaco editor loads and displays properly
### ✅ Designers (8 tests)
- [ ] Model designer (Prisma) loads with Add Model button
- [ ] Component tree manager displays
- [ ] Workflow designer (n8n-style) loads
- [ ] Lambda designer with Monaco editor
- [ ] Style designer with color pickers
- [ ] Flask API designer loads
- [ ] PWA settings accessible
- [ ] Feature toggle switches functional
### ✅ Project Management (3 tests)
- [ ] Export project generates code dialog
- [ ] Project save/load manager exists
- [ ] Dashboard displays project metrics
### ✅ UI Components (1 test)
- [ ] Keyboard shortcuts dialog opens
---
## Detailed Test Results
### Test 1: App loads successfully
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Validates that CodeForge loads with correct branding
**Expected**: Header shows "CodeForge" and "Low-Code Next.js App Builder"
**Actual**: -
**Screenshot**: -
### Test 2: Can navigate to all major tabs
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests navigation across all feature tabs
**Expected**: All tabs clickable and show content
**Actual**: -
**Tabs Tested**: Dashboard, Code Editor, Models, Components, Component Trees, Workflows, Lambdas, Styling, Flask API, Settings, PWA, Features
### Test 3: Can export project and generate code
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests project export functionality
**Expected**: Dialog appears with ZIP download and package.json visible
**Actual**: -
### Test 4: Monaco editor loads in code editor
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Validates Monaco editor initialization
**Expected**: .monaco-editor element visible within 15s
**Actual**: -
### Test 5: Model designer is functional
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests Prisma model designer
**Expected**: Models tab shows Add/Create Model button
**Actual**: -
### Test 6: Component tree manager loads
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests component tree management interface
**Expected**: Component Trees tab displays tree structure
**Actual**: -
### Test 7: Workflow designer loads
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests n8n-style workflow designer
**Expected**: Workflows tab shows Create Workflow button
**Actual**: -
### Test 8: Lambda designer loads with Monaco
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests serverless function editor
**Expected**: Lambdas tab shows Create Lambda button
**Actual**: -
### Test 9: Style designer with color pickers loads
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests Material UI theme editor
**Expected**: Styling tab shows color input[type="color"]
**Actual**: -
### Test 10: Flask API designer loads
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests Flask backend configuration
**Expected**: Flask API tab shows configuration UI
**Actual**: -
### Test 11: PWA settings loads
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests Progressive Web App settings
**Expected**: PWA tab shows installation/configuration options
**Actual**: -
### Test 12: Feature toggles work
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests feature flag UI
**Expected**: Features tab shows toggle switches
**Actual**: -
### Test 13: Project manager save/load functionality exists
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests project persistence UI
**Expected**: Save/Load/New Project buttons visible
**Actual**: -
### Test 14: Dashboard displays project metrics
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests dashboard statistics display
**Expected**: Dashboard shows Files/Models/Components metrics
**Actual**: -
### Test 15: Keyboard shortcuts dialog opens
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests keyboard shortcuts UI
**Expected**: Keyboard button opens shortcuts dialog
**Actual**: -
### Test 16: No critical console errors
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Monitors browser console for errors
**Expected**: No errors except DevTools/favicon/manifest/source maps
**Actual**: -
**Errors Found**: -
### Test 17: App is responsive on mobile viewport
**Status**: ⏳ Pending
**Browser**: All
**Duration**: -
**Description**: Tests mobile responsiveness
**Expected**: UI renders correctly at 375x667
**Actual**: -
---
## Console Errors
### Critical Errors (Blocking)
None expected - test will fail if found
### Warnings (Non-blocking)
Expected warnings that are safe to ignore:
- React DevTools messages
- Favicon 404 errors
- Manifest 404 errors
- Source map warnings
### Actual Errors Found
[To be filled after test run]
---
## Performance Metrics
| Metric | Target | Actual |
|--------|--------|--------|
| Initial Load Time | < 3s | - |
| Monaco Load Time | < 15s | - |
| Tab Switch Time | < 500ms | - |
| Export Dialog Time | < 2s | - |
| Total Test Duration | < 90s | - |
---
## Screenshots
Screenshots are automatically captured on test failure and stored in:
- `test-results/` directory
- Organized by test name and browser
---
## Trace Files
Playwright traces are captured on first retry and stored in:
- `test-results/` directory
- Can be viewed with: `npx playwright show-trace <trace-file>`
---
## Test Environment
### System Information
- OS: [To be filled]
- Node.js: [Version]
- npm: [Version]
- Playwright: [Version]
- Browsers:
- Chromium: [Version]
- Firefox: [Version]
- WebKit: [Version]
### Application Information
- Base URL: http://localhost:5173
- Dev Server: Vite
- Framework: React + TypeScript
- Test Framework: Playwright
---
## Issues and Recommendations
### Blockers
[Any critical issues that prevent test execution]
### Known Issues
[Expected failures or known bugs]
### Recommendations
[Suggestions for improving test stability or coverage]
---
## Sign-off
**Tested By**: [Name/CI System]
**Date**: [Date]
**Status**: ⏳ Pending / ✅ Passed / ❌ Failed
**Approved**: [ ] Yes [ ] No
---
## Next Steps
### If All Tests Pass ✅
1. Proceed with deployment/merge
2. Update test coverage documentation
3. Archive this report
### If Tests Fail ❌
1. Review failed test details above
2. Check screenshots and traces
3. Run in debug mode: `npm run test:e2e:debug`
4. Fix issues and rerun
5. Update this report with new results
### Follow-up Actions
- [ ] Review test execution time
- [ ] Check for flaky tests
- [ ] Update test documentation if needed
- [ ] Report any new bugs found
---
**Report Generated**: [Timestamp]
**Report Version**: 1.0
**Last Updated**: Iteration 22