@wdio/visual-service 4.0.2 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/storybook/Types.d.ts +0 -2
- package/dist/storybook/Types.d.ts.map +1 -1
- package/dist/storybook/launcher.d.ts.map +1 -1
- package/dist/storybook/launcher.js +3 -4
- package/dist/storybook/utils.d.ts +5 -6
- package/dist/storybook/utils.d.ts.map +1 -1
- package/dist/storybook/utils.js +12 -10
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @wdio/visual-service
|
|
2
2
|
|
|
3
|
+
## 4.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4dcfeea: add missing dependency and update deps
|
|
8
|
+
|
|
9
|
+
## 4.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- c9fab82: change console.log to wdio logger
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [c9fab82]
|
|
18
|
+
- webdriver-image-comparison@5.1.0
|
|
19
|
+
|
|
3
20
|
## 4.0.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Logger } from '@wdio/logger';
|
|
2
1
|
import type { RemoteCapability } from 'node_modules/@wdio/types/build/Capabilities.js';
|
|
3
2
|
import type { Folders } from 'webdriver-image-comparison';
|
|
4
3
|
export interface StorybookData {
|
|
@@ -39,7 +38,6 @@ export type CreateTestFileOptions = {
|
|
|
39
38
|
folders: Folders;
|
|
40
39
|
framework: string;
|
|
41
40
|
numShards: number;
|
|
42
|
-
log: Logger;
|
|
43
41
|
skipStories: string[] | RegExp;
|
|
44
42
|
storiesJson: Stories;
|
|
45
43
|
storybookUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/storybook/Types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/storybook/Types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAA;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAC;CACL;AAED,MAAM,WAAW,QAAQ;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE,CAAC;CAC7C;AAED,MAAM,WAAW,UAAU;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE,CAAC;CAC7C;AAED,MAAM,MAAM,OAAO,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,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AI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAA;KACjB,CAAC;IACF,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../src/storybook/launcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AActD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAAS;;gBAGrC,OAAO,EAAE,YAAY;IAK3B,SAAS,CAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC,kBAAkB;
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../src/storybook/launcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AActD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,SAAS;;gBAGrC,OAAO,EAAE,YAAY;IAK3B,SAAS,CAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC,kBAAkB;IAmEpF,UAAU;CAenB"}
|
|
@@ -20,7 +20,7 @@ export default class VisualLauncher extends BaseClass {
|
|
|
20
20
|
}
|
|
21
21
|
else if (isStorybook) {
|
|
22
22
|
log.info('Running `@wdio/visual-service` in Storybook mode.');
|
|
23
|
-
const { storiesJson, storybookUrl, tempDir } = await scanStorybook(config,
|
|
23
|
+
const { storiesJson, storybookUrl, tempDir } = await scanStorybook(config, this.#options);
|
|
24
24
|
// Set an environment variable so it can be used in the onComplete hook
|
|
25
25
|
process.env.VISUAL_STORYBOOK_TEMP_SPEC_FOLDER = tempDir;
|
|
26
26
|
// Check the capabilities
|
|
@@ -54,7 +54,7 @@ export default class VisualLauncher extends BaseClass {
|
|
|
54
54
|
const skipStoriesOption = this.#options?.storybook?.skipStories;
|
|
55
55
|
const skipStoriesArgv = getArgvValue('--skipStories', value => value);
|
|
56
56
|
const skipStories = skipStoriesOption ?? skipStoriesArgv ?? [];
|
|
57
|
-
const parsedSkipStories = parseSkipStories(skipStories
|
|
57
|
+
const parsedSkipStories = parseSkipStories(skipStories);
|
|
58
58
|
// Create the test files
|
|
59
59
|
createTestFiles({
|
|
60
60
|
clip,
|
|
@@ -62,14 +62,13 @@ export default class VisualLauncher extends BaseClass {
|
|
|
62
62
|
directoryPath: tempDir,
|
|
63
63
|
folders: this.folders,
|
|
64
64
|
framework,
|
|
65
|
-
log,
|
|
66
65
|
numShards,
|
|
67
66
|
skipStories: parsedSkipStories,
|
|
68
67
|
storiesJson,
|
|
69
68
|
storybookUrl,
|
|
70
69
|
});
|
|
71
70
|
// Create the capabilities
|
|
72
|
-
createStorybookCapabilities(capabilities
|
|
71
|
+
createStorybookCapabilities(capabilities);
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
async onComplete() {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Logger } from '@wdio/logger';
|
|
2
1
|
import type { Options } from '@wdio/types';
|
|
3
2
|
import type { ClassOptions } from 'webdriver-image-comparison';
|
|
4
3
|
import type { CategoryComponent, CreateItContent, CreateTestContent, CreateTestFileOptions, ScanStorybookReturnData, Stories, EmulatedDeviceType, CapabilityMap } from './Types.js';
|
|
@@ -46,7 +45,7 @@ export declare function itFunction({ clip, clipSelector, folders: { baselineFold
|
|
|
46
45
|
/**
|
|
47
46
|
* Write the test file
|
|
48
47
|
*/
|
|
49
|
-
export declare function writeTestFile(directoryPath: string, fileID: string,
|
|
48
|
+
export declare function writeTestFile(directoryPath: string, fileID: string, testContent: string): void;
|
|
50
49
|
/**
|
|
51
50
|
* Create the test content
|
|
52
51
|
*/
|
|
@@ -58,7 +57,7 @@ export declare function createFileData(describeTitle: string, testContent: strin
|
|
|
58
57
|
/**
|
|
59
58
|
* Create the test files
|
|
60
59
|
*/
|
|
61
|
-
export declare function createTestFiles({ clip, clipSelector, directoryPath, folders, framework,
|
|
60
|
+
export declare function createTestFiles({ clip, clipSelector, directoryPath, folders, framework, numShards, skipStories, storiesJson, storybookUrl }: CreateTestFileOptions, createTestCont?: typeof createTestContent, createFileD?: typeof createFileData, writeTestF?: typeof writeTestFile): void;
|
|
62
61
|
export declare function createChromeCapabilityWithEmulation({ screen: { width, height, dpr }, name, userAgent }: EmulatedDeviceType, isHeadless: boolean): WebdriverIO.Capabilities;
|
|
63
62
|
/**
|
|
64
63
|
* Throw an error message if the capabilities are not set up correctly
|
|
@@ -67,13 +66,13 @@ export declare function capabilitiesErrorMessage(browsers: string[], capabilityM
|
|
|
67
66
|
/**
|
|
68
67
|
* Create the storybook capabilities based on the specified browsers
|
|
69
68
|
*/
|
|
70
|
-
export declare function createStorybookCapabilities(capabilities: WebdriverIO.Capabilities[],
|
|
69
|
+
export declare function createStorybookCapabilities(capabilities: WebdriverIO.Capabilities[], createChromeCapabilityWithEmulationFunc?: typeof createChromeCapabilityWithEmulation, capabilitiesErrorMessageFunc?: typeof capabilitiesErrorMessage): void;
|
|
71
70
|
/**
|
|
72
71
|
* Scan the storybook instance
|
|
73
72
|
*/
|
|
74
|
-
export declare function scanStorybook(config: Options.Testrunner,
|
|
73
|
+
export declare function scanStorybook(config: Options.Testrunner, options: ClassOptions, getArgvVal?: typeof getArgvValue, checkStorybookIsRun?: typeof checkStorybookIsRunning, sanitizeURLFunc?: typeof sanitizeURL, getStoriesJsonFunc?: typeof getStoriesJson): Promise<ScanStorybookReturnData>;
|
|
75
74
|
/**
|
|
76
75
|
* Parse the stories to skip
|
|
77
76
|
*/
|
|
78
|
-
export declare function parseSkipStories(skipStories: string | string[]
|
|
77
|
+
export declare function parseSkipStories(skipStories: string | string[]): RegExp | string[];
|
|
79
78
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/storybook/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/storybook/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAK1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EACR,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EAErB,uBAAuB,EACvB,OAAO,EAGP,kBAAkB,EAClB,aAAa,EAChB,MAAM,YAAY,CAAA;AAKnB;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,MAAM,iBAUxD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAY/C;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAMzE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAA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EAC5B,OAAO,EAAE,MAAM,EAAE,EACjB,iBAAiB,EAAE,kBAAkB,EAAE,EACvC,iBAAiB,EAAE,OAAO,QAiB7B;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACvC,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,EAExC,uCAAuC,6CAAsC,EAC7E,4BAA4B,kCAA2B,QAsF1D;AAED;;GAEG;AACH,wBAAsB,aAAa,CAC/B,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,OAAO,EAAE,YAAY,EAErB,UAAU,sBAAe,EACzB,mBAAmB,iCAA0B,EAC7C,eAAe,qBAAc,EAC7B,kBAAkB,wBAAiB,GACpC,OAAO,CAAC,uBAAuB,CAAC,CAqBlC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAmBlF"}
|
package/dist/storybook/utils.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import logger from '@wdio/logger';
|
|
1
2
|
import fetch from 'node-fetch';
|
|
2
3
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
4
|
import { tmpdir } from 'node:os';
|
|
4
5
|
import { join, resolve } from 'node:path';
|
|
5
6
|
import { deviceDescriptors } from './deviceDescriptors.js';
|
|
7
|
+
const log = logger('@wdio/visual-service:storybook-utils');
|
|
6
8
|
/**
|
|
7
9
|
* Check if we run for Storybook
|
|
8
10
|
*/
|
|
@@ -38,7 +40,7 @@ export async function checkStorybookIsRunning(url) {
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
catch (e) {
|
|
41
|
-
|
|
43
|
+
log.error(`It seems that the Storybook instance is not running at: ${url}. Are you sure it's running?`);
|
|
42
44
|
process.exit(1);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -83,8 +85,8 @@ export async function getStoriesJson(url) {
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
|
-
catch (
|
|
87
|
-
|
|
88
|
+
catch (ign) {
|
|
89
|
+
// Ignore the error
|
|
88
90
|
}
|
|
89
91
|
throw new Error(`Failed to fetch index data from the project. Ensure URLs are available with valid data: ${storiesJsonUrl}, ${indexJsonUrl}.`);
|
|
90
92
|
}
|
|
@@ -146,7 +148,7 @@ export function itFunction({ clip, clipSelector, folders: { baselineFolder }, fr
|
|
|
146
148
|
/**
|
|
147
149
|
* Write the test file
|
|
148
150
|
*/
|
|
149
|
-
export function writeTestFile(directoryPath, fileID,
|
|
151
|
+
export function writeTestFile(directoryPath, fileID, testContent) {
|
|
150
152
|
const filePath = join(directoryPath, `${fileID}.test.js`);
|
|
151
153
|
try {
|
|
152
154
|
writeFileSync(filePath, testContent);
|
|
@@ -227,7 +229,7 @@ ${waitForAllImagesLoaded}
|
|
|
227
229
|
/**
|
|
228
230
|
* Create the test files
|
|
229
231
|
*/
|
|
230
|
-
export function createTestFiles({ clip, clipSelector, directoryPath, folders, framework,
|
|
232
|
+
export function createTestFiles({ clip, clipSelector, directoryPath, folders, framework, numShards, skipStories, storiesJson, storybookUrl },
|
|
231
233
|
// For testing purposes only
|
|
232
234
|
createTestCont = createTestContent, createFileD = createFileData, writeTestF = writeTestFile) {
|
|
233
235
|
const storiesArray = Object.values(storiesJson)
|
|
@@ -239,7 +241,7 @@ createTestCont = createTestContent, createFileD = createFileData, writeTestF = w
|
|
|
239
241
|
if (numShards === 1) {
|
|
240
242
|
const testContent = createTestCont(createTestContentData);
|
|
241
243
|
const fileData = createFileD('All stories', testContent);
|
|
242
|
-
writeTestF(directoryPath, `${fileNamePrefix}-1-1`,
|
|
244
|
+
writeTestF(directoryPath, `${fileNamePrefix}-1-1`, fileData);
|
|
243
245
|
}
|
|
244
246
|
else {
|
|
245
247
|
const totalStories = storiesArray.length;
|
|
@@ -252,7 +254,7 @@ createTestCont = createTestContent, createFileD = createFileData, writeTestF = w
|
|
|
252
254
|
const fileId = `${fileNamePrefix}-${shard + 1}-${numShards}`;
|
|
253
255
|
const describeTitle = `Shard ${shard + 1} of ${numShards}`;
|
|
254
256
|
const fileData = createFileD(describeTitle, testContent);
|
|
255
|
-
writeTestF(directoryPath, fileId,
|
|
257
|
+
writeTestF(directoryPath, fileId, fileData);
|
|
256
258
|
}
|
|
257
259
|
}
|
|
258
260
|
}
|
|
@@ -302,7 +304,7 @@ export function capabilitiesErrorMessage(browsers, capabilityMap, devices, devic
|
|
|
302
304
|
/**
|
|
303
305
|
* Create the storybook capabilities based on the specified browsers
|
|
304
306
|
*/
|
|
305
|
-
export function createStorybookCapabilities(capabilities,
|
|
307
|
+
export function createStorybookCapabilities(capabilities,
|
|
306
308
|
// For testing purposes only
|
|
307
309
|
createChromeCapabilityWithEmulationFunc = createChromeCapabilityWithEmulation, capabilitiesErrorMessageFunc = capabilitiesErrorMessage) {
|
|
308
310
|
if (!Array.isArray(capabilities)) {
|
|
@@ -382,7 +384,7 @@ createChromeCapabilityWithEmulationFunc = createChromeCapabilityWithEmulation, c
|
|
|
382
384
|
/**
|
|
383
385
|
* Scan the storybook instance
|
|
384
386
|
*/
|
|
385
|
-
export async function scanStorybook(config,
|
|
387
|
+
export async function scanStorybook(config, options,
|
|
386
388
|
// For testing purposes only
|
|
387
389
|
getArgvVal = getArgvValue, checkStorybookIsRun = checkStorybookIsRunning, sanitizeURLFunc = sanitizeURL, getStoriesJsonFunc = getStoriesJson) {
|
|
388
390
|
// Prepare storybook scanning
|
|
@@ -406,7 +408,7 @@ getArgvVal = getArgvValue, checkStorybookIsRun = checkStorybookIsRunning, saniti
|
|
|
406
408
|
/**
|
|
407
409
|
* Parse the stories to skip
|
|
408
410
|
*/
|
|
409
|
-
export function parseSkipStories(skipStories
|
|
411
|
+
export function parseSkipStories(skipStories) {
|
|
410
412
|
if (Array.isArray(skipStories)) {
|
|
411
413
|
return skipStories;
|
|
412
414
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wdio/visual-service",
|
|
3
3
|
"author": "Wim Selles - wswebcreation",
|
|
4
4
|
"description": "Image comparison / visual regression testing for WebdriverIO",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.1.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://webdriver.io/docs/visual-testing",
|
|
8
8
|
"repository": {
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@wdio/logger": "^8.28.0",
|
|
24
|
-
"@wdio/types": "^8.
|
|
24
|
+
"@wdio/types": "^8.36.1",
|
|
25
|
+
"@wdio/globals": "^8.36.1",
|
|
25
26
|
"node-fetch": "^3.3.2",
|
|
26
|
-
"webdriver-image-comparison": "^5.0
|
|
27
|
+
"webdriver-image-comparison": "^5.1.0"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
30
|
"build": "run-s clean build:*",
|