storybook-addon-playwright 4.18.1 → 4.19.0
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.
|
@@ -17,9 +17,9 @@ const diffImageToScreenshot = (data, imageBuffer, options) => tslib_1.__awaiter(
|
|
|
17
17
|
if (!fs.existsSync(diffDir)) {
|
|
18
18
|
fs.mkdirSync(diffDir, { recursive: true });
|
|
19
19
|
}
|
|
20
|
-
const result = (0, diff_snapshot_1.runDiffImageToSnapshot)(Object.assign({ blur: 0, diffDir, diffDirection: config.diffDirection
|
|
20
|
+
const result = (0, diff_snapshot_1.runDiffImageToSnapshot)(Object.assign(Object.assign({ blur: 0, diffDir, diffDirection: config.diffDirection
|
|
21
21
|
? config.diffDirection
|
|
22
|
-
: 'horizontal', failureThreshold: 0, failureThresholdType: 'pixel', receivedImageBuffer: imageBuffer, snapshotIdentifier: paths.screenshotIdentifier, snapshotsDir: paths.screenshotsDir, updatePassedSnapshot: false, updateSnapshot: false }, options));
|
|
22
|
+
: 'horizontal', failureThreshold: 0, failureThresholdType: 'pixel', receivedImageBuffer: imageBuffer, snapshotIdentifier: paths.screenshotIdentifier, snapshotsDir: paths.screenshotsDir, updatePassedSnapshot: false, updateSnapshot: false }, config.imageDiffOptions), options));
|
|
23
23
|
if (!result.pass) {
|
|
24
24
|
fs.rmdirSync(diffDir, { recursive: true });
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-image-to-screenshot.js","sourceRoot":"","sources":["../../../../src/api/server/services/diff-image-to-screenshot.ts"],"names":[],"mappings":";;;;AACA,yEAA+E;AAG/E,+CAAyB;AACzB,wCAAwC;AACxC,wEAAmE;AACnE,mCAAmC;AACnC,wDAAwB;AAOjB,MAAM,qBAAqB,GAAG,CACnC,IAA2B,EAC3B,WAAmB,EACnB,OAAkC,EACR,EAAE;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI;YACF,MAAM,KAAK,GAAG,IAAA,yCAAkB,EAAC,IAAI,CAAC,CAAC;YACvC,MAAM,MAAM,GAAG,IAAA,oBAAU,GAAE,CAAC;YAE5B,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"diff-image-to-screenshot.js","sourceRoot":"","sources":["../../../../src/api/server/services/diff-image-to-screenshot.ts"],"names":[],"mappings":";;;;AACA,yEAA+E;AAG/E,+CAAyB;AACzB,wCAAwC;AACxC,wEAAmE;AACnE,mCAAmC;AACnC,wDAAwB;AAOjB,MAAM,qBAAqB,GAAG,CACnC,IAA2B,EAC3B,WAAmB,EACnB,OAAkC,EACR,EAAE;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI;YACF,MAAM,KAAK,GAAG,IAAA,yCAAkB,EAAC,IAAI,CAAC,CAAC;YACvC,MAAM,MAAM,GAAG,IAAA,oBAAU,GAAE,CAAC;YAE5B,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAC1B,OAAO,CAAC,GAAG,EAAE,EACb,aAAa,EACb,IAAI,CAAC,OAAO,EACZ,iBAAiB,CAClB,CAAC;YACF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAC3B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;aAC5C;YACD,MAAM,MAAM,GAAG,IAAA,sCAAsB,EAAC,8BACpC,IAAI,EAAE,CAAC,EACP,OAAO,EACP,aAAa,EAAE,MAAM,CAAC,aAAa;oBACjC,CAAC,CAAC,MAAM,CAAC,aAAa;oBACtB,CAAC,CAAC,YAAY,EAChB,gBAAgB,EAAE,CAAC,EACnB,oBAAoB,EAAE,OAAO,EAC7B,mBAAmB,EAAE,WAAW,EAChC,kBAAkB,EAAE,KAAK,CAAC,oBAAoB,EAC9C,YAAY,EAAE,KAAK,CAAC,cAAc,EAClC,oBAAoB,EAAE,KAAK,EAC3B,cAAc,EAAE,KAAK,IAClB,MAAM,CAAC,gBAAgB,GACvB,OAAO,CACQ,CAAoB,CAAC;YAEzC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBAChB,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;aAC5C;YAED,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;YAC5C,OAAO,CAAC,MAAM,CAAC,CAAC;SACjB;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,CAAC;SACf;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AA9CW,QAAA,qBAAqB,yBA8ChC"}
|
package/dist/typings/config.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { StoryInfo } from './story-info';
|
|
|
7
7
|
import { TestFileScreenshots } from '../api/server/services/test-file-screenshots';
|
|
8
8
|
import { Theme } from '@material-ui/core';
|
|
9
9
|
import { CompareScreenshotParams, CompareScreenshotReturnType } from './compare-screenshot';
|
|
10
|
+
import { MatchImageSnapshotOptions } from 'jest-image-snapshot';
|
|
10
11
|
type PageGotoOptions = Parameters<Page['goto']>[1];
|
|
11
12
|
export interface Config<T = Page> {
|
|
12
13
|
storybookEndpoint: string;
|
|
@@ -33,5 +34,6 @@ export interface Config<T = Page> {
|
|
|
33
34
|
screenshotOptions?: TakeScreenshotOptionsParams;
|
|
34
35
|
compareScreenshot?: (data: CompareScreenshotParams) => Promise<CompareScreenshotReturnType | false>;
|
|
35
36
|
theme?: Theme;
|
|
37
|
+
imageDiffOptions: Pick<MatchImageSnapshotOptions, 'allowSizeMismatch' | 'comparisonMethod' | 'diffDirection' | 'customDiffConfig'>;
|
|
36
38
|
}
|
|
37
39
|
export {};
|
package/package.json
CHANGED