You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .storybook/README.md
+40-1Lines changed: 40 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,44 @@ export const WithVariant: Story = {
93
93
94
94
## Development Tips
95
95
96
+
## ComfyUI Storybook Guidelines
97
+
98
+
### Scope – When to Create Stories
99
+
-**PrimeVue components**:
100
+
No need to create stories. Just refer to the official PrimeVue documentation.
101
+
-**Custom shared components (design system components)**:
102
+
Always create stories. These components are built in collaboration with designers, and Storybook serves as both documentation and a communication tool.
103
+
-**Container components (logic-heavy)**:
104
+
Do not create stories. Only the underlying pure UI components should be included in Storybook.
105
+
106
+
### Maintenance Philosophy
107
+
- Stories are lightweight and generally stable.
108
+
Once created, they rarely need updates unless:
109
+
- The design changes
110
+
- New props (e.g. size, color variants) are introduced
111
+
- For existing usage patterns, simply copy real code examples into Storybook to create stories.
112
+
113
+
### File Placement
114
+
- Keep `*.stories.ts` files at the **same level as the component** (similar to test files).
115
+
- This makes it easier to check usage examples without navigating to another directory.
116
+
117
+
### Developer/Designer Workflow
118
+
-**UI vs Container**: Separate pure UI components from container components.
119
+
Only UI components should live in Storybook.
120
+
-**Communication Tool**: Storybook is not just about code quality—it enables designers and developers to see:
121
+
- Which props exist
122
+
- What cases are covered
123
+
- How variants (e.g. size, colors) look in isolation
124
+
-**Example**:
125
+
`PackActionButton.vue` wraps a PrimeVue button with additional logic.
126
+
→ Only create a story for the base UI button, not for the wrapper.
127
+
128
+
### Suggested Workflow
129
+
1. Use PrimeVue docs for standard components
130
+
2. Use Storybook for **shared/custom components** that define our design system
131
+
3. Keep story files alongside components
132
+
4. When in doubt, focus on components reused across the app or those that need to be showcased to designers
133
+
96
134
### Best Practices
97
135
98
136
1.**Keep Stories Simple**: Each story should demonstrate one specific use case
@@ -135,6 +173,7 @@ export const WithLongText: Story = {
135
173
-**`main.ts`**: Core Storybook configuration and Vite integration
136
174
-**`preview.ts`**: Global decorators, parameters, and Vue app setup
-**`preview-head.html`**: Injects custom HTML into the `<head>` of every Storybook iframe (used for global styles, fonts, or fixes for iframe-specific issues)
138
177
139
178
## Chromatic Visual Testing
140
179
@@ -170,4 +209,4 @@ This Storybook setup includes:
170
209
- PrimeVue component library integration
171
210
- Proper alias resolution for `@/` imports
172
211
173
-
For component-specific examples, see the NodePreview stories in `src/components/node/`.
212
+
For component-specific examples, see the NodePreview stories in `src/components/node/`.
Copy file name to clipboardExpand all lines: browser_tests/README.md
+8-31Lines changed: 8 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -392,16 +392,6 @@ Option 2 - Generate local baselines for comparison:
392
392
npx playwright test --update-snapshots
393
393
```
394
394
395
-
### Getting Test Artifacts from GitHub Actions
396
-
397
-
When tests fail in CI, you can download screenshots and traces:
398
-
399
-
1. Go to the failed workflow run in GitHub Actions
400
-
2. Scroll to "Artifacts" section at the bottom
401
-
3. Download `playwright-report` or `test-results`
402
-
4. Extract and open the HTML report locally
403
-
5. View actual vs expected screenshots and execution traces
404
-
405
395
### Creating New Screenshot Baselines
406
396
407
397
For PRs from `Comfy-Org/ComfyUI_frontend` branches:
@@ -412,17 +402,19 @@ For PRs from `Comfy-Org/ComfyUI_frontend` branches:
412
402
413
403
> **Note:** Fork PRs cannot auto-commit screenshots. A maintainer will need to commit the screenshots manually for you (don't worry, they'll do it).
414
404
415
-
## CI/CD Integration
405
+
## Viewing Test Reports
416
406
417
407
### Automated Test Deployment
418
408
419
-
The project automatically deploys Playwright test reports to Cloudflare Pages for every PR and push to main branches. This provides:
409
+
The project automatically deploys Playwright test reports to Cloudflare Pages for every PR and push to main branches.
410
+
411
+
### Accessing Test Reports
420
412
421
-
-**Live test reports** with interactive HTML views
422
-
-**Cross-browser testing** across chromium, mobile-chrome, and different viewport sizes
423
-
-**Real-time PR comments** with test status and links to detailed reports
413
+
-**From PR comments**: Click the "View Report" links for each browser
414
+
-**Direct URLs**: Reports are available at `https://[branch].comfyui-playwright-[browser].pages.dev` (branch-specific deployments)
415
+
-**From GitHub Actions**: Download artifacts from failed runs
424
416
425
-
####How it works:
417
+
### How It Works
426
418
427
419
1.**Test execution**: All browser tests run in parallel across multiple browsers
428
420
2.**Report generation**: HTML reports are generated for each browser configuration
@@ -437,21 +429,6 @@ The project automatically deploys Playwright test reports to Cloudflare Pages fo
437
429
- Direct links to interactive test reports
438
430
- Real-time progress updates as tests complete
439
431
440
-
#### Accessing test reports:
441
-
442
-
-**From PR comments**: Click the "View Report" links for each browser
443
-
-**From GitHub Actions**: Download artifacts from failed runs
444
-
-**Direct URLs**: Reports are available at `https://[branch].comfyui-playwright-[browser].pages.dev` (branch-specific deployments)
445
-
446
-
#### Report features:
447
-
448
-
-**Interactive HTML reports** with test results, screenshots, and traces
449
-
-**Detailed failure analysis** with before/after screenshots
450
-
-**Test execution videos** for failed tests
451
-
-**Network logs** and console output for debugging
452
-
453
-
This integration ensures that test results are easily accessible to reviewers and maintainers, making it simple to verify that changes don't break existing functionality across different browsers and viewport sizes.
454
-
455
432
## Resources
456
433
457
434
-[Playwright UI Mode](https://playwright.dev/docs/test-ui-mode) - Interactive test debugging
0 commit comments