From 7ab1392301ff0c302131fdaa0d0f2540ed463daa Mon Sep 17 00:00:00 2001 From: Benjamin Karran Date: Wed, 22 May 2024 11:56:01 +0200 Subject: [PATCH] Selective diffing for nightwach --- .../nightwatch/commands/sauceVisualCheck.js | 13 ++++++++++++- visual-js/yarn.lock | 10 +++++----- 2 files changed, 17 insertions(+), 6 deletions(-) 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, diff --git a/visual-js/yarn.lock b/visual-js/yarn.lock index d680e34d..5009c112 100644 --- a/visual-js/yarn.lock +++ b/visual-js/yarn.lock @@ -2829,7 +2829,7 @@ __metadata: version: 0.0.0-use.local resolution: "@saucelabs/cypress-visual-plugin@workspace:visual-cypress" dependencies: - "@saucelabs/visual": 0.4.0 + "@saucelabs/visual": 0.5.0 "@tsconfig/node18": ^2.0.1 "@types/cypress": ^1.1.3 "@types/node": ^20.4.4 @@ -2858,7 +2858,7 @@ __metadata: version: 0.0.0-use.local resolution: "@saucelabs/nightwatch-sauce-visual-service@workspace:visual-nightwatch" dependencies: - "@saucelabs/visual": 0.4.0 + "@saucelabs/visual": 0.5.0 chalk: ^4.1.2 concurrently: ^8.2.2 eslint: ^8.0.1 @@ -2876,7 +2876,7 @@ __metadata: resolution: "@saucelabs/visual-storybook@workspace:visual-storybook" dependencies: "@jest/globals": ^28.0.0 || ^29.0.0 - "@saucelabs/visual": 0.4.0 + "@saucelabs/visual": 0.5.0 "@storybook/test-runner": ">=0.13.0" "@storybook/types": ^8.0.2 "@tsconfig/node18": ^2.0.0 @@ -2904,7 +2904,7 @@ __metadata: languageName: unknown linkType: soft -"@saucelabs/visual@0.4.0, @saucelabs/visual@workspace:visual": +"@saucelabs/visual@0.5.0, @saucelabs/visual@workspace:visual": version: 0.0.0-use.local resolution: "@saucelabs/visual@workspace:visual" dependencies: @@ -2949,7 +2949,7 @@ __metadata: resolution: "@saucelabs/wdio-sauce-visual-service@workspace:visual-wdio" dependencies: "@jest/globals": ^29.7.0 - "@saucelabs/visual": 0.4.0 + "@saucelabs/visual": 0.5.0 "@tsconfig/node18": ^2.0.0 "@types/jest": ^29.5.6 "@typescript-eslint/eslint-plugin": ^5.59.1