{"repo":"iloveitaly/pytest-playwright-visual-snapshot","free":true,"listed":false,"github":"https://github.com/iloveitaly/pytest-playwright-visual-snapshot","clone":"git clone https://github.com/iloveitaly/pytest-playwright-visual-snapshot.git","description":"Easy pytest visual regression testing using playwright","language":"Python","stars":13,"topics":["playwright","pytest","regression","testing","visual"],"license":null,"category":"scrapers-browser-automation","readme_excerpt":"Pytest Plugin for Visual Testing with Playwright As of 2025-03-22 of all of the existing packages to do simple visual regression testing using playwright are long dead. I had a bunch of updates I wanted to make to existing systems so I rewrote the plugin with a bunch of updates: - snapshots are always written on CI to easily download them as artifacts - ability to mask out certain elements which cause comparison brittleness - failing on --update-snapshots to make users manually review images - snapshot name is optional, test name[browser][os].png is auto-generated by default - multiple snapshots in a single test, file names are auto incremented - updated folder structure: snapshots/file name/test name/test name[browser][os].png - ability to configure directories, etc via ini + pytest config. You can see this implemented in a working project here. Installation Usage This plugin provides a assert snapshot fixture which is used to create snapshots and compare it. Then, run pytest: The first time you run pytest, snapshots will be created, and you will get the error: The next run, the snapshots comparison will take place. To update snapshots, run: After updating, tests will fail and you will need to review images. In case of a mismatch, snapshot tests failures folder will be created with actual .. , expected .. and diff .. images generated. Configuration View all configuration options by running pytest --help . Here's a quick example: Masking Elements You can mask certain elements","default_branch":null,"files":null,"tree":[],"storefront":"/r/iloveitaly","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/iloveitaly/pytest-playwright-visual-snapshot/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}