quickpickle 1.10.1 → 1.11.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.
- package/dist/index.cjs +87 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +87 -29
- package/dist/index.esm.js.map +1 -1
- package/dist/models/DocString.d.ts +1 -0
- package/dist/steps.d.ts +2 -1
- package/dist/world.d.ts +30 -2
- package/package.json +5 -2
package/dist/world.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import type { TestContext } from 'vitest';
|
|
|
2
2
|
import type { QuickPickleConfig } from '.';
|
|
3
3
|
import sanitize from './shims/path-sanitizer';
|
|
4
4
|
import { type PixelmatchOptions } from 'pixelmatch';
|
|
5
|
-
import type
|
|
5
|
+
import { type AriaRole } from '@a11y-tools/aria-roles';
|
|
6
6
|
export type AriaRoleExtended = AriaRole | 'element' | 'input';
|
|
7
7
|
import { Buffer } from 'buffer';
|
|
8
|
+
export declare function isAriaRoleExtended(role: string): role is AriaRoleExtended;
|
|
8
9
|
interface Common {
|
|
9
10
|
info: {
|
|
10
11
|
feature: string;
|
|
@@ -99,8 +100,35 @@ export type VisualDiffResult = {
|
|
|
99
100
|
pct: number;
|
|
100
101
|
};
|
|
101
102
|
export type ScreenshotComparisonOptions = any & Partial<PixelmatchOptions> & {
|
|
103
|
+
/**
|
|
104
|
+
* The maximum difference between the actual and expected images, as a percentage of the total number of pixels.
|
|
105
|
+
*/
|
|
102
106
|
maxDiffPercentage?: number;
|
|
107
|
+
/**
|
|
108
|
+
* The maximum difference between the actual and expected images, as the number of pixels.
|
|
109
|
+
*/
|
|
103
110
|
maxDiffPixels?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Whether to compare the images even if they are of different sizes by resizing them as necessary.
|
|
113
|
+
* @default false
|
|
114
|
+
*/
|
|
115
|
+
resizeEnabled?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Whether to ignore the resized area when comparing images.
|
|
118
|
+
*/
|
|
119
|
+
resizeIgnored?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* The color to use for resizing images, in [r,g,b] format, with values from 0 to 255.
|
|
122
|
+
* If this number is too similar to the color of the larger image, the resized area
|
|
123
|
+
* will be ignored by the pixelmatch algorithm.
|
|
124
|
+
* @default [255,0,128]
|
|
125
|
+
*/
|
|
126
|
+
resizeColor?: [number, number, number];
|
|
127
|
+
/**
|
|
128
|
+
* The anchor point to use if the images are of different size.
|
|
129
|
+
* @default "top left"
|
|
130
|
+
*/
|
|
131
|
+
resizeAnchor?: 'top left' | 'top right' | 'bottom left' | 'bottom right' | 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
104
132
|
};
|
|
105
133
|
export declare const defaultScreenshotComparisonOptions: ScreenshotComparisonOptions;
|
|
106
134
|
export interface VisualConfigSetting {
|
|
@@ -161,7 +189,7 @@ export interface VisualWorldInterface extends StubVisualWorldInterface {
|
|
|
161
189
|
* @param text string
|
|
162
190
|
* A string that the element must contain.
|
|
163
191
|
*/
|
|
164
|
-
getLocator(locator: any, identifier: string, role: AriaRoleExtended, text?: string | null): any;
|
|
192
|
+
getLocator(locator: any, identifier: string, role: AriaRoleExtended | string, text?: string | null): any;
|
|
165
193
|
/**
|
|
166
194
|
* Sets a value on a form element based on its type (select, checkbox/radio, or other input).
|
|
167
195
|
* The "Locator" interface used should be whatever is compatible with the testing library
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickpickle",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Plugin for Vitest to run tests written in Gherkin Syntax.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"BDD",
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"@cucumber/messages": "^27.2.0",
|
|
42
42
|
"@cucumber/tag-expressions": "^6.1.2",
|
|
43
43
|
"buffer": "^6.0.3",
|
|
44
|
+
"image-crop-or-pad": "^1.0.1",
|
|
45
|
+
"js-yaml": "^4.1.1",
|
|
44
46
|
"lodash": "^4.17.21",
|
|
45
47
|
"lodash-es": "^4.17.21",
|
|
46
48
|
"pngjs": "^7.0.0"
|
|
@@ -51,6 +53,7 @@
|
|
|
51
53
|
"@rollup/plugin-replace": "^6.0.2",
|
|
52
54
|
"@rollup/plugin-terser": "^0.4.4",
|
|
53
55
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
56
|
+
"@types/js-yaml": "^4.0.9",
|
|
54
57
|
"@types/lodash": "^4.17.16",
|
|
55
58
|
"@types/lodash-es": "^4.17.12",
|
|
56
59
|
"@types/node": "^22.15.17",
|
|
@@ -65,7 +68,7 @@
|
|
|
65
68
|
},
|
|
66
69
|
"repository": {
|
|
67
70
|
"type": "git",
|
|
68
|
-
"url": "https://github.com/dnotes/quickpickle
|
|
71
|
+
"url": "https://github.com/dnotes/quickpickle"
|
|
69
72
|
},
|
|
70
73
|
"scripts": {
|
|
71
74
|
"build": "rollup -c && FORMAT=cjs rollup -c",
|