mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-11 00:10:40 +00:00
## Summary
Implemented E2E test coverage for Levels 6-12 of the Painter Widget
## Changes
Adds the following coverage to complete the test plan:
Level 6 - Input image connection (3 tests, @slow):
- Width/height/bg-color controls hide when input is linked
- Canvas resizes to match input image dimensions after execution
- Drawing over input image produces canvas content
Level 7 - Clear on empty canvas is harmless
Level 8 - Unchanged canvas does not re-upload on second serialization
Level 9 - Settings persistence:
- Tool selection saved to node.properties.painterTool
- Brush size change saved to node.properties.painterBrushSize
Level 10 - Compact layout collapses to grid-cols-1 when node width <
350px
Level 12 - Rapid drawing accumulates all strokes (checks 3 y-positions)
Supporting changes:
- Add data-testid="painter-controls" to controls grid in
WidgetPainter.vue (needed for compact mode class assertion)
- Add browser_tests/assets/widgets/painter_with_input.json workflow
fixture (LoadImage connected to Painter input slot 0)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Mostly adds/adjusts Playwright and unit test coverage; the only
runtime change is wrapping pointer-capture calls in `try/catch`, which
is low-risk but touches input-handling paths.
>
> **Overview**
> Completes and expands Painter widget browser test coverage, including
new scenarios for clearing an empty canvas, preventing redundant uploads
when serializing an unchanged canvas, persisting tool/brush-size
settings to node properties, compact layout behavior, multi-stroke
accumulation checks, and an input-image-connected workflow (new
`painter_with_input.json`) with execution/resizing/draw-over-image
assertions.
>
> Hardens `usePainter` pointer handling by tolerating
`setPointerCapture`/`releasePointerCapture` failures (e.g., synthetic
events), with corresponding unit tests updated/added to validate the
behavior and serialization expectations.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
056d4a9f0c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-11613-test-complete-remaining-Painter-widget-E2E-tests-34c6d73d36508158b620f55aa1981cf5)
by [Unito](https://www.unito.io)
75 lines
1.3 KiB
JSON
75 lines
1.3 KiB
JSON
{
|
|
"last_node_id": 2,
|
|
"last_link_id": 1,
|
|
"nodes": [
|
|
{
|
|
"id": 2,
|
|
"type": "LoadImage",
|
|
"pos": [50, 50],
|
|
"size": [400, 314],
|
|
"flags": {},
|
|
"order": 0,
|
|
"mode": 0,
|
|
"inputs": [],
|
|
"outputs": [
|
|
{
|
|
"name": "IMAGE",
|
|
"type": "IMAGE",
|
|
"links": [1]
|
|
},
|
|
{
|
|
"name": "MASK",
|
|
"type": "MASK",
|
|
"links": null
|
|
}
|
|
],
|
|
"properties": {
|
|
"Node name for S&R": "LoadImage"
|
|
},
|
|
"widgets_values": ["example.png", "image"]
|
|
},
|
|
{
|
|
"id": 1,
|
|
"type": "Painter",
|
|
"pos": [450, 50],
|
|
"size": [450, 550],
|
|
"flags": {},
|
|
"order": 1,
|
|
"mode": 0,
|
|
"inputs": [
|
|
{
|
|
"name": "image",
|
|
"type": "IMAGE",
|
|
"link": 1
|
|
}
|
|
],
|
|
"outputs": [
|
|
{
|
|
"name": "IMAGE",
|
|
"type": "IMAGE",
|
|
"links": null
|
|
},
|
|
{
|
|
"name": "MASK",
|
|
"type": "MASK",
|
|
"links": null
|
|
}
|
|
],
|
|
"properties": {
|
|
"Node name for S&R": "Painter"
|
|
},
|
|
"widgets_values": ["", 512, 512, "#000000"]
|
|
}
|
|
],
|
|
"links": [[1, 2, 0, 1, 0, "IMAGE"]],
|
|
"groups": [],
|
|
"config": {},
|
|
"extra": {
|
|
"ds": {
|
|
"offset": [0, 0],
|
|
"scale": 1
|
|
}
|
|
},
|
|
"version": 0.4
|
|
}
|