Closed grantspilsbury closed 6 months ago
I am using Percy and Cypress to run visual tests on my Nextjs app.
To run a single spec I add this to the script of my package.json eg
"scripts": { "test-visual:single": "start-server-and-test 'npm run dev' http://localhost:3000 'percy exec -- cypress run --spec /path/to/test.cy.ts'", },
I want the user to enter the path of the test spec (/path/to/test.cy.ts). What's the right way to do this?
/path/to/test.cy.ts
I have tried to use $PATH
$PATH=/path/to/test.cy.ts npm run test-visual:single
"test-visual:single": "start-server-and-test 'npm run dev' http://localhost:3000 'percy exec -- cypress run --spec $PATH'",
I have also tried: npm run test-visual:single /path/to/test.cy.ts
npm run test-visual:single /path/to/test.cy.ts
"scripts": { "test-visual:single": "start-server-and-test 'npm run dev' http://localhost:3000 'percy exec -- cypress run --spec $1'", },
with no luck
@grantspilsbury
I guess you solved this yourself!? There is an active technical user community on Discord for Cypress
(click on button)
if you need any help in future about Cypress "how-to" issues.
@grantspilsbury I guess you solved this yourself!? There is an active technical user community on Discord for Cypress (click on button) if you need any help in future about Cypress "how-to" issues.
Thanks Mike. I figured it wasn't really a start-server-and-test issue so I closed it
I am using Percy and Cypress to run visual tests on my Nextjs app.
To run a single spec I add this to the script of my package.json eg
I want the user to enter the path of the test spec (
/path/to/test.cy.ts
). What's the right way to do this?I have tried to use $PATH
$PATH=/path/to/test.cy.ts npm run test-visual:single
"test-visual:single": "start-server-and-test 'npm run dev' http://localhost:3000 'percy exec -- cypress run --spec $PATH'",
I have also tried:
npm run test-visual:single /path/to/test.cy.ts
with no luck