From 8cbf8649c29060cee366f06b1222d3ffa405fb66 Mon Sep 17 00:00:00 2001 From: Felix P Date: Mon, 20 May 2024 17:18:09 +0200 Subject: [PATCH] Selective diffing for nightwach --- .../nightwatch/commands/sauceVisualCheck.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/visual-js/visual-nightwatch/nightwatch/commands/sauceVisualCheck.js b/visual-js/visual-nightwatch/nightwatch/commands/sauceVisualCheck.js index d3d23e29..bd635a4f 100644 --- a/visual-js/visual-nightwatch/nightwatch/commands/sauceVisualCheck.js +++ b/visual-js/visual-nightwatch/nightwatch/commands/sauceVisualCheck.js @@ -1,5 +1,9 @@ const EventEmitter = require('events').EventEmitter; -const { ensureError, getFullPageConfig } = require('@saucelabs/visual'); +const { + ensureError, + getFullPageConfig, + selectiveRegionsToRegionIn, +} = require('@saucelabs/visual'); const { parseIgnoreOptions, toIgnoreRegionIn } = require('../../utils/regions'); const { getMetaInfo, getVisualApi } = require('../../utils/api'); const { VISUAL_BUILD_ID_KEY } = require('../../utils/constants'); @@ -49,6 +53,13 @@ module.exports = class SauceVisualCheck extends EventEmitter { ? await toIgnoreRegionIn(resolvedIgnoreOptions) : []; // + // Regions + const regions = await selectiveRegionsToRegionIn( + options.regions ?? [], + toIgnoreRegionIn, + ); + ignoreRegions.push(...regions); + // // Get more info about the session const { capabilities,