-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
"--spec" option does not run a single spec but runs all specs in ./integrations directory #1225
Comments
The We could probably throw an error here, to let you know that your spec argument did not match any files before proceeding to just run all of the specs. @bahmutov ? Keep your eye on this issue where we do intend to support glob arguments to the |
I think we should throw - when the user specifies single spec with --spec and we cannot find it something is wrong.
…Sent from my iPhone
On Jan 25, 2018, at 10:29, Jennifer Shehane ***@***.***> wrote:
The --spec flag does not accept a glob, you currently need to specify the exact path to the 1 spec file you wish to run. Since cypress/integration/**/*_spec.js does not match an exact file name, it will run all of your files.
We could probably throw an error here, to let you know that your spec argument did not match any files before proceeding to just run all of the specs. @bahmutov ?
Keep your eye on this issue where we do intend to support glob arguments to the --spec flag: #416
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jennifer-shehane @bahmutov this issue is no longer reproducible. |
@willischu K, thanks for the update, I'm going to leave this issue open for the purpose of delivering this feature:
|
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. |
I'm still having trouble here, on Windows. Most likely, it's my learning curve in using Node on Windows!
I've also tried the full path names, and about every other combo of paths, to no avail. Possibly any help? |
Sorry, I know this isn't StackOverflow... but thought I'd share my solution (indeed, it was me not knowing how to use Windows. I'm sure it's even simpler than this too!): |
@AaronRohrbacher Cypress should be looking for spec files relative to the |
Thanks @jennifer-shehane . I'm using the default integration folder, haven't found a solution easier than above thus far. |
I'm looking at the example for the
Cypress version is 3.1.0 |
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 ***@***.***> 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.
|
@bahmutov Aha! Thank you so much! |
For what it's worth, I had been so focused on "it has to be something about Windows," that I didn't realize I had been ignoring my package.json file in the repo. As soon as Cypress was installed correctly, |
|
@willischu
And still get the same behavior
This should be simple and if I am going to strugle with simple command then it is better to drop cypress all together :( |
@nadim1975 i ran the exact command you posted but using one of my specs and it ran a single spec, like expected. |
Maybe you have no other specs under the integration folder? |
@nadim1975 executed 2 specs separately. i have 8 specs in the |
I dont know what I'm doing wrong 🤔 |
@nadim1975 |
@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 |
@willischu 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 |
The only way I succeed to run a single test file was using : |
@ousmaneNdiaye To pass args to npm scripts, |
Current behavior:
Runs all tests in
./integration/
directoryDesired behavior:
Run single test when using
--spec
forcypress run
commandHow to reproduce:
run
cypress run --spec cypress/integration/**/*_spec.js
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: