Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Update add_libweb_test.py to support Screenshot, Ref, and Layout (rescue of #1703) #3182

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

AtkinsSJ
Copy link
Member

@AtkinsSJ AtkinsSJ commented Jan 8, 2025

This is a modification of #1703, with a few changes:

  • Update the file locations for ref/screenshot tests
  • Support creating ref/screenshot tests in subdirectories
  • Move the docs changes into the separate Testing.md file
  • Merged the two commits together

My Python skills are lacking but it all seems to work as it's supposed to.

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 <[email protected]>
@AtkinsSJ
Copy link
Member Author

Changes:

  • Use that handy "choices" mechanism from argparse.
  • The test type now is a case-sensitive match for the directory name. Seems reasonable to me.
  • Corrected the log message to say what type of test was created, so you're not confused by this:
❯ Tests/LibWeb/add_libweb_test.py foo/bar/baz.html Ref
Text test 'foo/bar/baz.html' created successfully.

@AtkinsSJ AtkinsSJ merged commit 18b4dc2 into LadybirdBrowser:master Jan 13, 2025
8 checks passed
@AtkinsSJ AtkinsSJ deleted the rescue-1703 branch January 13, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants