From 93bcd2b4da3977e3bcf3191272fafa91cfb10e4d Mon Sep 17 00:00:00 2001 From: Michael Balitsky <35119841+mikstime@users.noreply.github.com> Date: Fri, 11 Nov 2022 19:36:00 +0300 Subject: [PATCH 1/4] Update commands.ts --- src/commands.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands.ts b/src/commands.ts index effadbef..20df879f 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -162,6 +162,7 @@ Cypress.Commands.add( }, log: false, }) + .then(() => cy.task(TASK.processImgPath, { path: imgPath }).then(newImgPath => imgPath = newImgPath)) .then(() => imgPath); }) .then((imgPath) => From 8692901142ca6bdc5600757da3312ec205bfd4e2 Mon Sep 17 00:00:00 2001 From: Michael Balitsky <35119841+mikstime@users.noreply.github.com> Date: Fri, 11 Nov 2022 19:40:04 +0300 Subject: [PATCH 2/4] Update task.hook.ts --- src/task.hook.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/task.hook.ts b/src/task.hook.ts index 64f4ccba..c80448fd 100644 --- a/src/task.hook.ts +++ b/src/task.hook.ts @@ -183,6 +183,8 @@ export const compareImagesTask = async ( export const doesFileExistTask = ({ path }: { path: string }) => fs.existsSync(path); +export const processImgPath = ({ path }) => path; + /* c8 ignore start */ export const initTaskHook = (config: Cypress.PluginConfigOptions) => ({ [TASK.getScreenshotPathInfo]: getScreenshotPathInfoTask, @@ -190,5 +192,6 @@ export const initTaskHook = (config: Cypress.PluginConfigOptions) => ({ [TASK.doesFileExist]: doesFileExistTask, [TASK.approveImage]: approveImageTask, [TASK.compareImages]: compareImagesTask, + [TASK.processImgPath]: processImgPath, }); /* c8 ignore stop */ From cabc8db9796845e4dd6a8920b7812c050415b8ad Mon Sep 17 00:00:00 2001 From: Michael Balitsky <35119841+mikstime@users.noreply.github.com> Date: Mon, 14 Nov 2022 11:10:21 +0300 Subject: [PATCH 3/4] Update commands.ts --- src/commands.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index 20df879f..c59373f5 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -162,8 +162,7 @@ Cypress.Commands.add( }, log: false, }) - .then(() => cy.task(TASK.processImgPath, { path: imgPath }).then(newImgPath => imgPath = newImgPath)) - .then(() => imgPath); + .then(() => cy.task(TASK.processImgPath, { path: imgPath }).then(newImgPath => imgPath = newImgPath)); }) .then((imgPath) => cy From e64b2b8c43549f166845150666c4d5d0e2d5a1c6 Mon Sep 17 00:00:00 2001 From: Michael Balitsky <35119841+mikstime@users.noreply.github.com> Date: Mon, 14 Nov 2022 11:11:26 +0300 Subject: [PATCH 4/4] Update task.hook.ts --- src/task.hook.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/task.hook.ts b/src/task.hook.ts index c80448fd..70102db5 100644 --- a/src/task.hook.ts +++ b/src/task.hook.ts @@ -183,7 +183,7 @@ export const compareImagesTask = async ( export const doesFileExistTask = ({ path }: { path: string }) => fs.existsSync(path); -export const processImgPath = ({ path }) => path; +export const processImgPath = ({ path: string }) => path; /* c8 ignore start */ export const initTaskHook = (config: Cypress.PluginConfigOptions) => ({