Comfy-Org / Comfy-Org/ComfyUI_frontend
Add explicit wait for queue size in 'shows selection toolbox' screenshot test
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 702
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 512
Description
## Summary
The `shows selection toolbox` test in `browser_tests/tests/selectionToolbox.spec.ts` is flaky because it takes a canvas screenshot immediately after selecting multiple nodes, without explicitly waiting for the render/queue to settle.
## Test Location
**File:** `browser_tests/tests/selectionToolbox.spec.ts`
**Test:** `Selection Toolbox > shows selection toolbox`
**Snapshot:** `selection-toolbox-multiple-nodes-border-chromium-linux.png`
## Problem
After calling `comfyPage.nodeOps.selectNodes([...])`, the test immediately asserts:
```ts
await expect(comfyPage.canvas).toHaveScreenshot(
'selection-toolbox-multiple-nodes-border.png'
)
```
There is no explicit wait for the canvas render queue to finish, which leads to intermittent snapshot mismatches.
## Proposed Fix
Add an explicit wait for the queue size (e.g., `waitForQueue` or an equivalent canvas idle/render-settled helper) before taking the screenshot, to ensure the selection border is fully rendered.
## References
- Reverted flaky snapshot: #9699
- Requested by: @DrJKL in [this comment](https://github.com/Comfy-Org/ComfyUI_frontend/pull/9699)
/cc @DrJKL
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9703-Add-explicit-wait-for-queue-size-in-shows-selection-toolbox-screenshot-test-31f6d73d3650811790d6e8b2c7076d11) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.