python-needle / needle

Automated tests for your CSS.
https://needle.readthedocs.io/
Other
590 stars 50 forks source link

Creating baseline images only if not already present #45

Open andybak opened 9 years ago

andybak commented 9 years ago

Hi,

I'm trying to work out a good workflow for using needle alongside a full site crawl.

So far my plan is this:

  1. Whenever the developer makes a change they delete the baseline images that the expect to change.
  2. They then generate new baselines for these
  3. They check the new baseline images by eye before running a full crawl test to see if there are any unexpected changes in other images.

The one missing feature I need to add to facilitate this is the ability to create a baseline only if it doesn't already exist. I can imagine this being useful for other reasons.

I'm happy to issue a pull request for this but wanted to discuss it first to see if the idea is generally acceptable - and if you're happy with my planned approach.

I was simply going to add another environment var and matching class property. Probably: NEEDLE_OVERWRITE_BASELINE and self.overwrite_baseline. These would default to True to match the existing behaviour.

How does that sound?

moellering commented 6 years ago

In the changelog for version 0.2 @jphalip states that he deprecated that feature (--with-needle-capture). However I would second that there are usecases where you only want specific baseline images to be created.

An alternative would be creating screenshots in the fresh directory even if there is no baseline image present. Then users could move them to the baseline dir if they have checked them manually.