cypress: "--spec" option does not run a single spec but runs all specs in ./integrations directory

Current behavior:

Runs all tests in ./integration/ directory

Desired behavior:

Run single test when using --spec for cypress run command

How to reproduce:

run cypress run --spec cypress/integration/**/*_spec.js

Additional Info (images, stack traces, etc)

screen shot 2018-01-24 at 5 41 34 pm
  • Operating System: Mac OS X
  • Cypress Version: 1.4.1
  • Browser Version: Chrome 63, Electron 53

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 26 (7 by maintainers)

Most upvoted comments

The code for this is done, but this has yet to be released. We’ll update this issue and reference the changelog when it’s released.

@willischu Finally it worked …thank you so much for your help. the problem was running the command from Windows powerShell , instead I used Windows CMD and it worked !

One more challenge: when I run --headed I still don’t see any browser launched , I thought with --headed it will run the script on the browser and I can actually see what it does.

after it finish it generates a video recording but the video has nothing

@nadim1975 well it looks like the ‘–spec’ argument isn’t even being passed when you run that full command. i’m not sure if it’s a Windows thing but on my terminal, the output i get after running that command is cypress run "--spec" "cypress/integration/*_spec.js"

It is “npm run cypress:run — —spec …” syntax to pass arguments to npm script

Sent from my iPhone

On Aug 23, 2018, at 18:10, Angela Riggs notifications@github.com wrote:

I’m looking at the example for the spec parameter, which is cypress run --spec ‘cypress/integration/examples/actions.spec.js’. From the root of my project, I’m running npm run cypress:run --spec ‘cypress/integration/find-trip-desktop.spec.js’, and it’s still running all tests in the integration folder. My directory setup is:

project |_ cypress |_ integration |_ find-trip-desktop.spec.js |_ find-trip-mobile.spec.js
|_ cypress.json Cypress version is 3.1.0 Node version is 10.5.0 Npm version is 6.1.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.