Repository navigation
Avoid taking selector screenshots twice - #216
Open
Muguett-DBY wants to merge 1 commit into
Open
Muguett-DBY wants to merge 1 commit into
Muguett-DBY wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a selector screenshot is written to a file,
take_shot()callslocator.screenshot(path=...)twice, overwriting the first capture. The first call already writes the file, so this removes the second call.The new test covers both file and byte output. Against the base, the file case fails because the locator is called twice; on this branch, it passes. I ran those two cases and nine existing URL/filename cases with pytest: 11 passed. Those 11 pytest cases used a mocked Playwright page. Separately, I ran a selector screenshot smoke test on Windows with Playwright 1.64.1 and Chromium 156: file output took two screenshots on the base and one on this branch, and file and byte output both produced 80×40 PNGs. The full tests/test_image_formats.py file also passed on this commit with the same real browser setup: 32 passed, including WebP stdout and multi-image format coverage. I haven't run the entire test suite locally.
Developed and tested with Codex assistance.
📚 Documentation preview 📚: https://shot-scraper--216.org.readthedocs.build/en/216/
GitHub's upstream Test workflow currently reports
action_requiredand has not started any jobs.