wswebcreation / protractor-image-comparison

npm-module to compare images with protractor
86 stars 38 forks source link

Can I dynamically create screenshotPath and baselineFolder as tests run? #104

Closed lynn-fisher closed 5 years ago

lynn-fisher commented 5 years ago

Hi there,

I have recently updated my protractor-image-comparison to latest version(3.3.1).

Previously I was able to specify path to baseline/actual/diff folders at time of running tests as my tests are data driven and loop round test many times for different application types. So I need to create and name folders as I run the tests. I tried putting the paths in as a compare option but it is not getting used. Here is an example of the code

expect(await browser.imageComparison.checkFullPageScreen(binaryDescription + ' Full Page', { baselineFolder: 'image/baseline/imageTests/' +foldername1 + '/' + foldername2, screenshotPath: 'tests/testresults/image/screenshots/imageTests/' +foldername1 + '/' + foldername2 })).toEqual(0)

Is it possible to achieve this with newest version?

wswebcreation commented 5 years ago

Hi @lynn-fisher ,

To be honest, this was never intentionally build into this module, so it was a miracle it worked. But I added it now into the module, updated the docs and released a new version here https://github.com/wswebcreation/protractor-image-comparison/releases/tag/v3.4.0