playwright-pytest icon indicating copy to clipboard operation
playwright-pytest copied to clipboard

[FEATURE] Add support for visual regression / snapshot testing

Open kumaraditya303 opened this issue 4 years ago • 9 comments
trafficstars

Add support for snapshots of the page, screenshots etc like in jest toMatchSnapshot

Example: https://github.com/kumaraditya303/pytest-playwright-snapshot

kumaraditya303 avatar Jun 20 '21 08:06 kumaraditya303

I have implemented this feature in a separate pytest plugin, it also supports threshold for comparing snapshots

See https://github.com/kumaraditya303/pytest-playwright-snapshot

Install it with

$ pip install pytest-playwright-snapshot

cc to some users who requested it: @TommyXie1990 @utapyngo @chasays

kumaraditya303 avatar Aug 19 '21 13:08 kumaraditya303

There is a strong use case for including this type of testing, and my team would benefit from having this feature.

Thank you for creating a separate plugin for it, though it would be great to have it baked in.

ghost avatar Oct 25 '23 15:10 ghost

@bgronemanLIO my tests are quite heavy on visual assertions. After trying couple of different solutions and pytest plugins I ended up with https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker - it's free, configuration is quite easy and provides reliable results. Also - it support few different comparison libs, so you can tweak the settings according to your needs.

It would be nice to have this kind of feature out-of-the-box, though - but I guess it's rather unlikely.

aspenboy avatar Oct 25 '23 17:10 aspenboy

@aspenboy thanks for sharing that tool. It seem very robust I will consider integrating it into our pipeline.

ghost avatar Oct 25 '23 17:10 ghost

No problem :) good luck!

aspenboy avatar Oct 25 '23 17:10 aspenboy

Can you tell me when this method is planned to be implemented? pytest-playwright-snapshot is weak

paigusov avatar Jan 24 '24 09:01 paigusov