Commit Graph

6 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
d2528dd5ce LibWeb: Compare Screenshot tests directly against expected PNGs
Instead of rendering a reference HTML page that wraps an <img> tag
pointing to a PNG, Screenshot tests now load the expected PNG directly
from disk and compare it against the rendered screenshot. This
eliminates the indirection of loading and rendering a second page just
to display a static image.

This also means --rebaseline now works for Screenshot tests, generating
the expected PNG automatically instead of requiring manual screenshot
capture and placement.

Changes:
- Add TestMode::Screenshot with its own collector and runner
- Move PNGs from Screenshot/images/ to Screenshot/expected/ with
  normalized names matching input filenames
- Remove all 92 reference HTML wrapper files and the images/
  directory
- Remove <link rel="match"> from all 94 Screenshot input HTML
  files
- Update add_libweb_test.py Screenshot boilerplate accordingly
- Add Screenshot mode to results viewer image comparison tabs
2026-02-24 09:55:14 +01:00
Jelle Raaijmakers
15e784cc4f Tests/LibWeb: Generate proper diff image instead of blending images
If the difference between the expected and actual test images was small,
our in-browser diff tool would often fail to highlight differing pixels.

Replace this by generating a new diff PNG that is layered as follows:

  1. 50%/50% blend of the actual and expected images
  2. 80% blend with white / rgb(255, 255, 255)
  3. Differing pixels are highlighted in red / rgb(255, 0, 0)
2026-02-23 14:21:59 +01:00
Jelle Raaijmakers
a5be2d247b Tests/LibWeb: Report fuzzy matching errors in test-web's results HTML 2026-02-23 14:21:59 +01:00
Jelle Raaijmakers
273078900f Tests: Add multiple image diff tools to test-web
The results HTML now includes multiple image diff tools for reference
tests: toggle, slide, fade and diff the actual and expected screenshots.
2026-02-04 16:58:23 +01:00
Andreas Kling
3c69d7bc33 test-web: Improve HTML results viewer with colorized diffs
- Generate colorized HTML diff files (.diff.html) alongside plain text
  diffs (.diff.txt) for each failing test
- Add total test count to results summary
- Improve the results-index.html viewer with a dark theme, keyboard
  navigation, search/filter, and tabbed interface for viewing diffs,
  expected/actual output, and stdout/stderr
- Move s_total_tests assignment outside live display block so it's
  always set
2026-01-13 21:05:58 +01:00
Andreas Kling
b5e01df79d test-web: Add results directory and live terminal display
- Add --results-dir CLI flag to specify output directory
- Default to {tempdir}/test-web-results if not specified
- Capture stdout/stderr from all helper processes (WebContent,
  RequestServer, ImageDecoder) to prevent output spam
- Save captured output to per-test files in results directory
- Save test diffs (expected vs actual) to results directory
- Generate HTML index of failed tests with links to diffs
- Display live-updating concurrent test status with progress bar
- Defer warning messages until after test run completes
2026-01-13 21:05:58 +01:00