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
Tests use workflows stored in `assets/` for consistent starting points:
238
+
239
+
```typescript
240
+
// Load a test workflow
241
+
awaitcomfyPage.loadWorkflow('single_ksampler')
242
+
243
+
// Wait for workflow to load and stabilize
244
+
awaitcomfyPage.nextFrame()
245
+
```
246
+
247
+
### Custom Assertions
248
+
249
+
The project includes custom Playwright assertions through `comfyExpect`:
250
+
251
+
```typescript
252
+
// Check if a node is in a specific state
253
+
awaitexpect(node).toBePinned()
254
+
awaitexpect(node).toBeBypassed()
255
+
awaitexpect(node).toBeCollapsed()
256
+
```
257
+
258
+
## Troubleshooting Common Issues
259
+
260
+
### Flaky Tests
261
+
262
+
-**Timing Issues**: Always wait for animations to complete with `nextFrame()`
263
+
-**Coordinate Sensitivity**: Canvas coordinates are viewport-relative; use node references when possible
264
+
-**Test Isolation**: Tests run in parallel; avoid dependencies between tests
265
+
-**Screenshots vary**: Ensure your OS and browser match the reference environment (Linux)
266
+
-**Async / await**: Race conditions are a very common cause of test flakiness
267
+
50
268
## Screenshot Expectations
51
269
52
270
Due to variations in system font rendering, screenshot expectations are platform-specific. Please note:
53
271
54
-
- We maintain Linux screenshot expectations as our GitHub Action runner operates in a Linux environment.
55
-
- To set new test expectations:
56
-
1. Create a pull request from a `Comfy-Org/ComfyUI_frontend` branch.
57
-
2. Add the `New Browser Test Expectation` tag to your pull request.
58
-
3. This will trigger a GitHub action to update the screenshot expectations automatically.
272
+
-**DO NOT commit local screenshot expectations** to the repository
273
+
- We maintain Linux screenshot expectations as our GitHub Action runner operates in a Linux environment
274
+
- While developing, you can generate local screenshots for your tests, but these will differ from CI-generated ones
275
+
276
+
To set new test expectations for PR:
277
+
278
+
1. Write your test with screenshot assertions using `toHaveScreenshot(filename)`
279
+
2. Create a pull request from a `Comfy-Org/ComfyUI_frontend` branch
280
+
3. Add the `New Browser Test Expectation` tag to your pull request
281
+
4. The GitHub CI will automatically generate and commit the reference screenshots
282
+
283
+
This approach ensures consistent screenshot expectations across all PRs and avoids issues with platform-specific rendering.
59
284
60
-
> **Note:** If you're making a pull request from a forked repository, the GitHub action won't be able to commit updated screenshot expectations directly to your PR branch.
285
+
> **Note:** If you're making a pull request from a forked repository, the GitHub action won't be able to commit updated screenshot expectations directly to your PR branch.
0 commit comments