@chromatic-com/cypress 0.6.7 → 0.6.8-971f474-20240524014118
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.d.mts +1 -8
- package/dist/index.d.ts +1 -8
- package/dist/support.js.map +1 -1
- package/dist/support.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
interface TaskParams {
|
|
2
|
-
action: 'setup-network-listener' | 'save-archives';
|
|
3
|
-
payload?: any;
|
|
4
|
-
}
|
|
5
|
-
declare const prepareArchives: ({ action, payload }: TaskParams) => Promise<unknown>;
|
|
6
|
-
declare const onBeforeBrowserLaunch: (browser: Cypress.Browser, launchOptions: Cypress.BeforeBrowserLaunchOptions, config: Cypress.PluginConfigOptions) => Cypress.BeforeBrowserLaunchOptions;
|
|
7
|
-
declare const installPlugin: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => void;
|
|
8
1
|
|
|
9
|
-
export {
|
|
2
|
+
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
interface TaskParams {
|
|
2
|
-
action: 'setup-network-listener' | 'save-archives';
|
|
3
|
-
payload?: any;
|
|
4
|
-
}
|
|
5
|
-
declare const prepareArchives: ({ action, payload }: TaskParams) => Promise<unknown>;
|
|
6
|
-
declare const onBeforeBrowserLaunch: (browser: Cypress.Browser, launchOptions: Cypress.BeforeBrowserLaunchOptions, config: Cypress.PluginConfigOptions) => Cypress.BeforeBrowserLaunchOptions;
|
|
7
|
-
declare const installPlugin: (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions) => void;
|
|
8
1
|
|
|
9
|
-
export {
|
|
2
|
+
export { }
|
package/dist/support.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/support.ts","../src/commands.ts"],"names":["snapshot","Cypress","Commands","add","name","config","cy","document","then","doc","manualSnapshot","get","snapshots","as","beforeEach","wrap","task","action","payload","allowedDomains","env","afterEach","automaticSnapshot","manualSnapshots","url","testTitlePath","spec","relativeToCommonRoot","currentTest","titlePath","domSnapshots","chromaticStorybookParams","diffThreshold","delay","diffIncludeAntiAliasing","forcedColors","pauseAnimationAtEnd","prefersReducedMotion","cropToViewport","pageUrl","viewport","height","width"],"mappings":"AAAA,OAASA,YAAAA,MAAgB,iBCAzB,OAASA,YAAAA,MAAgB,iBAGzBC,QAAQC,SAASC,IAAI,eAAiBC,GAAAA,CAE/BH,QAAQI,OAAO,gBAAA,GAIpBC,GAAGC,SAAQ,EAAGC,KAAMC,GAAAA,CAElB,IAAMC,EAAiBV,EAASS,CAAAA,EAEhCH,GAAGK,IAAI,kBAAA,EAEJH,KAAMI,GACE,IAAIA,EAAW,CAAER,KAAAA,EAAMJ,SAAUU,CAAe,EACzD,EACCG,GAAG,iBAAA,CACR,CAAA,CACF,CAAA,EDhBAC,WAAW,IAAA,CAEJb,QAAQI,OAAO,gBAAA,IAMpBC,GAAGS,KAAK,CAAA,CAAE,EAAEF,GAAG,iBAAA,EACfP,GAAGU,KAAK,kBAAmB,CACzBC,OAAQ,yBACRC,QAAS,CAAEC,eAAgBlB,QAAQmB,IAAI,cAAA,CAAgB,CACzD,CAAA,EACF,CAAA,EAEAC,UAAU,IAAA,CAEJpB,QAAQmB,IAAI,qBAAA,GAA0B,CAACnB,QAAQI,OAAO,gBAAA,GAI1DC,GAAGC,SAAQ,EAAGC,KAAMC,GAAAA,CAClB,IAAMa,EAAoBtB,EAASS,CAAAA,EAEnCH,GAAGK,IAAI,kBAAA,EAAoBH,KAAK,CAACe,EAAkB,CAAA,IAAE,CACnDjB,GAAGkB,IAAG,EAAGhB,KAAMgB,GAAAA,CAEblB,GAAGU,KAAK,kBAAmB,CACzBC,OAAQ,gBACRC,QAAS,CAEPO,cAAe,CAACxB,QAAQyB,KAAKC,wBAAyB1B,QAAQ2B,YAAYC,WAC1EC,aAAc,IAAIP,EAAiB,CAAEvB,SAAUsB,CAAkB,GACjES,yBAA0B,CACxB,GAAI9B,QAAQmB,IAAI,eAAA,GAAoB,CAAEY,cAAe/B,QAAQmB,IAAI,eAAA,CAAiB,EAClF,GAAInB,QAAQmB,IAAI,OAAA,GAAY,CAAEa,MAAOhC,QAAQmB,IAAI,OAAA,CAAS,EAC1D,GAAInB,QAAQmB,IAAI,yBAAA,GAA8B,CAC5Cc,wBAAyBjC,QAAQmB,IAAI,yBAAA,CACvC,EACA,GAAInB,QAAQmB,IAAI,eAAA,GAAoB,CAAEY,cAAe/B,QAAQmB,IAAI,eAAA,CAAiB,EAClF,GAAInB,QAAQmB,IAAI,cAAA,GAAmB,CAAEe,aAAclC,QAAQmB,IAAI,cAAA,CAAgB,EAC/E,GAAInB,QAAQmB,IAAI,qBAAA,GAA0B,CACxCgB,oBAAqBnC,QAAQmB,IAAI,qBAAA,CACnC,EACA,GAAInB,QAAQmB,IAAI,sBAAA,GAA2B,CACzCiB,qBAAsBpC,QAAQmB,IAAI,sBAAA,CACpC,EACA,GAAInB,QAAQmB,IAAI,gBAAA,GAAqB,CACnCkB,eAAgBrC,QAAQmB,IAAI,gBAAA,CAC9B,CACF,EACAmB,QAASf,EACTgB,SAAU,CACRC,OAAQxC,QAAQI,OAAO,gBAAA,EACvBqC,MAAOzC,QAAQI,OAAO,eAAA,CACxB,CACF,CACF,CAAA,CACF,CAAA,CACF,CAAA,CACF,CAAA,CACF,CAAA","sourcesContent":["import { snapshot } from 'rrweb-snapshot';\nimport './commands';\n\n// these client-side lifecycle hooks will be added to the user's Cypress suite\nbeforeEach(() => {\n // don't take snapshots when running `cypress open`\n if (!Cypress.config('isTextTerminal')) {\n return;\n }\n // this \"manualSnapshots\" variable will be available before, during, and after the test,\n // then cleaned up before the next test is run\n // (see https://docs.cypress.io/guides/core-concepts/variables-and-aliases#Aliases)\n cy.wrap([]).as('manualSnapshots');\n cy.task('prepareArchives', {\n action: 'setup-network-listener',\n payload: { allowedDomains: Cypress.env('assetDomains') },\n });\n});\n\nafterEach(() => {\n // don't take snapshots when running `cypress open`\n if (Cypress.env('disableAutoSnapshot') || !Cypress.config('isTextTerminal')) {\n return;\n }\n // can we be sure this always fires after all the requests are back?\n cy.document().then((doc) => {\n const automaticSnapshot = snapshot(doc);\n // @ts-expect-error will fix when Cypress has its own package\n cy.get('@manualSnapshots').then((manualSnapshots = []) => {\n cy.url().then((url) => {\n // pass the snapshot to the server to write to disk\n cy.task('prepareArchives', {\n action: 'save-archives',\n payload: {\n // @ts-expect-error relativeToCommonRoot is on spec (but undocumented)\n testTitlePath: [Cypress.spec.relativeToCommonRoot, ...Cypress.currentTest.titlePath],\n domSnapshots: [...manualSnapshots, { snapshot: automaticSnapshot }],\n chromaticStorybookParams: {\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('delay') && { delay: Cypress.env('delay') }),\n ...(Cypress.env('diffIncludeAntiAliasing') && {\n diffIncludeAntiAliasing: Cypress.env('diffIncludeAntiAliasing'),\n }),\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('forcedColors') && { forcedColors: Cypress.env('forcedColors') }),\n ...(Cypress.env('pauseAnimationAtEnd') && {\n pauseAnimationAtEnd: Cypress.env('pauseAnimationAtEnd'),\n }),\n ...(Cypress.env('prefersReducedMotion') && {\n prefersReducedMotion: Cypress.env('prefersReducedMotion'),\n }),\n ...(Cypress.env('cropToViewport') && {\n cropToViewport: Cypress.env('cropToViewport'),\n }),\n },\n pageUrl: url,\n viewport: {\n height: Cypress.config('viewportHeight'),\n width: Cypress.config('viewportWidth'),\n },\n },\n });\n });\n });\n });\n});\n","import { snapshot } from 'rrweb-snapshot';\nimport type { elementNode } from 'rrweb-snapshot';\n
|
|
1
|
+
{"version":3,"sources":["../src/support.ts","../src/commands.ts"],"names":["snapshot","Cypress","Commands","add","name","config","cy","document","then","doc","manualSnapshot","get","snapshots","as","beforeEach","wrap","task","action","payload","allowedDomains","env","afterEach","automaticSnapshot","manualSnapshots","url","testTitlePath","spec","relativeToCommonRoot","currentTest","titlePath","domSnapshots","chromaticStorybookParams","diffThreshold","delay","diffIncludeAntiAliasing","forcedColors","pauseAnimationAtEnd","prefersReducedMotion","cropToViewport","pageUrl","viewport","height","width"],"mappings":"AAAA,OAASA,YAAAA,MAAgB,iBCAzB,OAASA,YAAAA,MAAgB,iBAGzBC,QAAQC,SAASC,IAAI,eAAiBC,GAAAA,CAE/BH,QAAQI,OAAO,gBAAA,GAIpBC,GAAGC,SAAQ,EAAGC,KAAMC,GAAAA,CAElB,IAAMC,EAAiBV,EAASS,CAAAA,EAEhCH,GAAGK,IAAI,kBAAA,EAEJH,KAAMI,GACE,IAAIA,EAAW,CAAER,KAAAA,EAAMJ,SAAUU,CAAe,EACzD,EACCG,GAAG,iBAAA,CACR,CAAA,CACF,CAAA,EDhBAC,WAAW,IAAA,CAEJb,QAAQI,OAAO,gBAAA,IAMpBC,GAAGS,KAAK,CAAA,CAAE,EAAEF,GAAG,iBAAA,EACfP,GAAGU,KAAK,kBAAmB,CACzBC,OAAQ,yBACRC,QAAS,CAAEC,eAAgBlB,QAAQmB,IAAI,cAAA,CAAgB,CACzD,CAAA,EACF,CAAA,EAEAC,UAAU,IAAA,CAEJpB,QAAQmB,IAAI,qBAAA,GAA0B,CAACnB,QAAQI,OAAO,gBAAA,GAI1DC,GAAGC,SAAQ,EAAGC,KAAMC,GAAAA,CAClB,IAAMa,EAAoBtB,EAASS,CAAAA,EAEnCH,GAAGK,IAAI,kBAAA,EAAoBH,KAAK,CAACe,EAAkB,CAAA,IAAE,CACnDjB,GAAGkB,IAAG,EAAGhB,KAAMgB,GAAAA,CAEblB,GAAGU,KAAK,kBAAmB,CACzBC,OAAQ,gBACRC,QAAS,CAEPO,cAAe,CAACxB,QAAQyB,KAAKC,wBAAyB1B,QAAQ2B,YAAYC,WAC1EC,aAAc,IAAIP,EAAiB,CAAEvB,SAAUsB,CAAkB,GACjES,yBAA0B,CACxB,GAAI9B,QAAQmB,IAAI,eAAA,GAAoB,CAAEY,cAAe/B,QAAQmB,IAAI,eAAA,CAAiB,EAClF,GAAInB,QAAQmB,IAAI,OAAA,GAAY,CAAEa,MAAOhC,QAAQmB,IAAI,OAAA,CAAS,EAC1D,GAAInB,QAAQmB,IAAI,yBAAA,GAA8B,CAC5Cc,wBAAyBjC,QAAQmB,IAAI,yBAAA,CACvC,EACA,GAAInB,QAAQmB,IAAI,eAAA,GAAoB,CAAEY,cAAe/B,QAAQmB,IAAI,eAAA,CAAiB,EAClF,GAAInB,QAAQmB,IAAI,cAAA,GAAmB,CAAEe,aAAclC,QAAQmB,IAAI,cAAA,CAAgB,EAC/E,GAAInB,QAAQmB,IAAI,qBAAA,GAA0B,CACxCgB,oBAAqBnC,QAAQmB,IAAI,qBAAA,CACnC,EACA,GAAInB,QAAQmB,IAAI,sBAAA,GAA2B,CACzCiB,qBAAsBpC,QAAQmB,IAAI,sBAAA,CACpC,EACA,GAAInB,QAAQmB,IAAI,gBAAA,GAAqB,CACnCkB,eAAgBrC,QAAQmB,IAAI,gBAAA,CAC9B,CACF,EACAmB,QAASf,EACTgB,SAAU,CACRC,OAAQxC,QAAQI,OAAO,gBAAA,EACvBqC,MAAOzC,QAAQI,OAAO,eAAA,CACxB,CACF,CACF,CAAA,CACF,CAAA,CACF,CAAA,CACF,CAAA,CACF,CAAA","sourcesContent":["import { snapshot } from 'rrweb-snapshot';\nimport './commands';\n\n// these client-side lifecycle hooks will be added to the user's Cypress suite\nbeforeEach(() => {\n // don't take snapshots when running `cypress open`\n if (!Cypress.config('isTextTerminal')) {\n return;\n }\n // this \"manualSnapshots\" variable will be available before, during, and after the test,\n // then cleaned up before the next test is run\n // (see https://docs.cypress.io/guides/core-concepts/variables-and-aliases#Aliases)\n cy.wrap([]).as('manualSnapshots');\n cy.task('prepareArchives', {\n action: 'setup-network-listener',\n payload: { allowedDomains: Cypress.env('assetDomains') },\n });\n});\n\nafterEach(() => {\n // don't take snapshots when running `cypress open`\n if (Cypress.env('disableAutoSnapshot') || !Cypress.config('isTextTerminal')) {\n return;\n }\n // can we be sure this always fires after all the requests are back?\n cy.document().then((doc) => {\n const automaticSnapshot = snapshot(doc);\n // @ts-expect-error will fix when Cypress has its own package\n cy.get('@manualSnapshots').then((manualSnapshots = []) => {\n cy.url().then((url) => {\n // pass the snapshot to the server to write to disk\n cy.task('prepareArchives', {\n action: 'save-archives',\n payload: {\n // @ts-expect-error relativeToCommonRoot is on spec (but undocumented)\n testTitlePath: [Cypress.spec.relativeToCommonRoot, ...Cypress.currentTest.titlePath],\n domSnapshots: [...manualSnapshots, { snapshot: automaticSnapshot }],\n chromaticStorybookParams: {\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('delay') && { delay: Cypress.env('delay') }),\n ...(Cypress.env('diffIncludeAntiAliasing') && {\n diffIncludeAntiAliasing: Cypress.env('diffIncludeAntiAliasing'),\n }),\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('forcedColors') && { forcedColors: Cypress.env('forcedColors') }),\n ...(Cypress.env('pauseAnimationAtEnd') && {\n pauseAnimationAtEnd: Cypress.env('pauseAnimationAtEnd'),\n }),\n ...(Cypress.env('prefersReducedMotion') && {\n prefersReducedMotion: Cypress.env('prefersReducedMotion'),\n }),\n ...(Cypress.env('cropToViewport') && {\n cropToViewport: Cypress.env('cropToViewport'),\n }),\n },\n pageUrl: url,\n viewport: {\n height: Cypress.config('viewportHeight'),\n width: Cypress.config('viewportWidth'),\n },\n },\n });\n });\n });\n });\n});\n","import { snapshot } from 'rrweb-snapshot';\nimport type { elementNode } from 'rrweb-snapshot';\n\nCypress.Commands.add('takeSnapshot', (name?: string) => {\n // don't take snapshots when running `cypress open`\n if (!Cypress.config('isTextTerminal')) {\n return;\n }\n\n cy.document().then((doc) => {\n // here, handle the source map\n const manualSnapshot = snapshot(doc);\n // reassign manualSnapshots so it includes this new snapshot\n cy.get('@manualSnapshots')\n // @ts-expect-error will fix when Cypress has its own package\n .then((snapshots: elementNode[]) => {\n return [...snapshots, { name, snapshot: manualSnapshot }];\n })\n .as('manualSnapshots');\n });\n});\n"]}
|
package/dist/support.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/support.ts","../src/commands.ts"],"names":["snapshot","Cypress","Commands","add","name","config","cy","document","then","doc","manualSnapshot","get","snapshots","as","beforeEach","wrap","task","action","payload","allowedDomains","env","afterEach","automaticSnapshot","manualSnapshots","url","testTitlePath","spec","relativeToCommonRoot","currentTest","titlePath","domSnapshots","chromaticStorybookParams","diffThreshold","delay","diffIncludeAntiAliasing","forcedColors","pauseAnimationAtEnd","prefersReducedMotion","cropToViewport","pageUrl","viewport","height","width"],"mappings":"AAAA,OAASA,YAAAA,MAAgB,iBCAzB,OAASA,YAAAA,MAAgB,iBAGzBC,QAAQC,SAASC,IAAI,eAAiBC,GAAAA,CAE/BH,QAAQI,OAAO,gBAAA,GAIpBC,GAAGC,SAAQ,EAAGC,KAAMC,GAAAA,CAElB,IAAMC,EAAiBV,EAASS,CAAAA,EAEhCH,GAAGK,IAAI,kBAAA,EAEJH,KAAMI,GACE,IAAIA,EAAW,CAAER,KAAAA,EAAMJ,SAAUU,CAAe,EACzD,EACCG,GAAG,iBAAA,CACR,CAAA,CACF,CAAA,EDhBAC,WAAW,IAAA,CAEJb,QAAQI,OAAO,gBAAA,IAMpBC,GAAGS,KAAK,CAAA,CAAE,EAAEF,GAAG,iBAAA,EACfP,GAAGU,KAAK,kBAAmB,CACzBC,OAAQ,yBACRC,QAAS,CAAEC,eAAgBlB,QAAQmB,IAAI,cAAA,CAAgB,CACzD,CAAA,EACF,CAAA,EAEAC,UAAU,IAAA,CAEJpB,QAAQmB,IAAI,qBAAA,GAA0B,CAACnB,QAAQI,OAAO,gBAAA,GAI1DC,GAAGC,SAAQ,EAAGC,KAAM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b-snapshot';\nimport './commands';\n\n// these client-side lifecycle hooks will be added to the user's Cypress suite\nbeforeEach(() => {\n // don't take snapshots when running `cypress open`\n if (!Cypress.config('isTextTerminal')) {\n return;\n }\n // this \"manualSnapshots\" variable will be available before, during, and after the test,\n // then cleaned up before the next test is run\n // (see https://docs.cypress.io/guides/core-concepts/variables-and-aliases#Aliases)\n cy.wrap([]).as('manualSnapshots');\n cy.task('prepareArchives', {\n action: 'setup-network-listener',\n payload: { allowedDomains: Cypress.env('assetDomains') },\n });\n});\n\nafterEach(() => {\n // don't take snapshots when running `cypress open`\n if (Cypress.env('disableAutoSnapshot') || !Cypress.config('isTextTerminal')) {\n return;\n }\n // can we be sure this always fires after all the requests are back?\n cy.document().then((doc) => {\n const automaticSnapshot = snapshot(doc);\n // @ts-expect-error will fix when Cypress has its own package\n cy.get('@manualSnapshots').then((manualSnapshots = []) => {\n cy.url().then((url) => {\n // pass the snapshot to the server to write to disk\n cy.task('prepareArchives', {\n action: 'save-archives',\n payload: {\n // @ts-expect-error relativeToCommonRoot is on spec (but undocumented)\n testTitlePath: [Cypress.spec.relativeToCommonRoot, ...Cypress.currentTest.titlePath],\n domSnapshots: [...manualSnapshots, { snapshot: automaticSnapshot }],\n chromaticStorybookParams: {\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('delay') && { delay: Cypress.env('delay') }),\n ...(Cypress.env('diffIncludeAntiAliasing') && {\n diffIncludeAntiAliasing: Cypress.env('diffIncludeAntiAliasing'),\n }),\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('forcedColors') && { forcedColors: Cypress.env('forcedColors') }),\n ...(Cypress.env('pauseAnimationAtEnd') && {\n pauseAnimationAtEnd: Cypress.env('pauseAnimationAtEnd'),\n }),\n ...(Cypress.env('prefersReducedMotion') && {\n prefersReducedMotion: Cypress.env('prefersReducedMotion'),\n }),\n ...(Cypress.env('cropToViewport') && {\n cropToViewport: Cypress.env('cropToViewport'),\n }),\n },\n pageUrl: url,\n viewport: {\n height: Cypress.config('viewportHeight'),\n width: Cypress.config('viewportWidth'),\n },\n },\n });\n });\n });\n });\n});\n","import { snapshot } from 'rrweb-snapshot';\nimport type { elementNode } from 'rrweb-snapshot';\n
|
|
1
|
+
{"version":3,"sources":["../src/support.ts","../src/commands.ts"],"names":["snapshot","Cypress","Commands","add","name","config","cy","document","then","doc","manualSnapshot","get","snapshots","as","beforeEach","wrap","task","action","payload","allowedDomains","env","afterEach","automaticSnapshot","manualSnapshots","url","testTitlePath","spec","relativeToCommonRoot","currentTest","titlePath","domSnapshots","chromaticStorybookParams","diffThreshold","delay","diffIncludeAntiAliasing","forcedColors","pauseAnimationAtEnd","prefersReducedMotion","cropToViewport","pageUrl","viewport","height","width"],"mappings":"AAAA,OAASA,YAAAA,MAAgB,iBCAzB,OAASA,YAAAA,MAAgB,iBAGzBC,QAAQC,SAASC,IAAI,eAAiBC,GAAAA,CAE/BH,QAAQI,OAAO,gBAAA,GAIpBC,GAAGC,SAAQ,EAAGC,KAAMC,GAAAA,CAElB,IAAMC,EAAiBV,EAASS,CAAAA,EAEhCH,GAAGK,IAAI,kBAAA,EAEJH,KAAMI,GACE,IAAIA,EAAW,CAAER,KAAAA,EAAMJ,SAAUU,CAAe,EACzD,EACCG,GAAG,iBAAA,CACR,CAAA,CACF,CAAA,EDhBAC,WAAW,IAAA,CAEJb,QAAQI,OAAO,gBAAA,IAMpBC,GAAGS,KAAK,CAAA,CAAE,EAAEF,GAAG,iBAAA,EACfP,GAAGU,KAAK,kBAAmB,CACzBC,OAAQ,yBACRC,QAAS,CAAEC,eAAgBlB,QAAQmB,IAAI,cAAA,CAAgB,CACzD,CAAA,EACF,CAAA,EAEAC,UAAU,IAAA,CAEJpB,QAAQmB,IAAI,qBAAA,GAA0B,CAACnB,QAAQI,OAAO,gBAAA,GAI1DC,GAAGC,SAAQ,EAAGC,KAAMC,GAAAA,CAClB,IAAMa,EA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client-side lifecycle hooks will be added to the user's Cypress suite\nbeforeEach(() => {\n // don't take snapshots when running `cypress open`\n if (!Cypress.config('isTextTerminal')) {\n return;\n }\n // this \"manualSnapshots\" variable will be available before, during, and after the test,\n // then cleaned up before the next test is run\n // (see https://docs.cypress.io/guides/core-concepts/variables-and-aliases#Aliases)\n cy.wrap([]).as('manualSnapshots');\n cy.task('prepareArchives', {\n action: 'setup-network-listener',\n payload: { allowedDomains: Cypress.env('assetDomains') },\n });\n});\n\nafterEach(() => {\n // don't take snapshots when running `cypress open`\n if (Cypress.env('disableAutoSnapshot') || !Cypress.config('isTextTerminal')) {\n return;\n }\n // can we be sure this always fires after all the requests are back?\n cy.document().then((doc) => {\n const automaticSnapshot = snapshot(doc);\n // @ts-expect-error will fix when Cypress has its own package\n cy.get('@manualSnapshots').then((manualSnapshots = []) => {\n cy.url().then((url) => {\n // pass the snapshot to the server to write to disk\n cy.task('prepareArchives', {\n action: 'save-archives',\n payload: {\n // @ts-expect-error relativeToCommonRoot is on spec (but undocumented)\n testTitlePath: [Cypress.spec.relativeToCommonRoot, ...Cypress.currentTest.titlePath],\n domSnapshots: [...manualSnapshots, { snapshot: automaticSnapshot }],\n chromaticStorybookParams: {\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('delay') && { delay: Cypress.env('delay') }),\n ...(Cypress.env('diffIncludeAntiAliasing') && {\n diffIncludeAntiAliasing: Cypress.env('diffIncludeAntiAliasing'),\n }),\n ...(Cypress.env('diffThreshold') && { diffThreshold: Cypress.env('diffThreshold') }),\n ...(Cypress.env('forcedColors') && { forcedColors: Cypress.env('forcedColors') }),\n ...(Cypress.env('pauseAnimationAtEnd') && {\n pauseAnimationAtEnd: Cypress.env('pauseAnimationAtEnd'),\n }),\n ...(Cypress.env('prefersReducedMotion') && {\n prefersReducedMotion: Cypress.env('prefersReducedMotion'),\n }),\n ...(Cypress.env('cropToViewport') && {\n cropToViewport: Cypress.env('cropToViewport'),\n }),\n },\n pageUrl: url,\n viewport: {\n height: Cypress.config('viewportHeight'),\n width: Cypress.config('viewportWidth'),\n },\n },\n });\n });\n });\n });\n});\n","import { snapshot } from 'rrweb-snapshot';\nimport type { elementNode } from 'rrweb-snapshot';\n\nCypress.Commands.add('takeSnapshot', (name?: string) => {\n // don't take snapshots when running `cypress open`\n if (!Cypress.config('isTextTerminal')) {\n return;\n }\n\n cy.document().then((doc) => {\n // here, handle the source map\n const manualSnapshot = snapshot(doc);\n // reassign manualSnapshots so it includes this new snapshot\n cy.get('@manualSnapshots')\n // @ts-expect-error will fix when Cypress has its own package\n .then((snapshots: elementNode[]) => {\n return [...snapshots, { name, snapshot: manualSnapshot }];\n })\n .as('manualSnapshots');\n });\n});\n"]}
|