zinserjan / wdio-visual-regression-service

Visual regression service for WebdriverIO.
MIT License
102 stars 39 forks source link

Saving references #17

Closed monolithed closed 7 years ago

monolithed commented 8 years ago
{
    visualRegression: {
        compare: new VisualRegressionCompare.LocalCompare({
            referenceName : support.screenshot('./store/shots/expected'),
            // screenshotName: support.screenshot('./store/shots/actual'),
            // diffName      : support.screenshot('./store/shots/diff')
        })
    }
}

Is there any way to make a reference file without screenshotName and diffName options?

zinserjan commented 8 years ago

Can you please explain your use case for this?

monolithed commented 8 years ago

There are 10 968 screenshots in my local repository. As you see screenshot generation takes a long time (including bug and artifact analysis). So, It would be nice to have a quick way to make these reference files.

zinserjan commented 8 years ago

The use case is still unclear for me.

Do you just wanna save time when saving reference screenshots or do you wanna override all reference shots with the latest?

monolithed commented 8 years ago

Do you just wanna save time when saving reference screenshots or do you wanna override all reference shots with the latest?

I spend about 3 hours to save and check all screenshots on my local machine. Then I send them to remote machine where tests are started by other developers with their test environments via CI. So, I don't care about diffs on my local machine because my main goal is to quickly make the references for other developers.

avkrash commented 8 years ago

I would join this issue. It would be nice if we have optional parameter (or maybe if mismatch tolerance equal 100%) for compare method or extra method to get only reference shots. So it will save a lot of time while CI testing.

zinserjan commented 8 years ago

I like the idea of creating a extra method for that use case as it does not introduce more complexity and keep the things simple.

I made a PR for this #27.

@monolithed you can use this in the following way. Of course you need to way to switch between the two methods.

{
    visualRegression: {
        compare: new VisualRegressionCompare.SaveScreenshot({
            screenshotName : support.screenshot('./store/shots/expected'),
        })
    }
}

This method reports the same results as VisualRegressionCompare.LocalCompare on the first run.

zinserjan commented 8 years ago

@monolithed @avkrash Released with v0.5.0.

avkrash commented 7 years ago

Great news ! Thank you !