Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cy.percySnapshot() crash Cypress if percy is not running #320

Closed
MarosPistej opened this issue Apr 13, 2021 · 1 comment
Closed

cy.percySnapshot() crash Cypress if percy is not running #320

MarosPistej opened this issue Apr 13, 2021 · 1 comment

Comments

@MarosPistej
Copy link

MarosPistej commented Apr 13, 2021

Issue

If integration file contain cy.percySnapshot() but you are trying to run only Cypress (you are writing tests and don't want send snapshots to percy yet), when test reach cy.percySnapshot() it crash with unresolved Promise. Whole error in screenshot bellow.

image

Replication

  1. build example project from https://github.com/percy/example-percy-cypress
  2. modify package.json to start and open Cypress without percy cypress open instead of percy exec -- cypress open
"scripts": {
    "percy:cypress": "cypress open",
    "start:server": "serve -l 8000 .",
    "test": "start-server-and-test start:server 8000 percy:cypress"
  },
  1. run npm test
  2. in Cypress window select todo.spec.js to begin test
  3. when Cypress reach cy.percySnapshot()at line 9 it crash
    image

Known workaround

modify cypress/support/index.js file and include code bellow

import { isPercyEnabled } from "@percy/sdk-utils";
isPercyEnabled();

or

downgrade Cypress to version 6.4.0

Connections

seems to be related to #315 and cypress-io/cypress#15101

@Robdel12
Copy link
Contributor

Hey @MarosPistej Thanks for the issue! This is related to #315 & unfortunately external to Percy. I'll close this since it's a dupe of #315

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants