Replies: 3 comments 2 replies
-
|
Hey @yjaaidi 👋 have you checked this? import { createRequire } from 'module';
export const PERCY_DOM = createRequire(import.meta.url).resolve('@percy/dom');we do something similar here Line 9 in 5f86910 This way you'll only require |
Beta Was this translation helpful? Give feedback.
-
|
Hi @itsjwala, thank you for the quick response. |
Beta Was this translation helpful? Give feedback.
-
|
Okay there seems to be some misunderstanding here, you can learn more here https://docs.percy.io/docs/debugging-sdks#how-percy-works |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The problem
serializeDOMdoesn't capture resources (images/styles).Environment
@percy/cliversion: 1.16.0Details
I am trying SDK utils'
serializeDOMin Cypress in order to capture the DOM snapshots and store them locally and upload them later. The problem I am encountering is that this only works if I use@percy/cypress. When using@percy/sdk-utilswith ES6 import, it is not capturing the resources (images/styles)... and using@percy/sdk-utilslike @percy/cypress`, it requires a local Percy server which kind of defeats the purpose as it creates a new build on Percy, but still doesn't capture the resources.The main thing I am trying to achieve here is that by using tools like Nx, we can speed up the CI by caching tasks output and only run Cypress tests when needed. While this is possible for branches/PRs because we can run them in partial mode. The main branch needs all snapshots. This would mean running all tests which would be easily avoided if we could separate the "snapshot" and the "upload" phase.
Code to reproduce issue
Cf. https://github.com/marmicode/marmicode/blob/spike/split-percy-snapshot-and-upload/libs/testing/src/cypress-commands.ts
You can reproduce by running
yarn && yarn nx e2e marmicode-e2eBeta Was this translation helpful? Give feedback.
All reactions