Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement selective diffing for Nightwatch #56

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions visual-js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Loading