@visual-regression-tracker/agent-cypress 5.7.1 → 5.8.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/README.md CHANGED
@@ -55,7 +55,7 @@ import { addVisualRegressionTrackerPlugin } from "@visual-regression-tracker/age
55
55
  export default defineConfig({
56
56
  // e2e or component, depending of testing style
57
57
  e2e: {
58
- setupNodeEvents (on, config) => {
58
+ setupNodeEvents(on, config) {
59
59
  addVisualRegressionTrackerPlugin(on, config);
60
60
  }
61
61
  }
@@ -89,9 +89,10 @@ export default defineConfig({
89
89
  // Required
90
90
  "branchName": "develop",
91
91
 
92
- // Branch with baseline
92
+ // Branch to take baselines from instead of the project's main branch
93
93
  // Optional - when not set, main branch from project settings is used
94
- "baselineBranchName": "release",
94
+ // Also read from VRT_SOURCEBRANCH when not set here
95
+ "sourceBranch": "release",
95
96
 
96
97
  // Log errors instead of throwing exceptions
97
98
  // Optional - default false
@@ -117,6 +118,7 @@ _Is overriden if ENV variables are present_
117
118
  "apiKey": "tXZVHX0EA4YQM1MGDD",
118
119
  "ciBuildId": "commit_sha",
119
120
  "branchName": "develop",
121
+ "sourceBranch": "release",
120
122
  "enableSoftAssert": false
121
123
  }
122
124
  ```
@@ -131,10 +133,15 @@ VRT_PROJECT="Default project"
131
133
  VRT_APIKEY="tXZVHX0EA4YQM1MGDD"
132
134
  VRT_CIBUILDID="commit_sha"
133
135
  VRT_BRANCHNAME="develop"
134
- VRT_BASELINEBRANCHNAME="release"
136
+ VRT_SOURCEBRANCH="release"
135
137
  VRT_ENABLESOFTASSERT=true
136
138
  ```
137
139
 
140
+ `sourceBranch` replaces `baselineBranchName` (`VRT_BASELINEBRANCHNAME`), which
141
+ the server never read. The old name still works as an alias and logs a
142
+ deprecation warning; like the other `VRT_*` variables, `VRT_BASELINEBRANCHNAME`
143
+ is read only when `visualRegressionTracker` is not set in the Cypress config.
144
+
138
145
  ## Usage
139
146
 
140
147
  ### Setup
package/dist/plugin.js CHANGED
@@ -23,7 +23,10 @@ const utils_1 = require("./utils");
23
23
  function addVisualRegressionTrackerPlugin(on, config) {
24
24
  var _a;
25
25
  const vrtConfig = (_a = config === null || config === void 0 ? void 0 : config.env) === null || _a === void 0 ? void 0 : _a.visualRegressionTracker;
26
- const vrt = new sdk_js_1.VisualRegressionTracker(vrtConfig);
26
+ // sdk-js skips VRT_* variables when given an explicit config
27
+ const vrt = new sdk_js_1.VisualRegressionTracker(vrtConfig && Object.assign(Object.assign({}, vrtConfig), { sourceBranch: vrtConfig.sourceBranch ||
28
+ vrtConfig.baselineBranchName ||
29
+ process.env.VRT_SOURCEBRANCH }));
27
30
  on("task", {
28
31
  // Start visual regression tracking unless it has already been started
29
32
  [utils_1.VRT_TASK_START]: (props) => __awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visual-regression-tracker/agent-cypress",
3
- "version": "5.7.1",
3
+ "version": "5.8.0",
4
4
  "description": "Visual Regression Tracker integration plugin for Cypress",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/",
@@ -28,7 +28,7 @@
28
28
  "node": ">=16.16.0"
29
29
  },
30
30
  "dependencies": {
31
- "@visual-regression-tracker/sdk-js": "5.7.2"
31
+ "@visual-regression-tracker/sdk-js": "^5.8.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@jest/globals": "^30.5.2",