Compare commits

...

9 Commits

Author SHA1 Message Date
Glary-Bot
85ef4372b1 test: mark outline regression as test.fixme until fix lands
Per @christian-byrne: rather than committing the buggy rendering as a
characterization (which made CI fail / required test.fail tricks),
mark the test as fixme on Chromium so it's skipped today and starts
running as soon as the underlying fix PR removes the annotation.

The committed baseline is the desired (no extra UA outline) post-fix
appearance, so once test.fixme is removed in the fix PR the test runs
and verifies the fix against this snapshot.

Also adds expect(note).toBeFocused() before the Shift press per Oracle
review on #11936 — proves the node root actually owns focus before we
exercise the heuristic.
2026-05-13 20:13:30 +00:00
Glary-Bot
18cb5492e5 test: commit bug-state baseline so the regression is visible in-PR
Per @christian-byrne: with the prior test.fail design the snapshot
committed in this PR was the desired (no-shift) state, so a reviewer
glancing at the PNG saw no bug. That made it impossible to tell from
the PR alone whether the regression was actually being captured.

Flip the design: capture the snapshot with Shift held, regenerate the
baseline against the current (unfixed) render so the bug is plainly
visible in the committed image (a 1px UA focus ring outside the
selection border on the Note node), and drop the test.fail
annotation. The test now passes today as a characterization of the
current Chromium rendering.

When the underlying CSS bug is fixed (#11936) the post-fix rendering
will no longer include the UA outline, the snapshot will diff, and
the fix PR must regenerate this baseline as part of the change.
2026-05-11 20:28:08 +00:00
Glary-Bot
2b30f3f355 test: clip outline snapshot tightly around the node
Per @christian-byrne: at canvas-wide capture (1280x720) the 1px UA
focus ring was visually invisible in the snapshot even though the
diff still detected it. Use the node's boundingBox + 16px padding as
a clip region so the regression is unambiguously visible in the PNG
diff (now 464x266) — the focus ring traces the node perimeter and is
clearly distinguishable from the no-shift baseline.
2026-05-04 23:09:23 +00:00
Glary-Bot
38c4811a0d test: use minimal single-Note workflow for outline regression
Per @christian-byrne review on #11814: the default workflow's
Load Checkpoint node currently shows error-border noise on the
unfixed HEAD because no checkpoint is available, which contaminates
the baseline screenshot.

Adds a new asset browser_tests/assets/nodes/single_note.json with one
plain Note node (no loaders, no model dependencies, no error
rendering) and switches outline.spec.ts to load it. Baseline
regenerated against this clean workflow; with test.fail removed the
diff is now a tight 3125 px (0.3%) bbox around the Note's focus ring,
unambiguously isolating the Chromium :focus-visible regression.
2026-05-04 21:41:26 +00:00
Glary-Bot
29e82748a5 test: simplify outline regression — snapshot-only, rename file
Per @christian-byrne review on #11814:

- Rename file to outline.spec.ts to match sibling naming (bypass,
  colors, mute, pin, error, etc.)
- Drop the behavioral test that queried getComputedStyle(); rely on
  snapshot diff as the assertion (user-visible contract).
- Drop the try/finally wrapping keyboard.up('Shift'); Playwright
  handles cleanup between tests, matching the convention in
  zoom.spec.ts and linkInteraction.spec.ts.
- Move regression context out of the file docstring into a
  test.info().annotations.push({ type: 'regression', ... }) entry,
  matching the pattern in workflowPersistence.spec.ts.
- Drop 'Chrome-only' from the test title; the browserName-gated
  test.fail and the regression annotation describe the scope.
- Capture the baseline as the *desired* (no-shift) state so the test
  body fails today (Shift adds a focus ring that diffs from the
  baseline) and passes naturally once the bug is fixed; test.fail
  flips today's failure to expected-pass for green CI.
2026-05-04 20:08:22 +00:00
Glary-Bot
4ebfecb42e test: trim regression docstring
Per CodeRabbit nitpick on #11814 and AGENTS.md guidance to avoid
non-essential comments. Keep only the minimum needed to explain why
test.fail() is used and the upgrade path when the bug is fixed; drop
PR/bug references and backstory recoverable from git blame.
2026-05-02 02:27:44 +00:00
Glary-Bot
b0347f9c21 test: capture full canvas and assert only user-visible outline
Per Oracle review feedback:

- Screenshot the canvas, not the node locator: the regression is a
  focus ring drawn outside the node element box, which Playwright was
  clipping when capturing the locator. Switching to comfyPage.canvas
  matches the convention in bypass/colors/mute specs and captures the
  ring on visible sides.
- Drop the :focus-visible pseudo-class assertion: assert only
  outlineStyle === 'none' so the test guards the user-visible
  contract (no extra outline) and a future fix that removes the
  outline by other means still passes.

Snapshot baseline regenerated with the wider capture region.
2026-05-02 02:22:44 +00:00
Glary-Bot
f7590bc2c9 test: gate :focus-visible test.fail to chromium only
Per CodeRabbit review on #11814: the bug is Chrome-only, but the
test.fail() declaration was unconditional. Future addition of a WebKit
or Firefox project to the Playwright matrix would have caused unexpected
passes there. Move the annotation inside the test body and gate it on
browserName === 'chromium' using Playwright's documented runtime form.
2026-05-02 02:13:29 +00:00
Glary-Bot
d4fd92f8db test: add Playwright regression test for Shift focus-visible outline on Vue nodes
Captures the Chrome-only bug where pressing Shift on a selected Vue
node shows a second, browser-default focus outline on top of the
selection overlay. Triggered by tabindex="0" on the LGraphNode root
combined with Chromium's :focus-visible heuristic, which Safari/WebKit
doesn't share.

Behavior was introduced in #9360 (replaced CSS outline with layered
border overlay).

Two complementary tests:
- Screenshot test runs unconditionally and snapshots the trigger point
  to catch unrelated visual regressions.
- Behavioral test asserts the intended post-fix state (no
  :focus-visible, no UA outline) and is annotated test.fail(); it is
  expected to fail until the bug is fixed, at which point Playwright
  will surface the unexpected pass and prompt removal of the
  annotation alongside snapshot regeneration.
2026-05-01 03:41:34 +00:00
3 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
{
"last_node_id": 1,
"last_link_id": 0,
"nodes": [
{
"id": 1,
"type": "Note",
"pos": [200, 200],
"size": [240, 100],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {},
"widgets_values": ["Selected"]
}
],
"links": [],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}

View File

@@ -0,0 +1,48 @@
import {
comfyExpect as expect,
comfyPageFixture as test
} from '@e2e/fixtures/ComfyPage'
test.describe(
'Vue Node selection outline',
{ tag: ['@vue-nodes', '@screenshot'] },
() => {
test('does not gain an extra focus outline when Shift is held on a selected node', async ({
comfyPage,
browserName
}) => {
test.info().annotations.push({
type: 'regression',
description:
'Chromium paints a UA :focus-visible outline on a focused element after a bare Shift keypress; the LGraphNode root has tabindex="0", so a selected Vue node would otherwise gain a second outline. The baseline below captures the desired (no extra UA outline) appearance — remove the test.fixme annotation in the fix PR that suppresses the UA outline so this test runs and verifies it.'
})
test.fixme(
browserName === 'chromium',
'Chromium paints a UA :focus-visible outline on a focused element after a bare Shift keypress; remove this annotation in the fix PR.'
)
await comfyPage.workflow.loadWorkflow('nodes/single_note')
const note = comfyPage.vueNodes.getNodeByTitle('Note').first()
await note.locator('.lg-node-header').click()
await expect(note).toHaveClass(/outline-node-component-outline/)
await expect(note).toBeFocused()
const box = await note.boundingBox()
if (!box) throw new Error('Node bounding box not available')
const PAD = 16
const clip = {
x: Math.max(0, Math.floor(box.x - PAD)),
y: Math.max(0, Math.floor(box.y - PAD)),
width: Math.ceil(box.width + PAD * 2),
height: Math.ceil(box.height + PAD * 2)
}
await comfyPage.page.keyboard.down('Shift')
await expect(comfyPage.page).toHaveScreenshot(
'vue-node-shift-focus-outline.png',
{ clip }
)
})
}
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB