@visual-regression-tracker/agent-cypress 5.7.0 → 5.7.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/.github/workflows/ci.yml +6 -3
- package/.github/workflows/release.yml +9 -4
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +8 -8
- package/dist/types.d.ts +2 -2
- package/dist/types.js +2 -0
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +2 -0
- package/package.json +11 -9
package/.github/workflows/ci.yml
CHANGED
|
@@ -9,15 +9,18 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v5
|
|
13
13
|
|
|
14
14
|
- name: Setup Node.js environment
|
|
15
|
-
uses: actions/setup-node@
|
|
15
|
+
uses: actions/setup-node@v5
|
|
16
16
|
with:
|
|
17
|
-
node-version:
|
|
17
|
+
node-version: 22
|
|
18
18
|
|
|
19
19
|
- name: Install npm dependencies
|
|
20
20
|
run: npm ci
|
|
21
21
|
|
|
22
22
|
- name: Build
|
|
23
23
|
run: npm run build
|
|
24
|
+
|
|
25
|
+
- name: Unit tests
|
|
26
|
+
run: npm test
|
|
@@ -7,17 +7,22 @@ jobs:
|
|
|
7
7
|
release:
|
|
8
8
|
name: Release
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
|
-
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write # to publish a GitHub release
|
|
12
|
+
issues: write # to comment on released issues
|
|
13
|
+
pull-requests: write # to comment on released pull requests
|
|
14
|
+
id-token: write # to publish to npm with trusted publishing (OIDC) and provenance
|
|
15
|
+
|
|
11
16
|
steps:
|
|
12
17
|
- name: Checkout
|
|
13
|
-
uses: actions/checkout@
|
|
18
|
+
uses: actions/checkout@v5
|
|
14
19
|
with:
|
|
15
20
|
fetch-depth: 0
|
|
16
21
|
|
|
17
22
|
- name: Setup Node.js environment
|
|
18
|
-
uses: actions/setup-node@
|
|
23
|
+
uses: actions/setup-node@v5
|
|
19
24
|
with:
|
|
20
|
-
node-version:
|
|
25
|
+
node-version: 22
|
|
21
26
|
|
|
22
27
|
- name: Install dependencies
|
|
23
28
|
run: npm ci
|
package/dist/plugin.d.ts
CHANGED
package/dist/plugin.js
CHANGED
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.addVisualRegressionTrackerPlugin =
|
|
12
|
+
exports.addVisualRegressionTrackerPlugin = addVisualRegressionTrackerPlugin;
|
|
13
|
+
/// <reference types="cypress" preserve="true" />
|
|
13
14
|
const fs_1 = require("fs");
|
|
14
15
|
const sdk_js_1 = require("@visual-regression-tracker/sdk-js");
|
|
15
16
|
const utils_1 = require("./utils");
|
|
@@ -26,38 +27,38 @@ function addVisualRegressionTrackerPlugin(on, config) {
|
|
|
26
27
|
on("task", {
|
|
27
28
|
// Start visual regression tracking unless it has already been started
|
|
28
29
|
[utils_1.VRT_TASK_START]: (props) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var
|
|
30
|
+
var _a;
|
|
30
31
|
try {
|
|
31
32
|
if (!vrt[utils_1.VRT_IS_STARTED]()) {
|
|
32
33
|
yield vrt.start();
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
catch (err) {
|
|
36
|
-
return (
|
|
37
|
+
return (_a = err.message) !== null && _a !== void 0 ? _a : err;
|
|
37
38
|
}
|
|
38
39
|
return null;
|
|
39
40
|
}),
|
|
40
41
|
// Stop visual regression tracking if it was started
|
|
41
42
|
[utils_1.VRT_TASK_STOP]: (props) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var
|
|
43
|
+
var _a;
|
|
43
44
|
try {
|
|
44
45
|
if (vrt[utils_1.VRT_IS_STARTED]()) {
|
|
45
46
|
yield vrt.stop();
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
catch (err) {
|
|
49
|
-
return (
|
|
50
|
+
return (_a = err.message) !== null && _a !== void 0 ? _a : err;
|
|
50
51
|
}
|
|
51
52
|
return null;
|
|
52
53
|
}),
|
|
53
54
|
// Track the given test case and optionally clean up the screenshot
|
|
54
55
|
[utils_1.VRT_TASK_TRACK]: (props) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
var
|
|
56
|
+
var _a;
|
|
56
57
|
try {
|
|
57
58
|
return yield vrt.track(props, props === null || props === void 0 ? void 0 : props.retryLimit);
|
|
58
59
|
}
|
|
59
60
|
catch (err) {
|
|
60
|
-
return (
|
|
61
|
+
return (_a = err.message) !== null && _a !== void 0 ? _a : err;
|
|
61
62
|
}
|
|
62
63
|
finally {
|
|
63
64
|
if (!props.keepScreenshot && props.imagePath) {
|
|
@@ -67,4 +68,3 @@ function addVisualRegressionTrackerPlugin(on, config) {
|
|
|
67
68
|
}),
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
exports.addVisualRegressionTrackerPlugin = addVisualRegressionTrackerPlugin;
|
package/dist/types.d.ts
CHANGED
package/dist/types.js
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="cypress" preserve="true" />
|
|
2
|
+
/// <reference types="node" preserve="true" />
|
|
3
3
|
import { TestRunResponse } from "@visual-regression-tracker/sdk-js";
|
|
4
4
|
export declare const VRT_TASK_START = "VRT_START";
|
|
5
5
|
export declare const VRT_TASK_STOP = "VRT_STOP";
|
|
@@ -14,7 +14,7 @@ export declare const log: (message: string) => Cypress.Log;
|
|
|
14
14
|
export declare const handleError: (err: unknown) => void;
|
|
15
15
|
export declare const toTestRunDto: ({ name, pixelRatio, options, }: {
|
|
16
16
|
name: string;
|
|
17
|
-
pixelRatio?: number
|
|
17
|
+
pixelRatio?: number;
|
|
18
18
|
options: any;
|
|
19
19
|
}) => {
|
|
20
20
|
name: string;
|
|
@@ -28,7 +28,7 @@ export declare const toTestRunDto: ({ name, pixelRatio, options, }: {
|
|
|
28
28
|
keepScreenshot: any;
|
|
29
29
|
retryLimit: any;
|
|
30
30
|
};
|
|
31
|
-
export declare const checkResult: (result: TestRunResponse | string, errorCallback?: (
|
|
31
|
+
export declare const checkResult: (result: TestRunResponse | string, errorCallback?: (err: string) => boolean) => void;
|
|
32
32
|
export declare const trackImage: (subject: any, name: string, options: any) => Cypress.Chainable<TestRunResponse>;
|
|
33
33
|
export declare const trackBuffer: (name: string, imageBuffer: Buffer, options: any) => Cypress.Chainable<TestRunResponse>;
|
|
34
34
|
export declare const trackBase64: (name: string, imageBase64: string, options: any) => Cypress.Chainable<TestRunResponse>;
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/// <reference types="cypress" preserve="true" />
|
|
3
|
+
/// <reference types="node" preserve="true" />
|
|
2
4
|
/* global Cypress, cy */
|
|
3
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
6
|
exports.trackBase64 = exports.trackBuffer = exports.trackImage = exports.checkResult = exports.toTestRunDto = exports.handleError = exports.log = exports.VRT_IS_STARTED = exports.VRT_COMMAND_TRACK_BASE64 = exports.VRT_COMMAND_TRACK_BUFFER = exports.VRT_COMMAND_TRACK = exports.VRT_COMMAND_STOP = exports.VRT_COMMAND_START = exports.VRT_TASK_TRACK = exports.VRT_TASK_STOP = exports.VRT_TASK_START = void 0;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visual-regression-tracker/agent-cypress",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.1",
|
|
4
4
|
"description": "Visual Regression Tracker integration plugin for Cypress",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
+
"test": "jest",
|
|
9
10
|
"semantic-release": "semantic-release"
|
|
10
11
|
},
|
|
11
12
|
"repository": {
|
|
@@ -27,16 +28,17 @@
|
|
|
27
28
|
"node": ">=16.16.0"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@visual-regression-tracker/sdk-js": "5.7.
|
|
31
|
+
"@visual-regression-tracker/sdk-js": "5.7.2"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@types/
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
34
|
+
"@jest/globals": "^30.5.2",
|
|
35
|
+
"@types/jest": "^30.0.0",
|
|
36
|
+
"@types/node": "^22.20.5",
|
|
37
|
+
"cypress": "^16.2.0",
|
|
38
|
+
"jest": "^30.5.2",
|
|
39
|
+
"semantic-release": "^25.0.9",
|
|
40
|
+
"ts-jest": "^29.4.15",
|
|
41
|
+
"typescript": "^6.0.3"
|
|
40
42
|
},
|
|
41
43
|
"peerDependencies": {
|
|
42
44
|
"cypress": ">=12.17.1"
|