Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = (browser) => {
const screenShooter = ScreenShooter.create(browser);
const {publicAPI: session, config} = browser;
const {tolerance, antialiasingTolerance, compareOpts, screenshotDelay} = config;
const {handleNoRefImage, handleImageDiff} = getCaptureProcessors();
session.addCommand('assertView', async (state, selectors, opts = {}) => {
opts = _.defaults(opts, {
ignoreElements: [],
tolerance,
allowViewportOverflow: false,
screenshotDelay
});
const {hermioneCtx} = session.executionContext;
hermioneCtx.assertViewResults = hermioneCtx.assertViewResults || AssertViewResults.create();
constructor(browser) {
this.browser = browser;
this.log = debug('gemini:capture:' + this.browser.id);
this._postActions = [];
this._screenShooter = ScreenShooter.create(browser);
}