Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to run a single Percy cypress test

I have a Nextjs project. My cypress folder has a few end to end tests:

cypress/e2e/test1 ... test10

How to run a single Percy Cypress test.

Below I have the script to run all tests test-visual and I am trying to set up a single percy test test-visual:single that runs just test1 but it runs all tests in the cypress folder

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  "scripts": {
    "cypress:run": "cypress run",
    "percy:cypress": "percy exec -- cypress run",
    "test-visual": "start-server-and-test 'npm run dev' http://localhost:3000 percy:cypress",
    "percy-cypress-single": "percy exec -- cypress run -- spec cypress/e2e/test1.cy.ts",
    "test-visual:single": "start-server-and-test 'npm run dev' http://localhost:3000 percy-cypress-single"
  },

What am I doing wrong?

>Solution :

You should just be able to pass any Cypress CLI parameters in the same way you do when not invoking via percy.

You seem to have a rogue space in your CLI script

"percy-cypress-single": "percy exec -- cypress run --spec cypress/e2e/test1.cy.ts",
-----------------------------------------------------^ No space here
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading