Files
Dr.Lt.Data 8c2a67a7b3 v4: Report why restoring or removing a snapshot failed (#3535)
When the server answers 400 to a restore or a removal, the Snapshot
Manager built its message from target.title and exception. target is
the snapshot's name, a string, and exception is not defined at that
point, so the line threw and the catch block showed "Restore snapshot
failed: undefined / ReferenceError: exception is not defined", for a
removal too. The finally block of the restore then asked for a
restart, although nothing had been scheduled. Any other error status,
such as a 502 from a proxy, was taken as success.

- Show the snapshot's name and the reason, both escaped. The reason is
  the text of a plain-text response, which is how the server gives
  one, and otherwise the status line: most of the server's refusals
  carry no text, and a proxy answers with an HTML page
- Handle every error status this way, where only 400 was looked at
- Return after a failure, and ask for a restart only when the restore
  was accepted
- Name the removal in the removal's messages
- Add Playwright cases for a failed restore and removal, answered with
  400 with and without a reason and with the 502 page of a proxy, for
  a restore refused with 403, and for an accepted restore
- Add a CHANGELOG entry and name the cases in the Playwright README

The same change for main is #3436.
2026-11-15 21:08:03 +09:00
..

Playwright E2E Tests — Legacy Manager UI

Browser-based E2E tests for the ComfyUI-Manager legacy UI.

Prerequisites

  1. E2E environment built via python tests/e2e/scripts/setup_e2e_env.py
  2. Playwright runner and Chromium (from the repository root): npm install --no-save --package-lock=false @playwright/test@1.59.1, then npx playwright install chromium.
  3. ComfyUI running with legacy UI enabled:
E2E_ROOT=/tmp/e2e_full_test
PORT=8199
PYTHONPATH="$PWD" $E2E_ROOT/venv/bin/python $E2E_ROOT/comfyui/main.py \
  --listen 127.0.0.1 --port $PORT \
  --enable-manager --enable-manager-legacy-ui \
  --cpu

Running Tests

Run from the repository root. XSS fixtures execute the checkout's Python renderer using python3; set PYTHON=/path/to/python to select another interpreter.

# With server already running:
PORT=8199 npx playwright test

# Single file:
PORT=8199 npx playwright test tests/playwright/legacy-ui-manager-menu.spec.ts

# Headed (visible browser):
PORT=8199 npx playwright test --headed

# Debug mode:
PORT=8199 npx playwright test --debug

Test Files

File Scenarios
legacy-ui-manager-menu.spec.ts Menu dialog rendering, settings dropdowns, API round-trip
legacy-ui-custom-nodes.spec.ts Node list grid, filter, search, footer buttons
legacy-ui-model-manager.spec.ts Model list grid, filter, search
legacy-ui-snapshot.spec.ts Snapshot list, save, remove, failed restore and remove
legacy-ui-navigation.spec.ts Dialog open/close, nested navigation, no duplicates
custom-nodes-xss.spec.ts Node metadata, node preview, Markdown, links, errors, search highlighting
model-manager-xss.spec.ts Model metadata, links, errors, search highlighting
legacy-message-errors.spec.ts Batch rejection IDs, batch completion, name readability, DOM colors, lookup errors
legacy-ui-node-fixer.spec.ts "Fix node (recreate)" context-menu entry: one node left, links rewired, numeric and string node ids, inside a subgraph