Skip to content

serializeDOM should capture resources when running without local percy server #1156

Description

@yjaaidi

The problem

serializeDOM doesn't capture resources (images/styles).

Environment

  • Node version: 18.12.1
  • @percy/cli version: 1.16.0
  • Version of Percy SDK you’re using: 1.16.0
  • If needed, a build or snapshot ID: 23596652

Details

I am trying SDK utils' serializeDOM in 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-utils with ES6 import, it is not capturing the resources (images/styles)... and using @percy/sdk-utils like @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-e2e

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions