Closed monolithed closed 8 years ago
What do you mean with consistent API?
wdio-screenshot
has nothing to do with this library. It's just an internally used lib. What confuses me, that you use both libraries in your test.js
. For regression testing it's just enough to use this library. There is no need to save screenshots before checking them. So your test.js should just look like
browser.checkDocument(options)
Expected
1
let file = 'file.png'; let options = { output: { actual: '/actual', expected: '/expected', diff: '/diff' } }; browser.checkDocument(file, options)
Prodiving a file parameter does not make any sense for this library. I build this with the idea that it is easily extendable with a plugin system for comparison methods. You can build your own screenshot method and pass a filename into the options to build the file path. Have a look into LocalCompare.js as a base to build something that satisfies your expectations.
There is no need to save screenshots before checking them.
Oh, I got it, thanks!
Actual
/test.js
/config.js
Expected
1
2
The second variant is more universal