Commit Graph

10 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
Sam Atkins
7c12590dbf Tests/LibWeb: Add Crash test creation to add_libweb_test.py 2026-01-22 12:49:54 +01:00
Sam Atkins
e0c851b736 Tests/LibWeb: Generate screenshot test boilerplate in add_libweb_test.py
Creating the image is left as an exercise to the user, but this saves
some copypasta when adding a new test.
2025-08-05 09:59:47 +01:00
Timothy Flynn
9a5b31ccd1 LibWebView+Tests+UI: Migrate headless-browser to test-web
Now that headless mode is built into the main Ladybird executable, the
headless-browser's only purpose is to run tests. So let's move it to the
testing directory and rename it to test-web (a la test-js / test-wasm).
2025-06-10 12:04:59 -04:00
Timothy Flynn
18718e0876 Meta: Sort all python imports 2025-06-09 11:25:14 -04:00
Timothy Flynn
58cfa2e40e LibWeb: Remove unnecessary f-string
Caught via ruff.
2025-06-09 11:25:14 -04:00
Timothy Flynn
7ce88eb4cd Everywhere: Document use of ladybird.py over ladybird.sh 2025-05-29 16:24:17 -04:00
Timothy Flynn
2f9957c618 Everywhere: Format all python files with black 2025-05-22 16:21:42 +02:00
Noah Bright
18b4dc2153 LibWeb: Update add_libweb_test.py to support Screenshot, Ref, and Layout
Changed the usage from `add_libweb_test.py test_name.html` to
`add_libweb_test.py test_name.html test_type` with no default,
and supports automatically generating input/output files in the
right directories for test types Screenshot, Text, Ref, and Layout.

Co-authored-by: Sam Atkins <sam@ladybird.org>
2025-01-13 14:25:26 +00:00
Andrew Kaster
4bdd4beb93 Tests/LibWeb: Add a script to create a new test, starting with Text 2024-04-10 17:17:40 -06:00