Skip to content

Commit

Permalink
chore(release): 1.1.0 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
semantic-release-bot committed Nov 3, 2022
1 parent 006ea2b commit 9a4e733
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 16 deletions.
10 changes: 8 additions & 2 deletions dist/plugins.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins.js.map

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions dist/plugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const PATH_VARIABLES = {
const WINDOWS_LIKE_DRIVE_REGEX = /^[A-Z]:$/;
const METADATA_KEY = "FRSOURCE_CPVRD_V";

var version = "3.0.1";
var version = "3.1.0";

function isHighSurrogate(codePoint) {
return codePoint >= 0xd800 && codePoint <= 0xdbff;
Expand Down Expand Up @@ -143,7 +143,8 @@ const nameCacheCounter = {};
const generateScreenshotPath = ({
titleFromOptions,
imagesPath,
specPath
specPath,
currentRetryNumber
}) => {
const parsePathPartVariables = (pathPart, i) => {
if (pathPart === PATH_VARIABLES.specPath) {
Expand All @@ -163,6 +164,11 @@ const generateScreenshotPath = ({

if (typeof nameCacheCounter[screenshotPath] === "undefined") {
nameCacheCounter[screenshotPath] = -1;
} // it's a retry of the same image, so let's decrease the counter


if (currentRetryNumber > 0) {
--nameCacheCounter[screenshotPath];
}

return path.join(IMAGE_SNAPSHOT_PREFIX, `${screenshotPath} #${++nameCacheCounter[screenshotPath]}${FILE_SUFFIX.actual}.png`);
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins.mjs.map

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions dist/support.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/support.js.map

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions dist/support.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const getConfig = options => {
maxDiffThreshold: options.maxDiffThreshold || Cypress.env("pluginVisualRegressionMaxDiffThreshold") || 0.01,
diffConfig: options.diffConfig || Cypress.env("pluginVisualRegressionDiffConfig") || {},
screenshotConfig: options.screenshotConfig || Cypress.env("pluginVisualRegressionScreenshotConfig") || {},
remoteScreenshotServiceUrl: options.remoteScreenshotServiceUrl || Cypress.env("pluginVisualRegressionRemoteScreenshotServiceUrl")
remoteScreenshotServiceUrl: options.remoteScreenshotServiceUrl || Cypress.env("pluginVisualRegressionRemoteScreenshotServiceUrl"),
matchAgainstPath: options.matchAgainstPath || undefined
};
};
Cypress.Commands.add("matchImage", {
Expand All @@ -81,12 +82,15 @@ Cypress.Commands.add("matchImage", {
maxDiffThreshold,
diffConfig,
screenshotConfig,
remoteScreenshotServiceUrl
remoteScreenshotServiceUrl,
matchAgainstPath
} = getConfig(options);
const currentRetryNumber = cy.state("test").currentRetry();
return cy.then(() => cy.task(TASK.getScreenshotPathInfo, {
titleFromOptions: options.title || Cypress.currentTest.titlePath.join(" "),
imagesPath,
specPath: Cypress.spec.relative
specPath: Cypress.spec.relative,
currentRetryNumber
}, {
log: false
})).then(({
Expand Down Expand Up @@ -129,7 +133,7 @@ Cypress.Commands.add("matchImage", {
}).then(imgPath => cy.task(TASK.compareImages, {
scaleFactor,
imgNew: imgPath,
imgOld: imgPath.replace(FILE_SUFFIX.actual, ""),
imgOld: matchAgainstPath || imgPath.replace(FILE_SUFFIX.actual, ""),
updateImages,
maxDiffThreshold,
diffConfig
Expand Down Expand Up @@ -166,6 +170,19 @@ Cypress.Commands.add("matchImage", {
log.set("consoleProps", () => res);
throw constructCypressError(log, new Error(res.message));
}

return {
diffValue: res.imgDiff,
imgNewPath: imgPath,
imgPath: imgPath.replace(FILE_SUFFIX.actual, ""),
imgDiffPath: imgPath.replace(FILE_SUFFIX.actual, FILE_SUFFIX.diff),
imgNewBase64: res.imgNewBase64,
imgBase64: res.imgOldBase64,
imgDiffBase64: res.imgDiffBase64,
imgNew: typeof res.imgNewBase64 === "string" ? Cypress.Buffer.from(res.imgNewBase64, "base64") : undefined,
img: typeof res.imgOldBase64 === "string" ? Cypress.Buffer.from(res.imgOldBase64, "base64") : undefined,
imgDiff: typeof res.imgDiffBase64 === "string" ? Cypress.Buffer.from(res.imgDiffBase64, "base64") : undefined
};
});
});

Expand Down
2 changes: 1 addition & 1 deletion dist/support.mjs.map

Large diffs are not rendered by default.

0 comments on commit 9a4e733

Please sign in to comment.