Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
Run only spec files in cypress

I have my folder structure like this within integration folder, I have Page Object folder, where I have two js files i.e. LoginPage.js and SignUpPage.js and outside of that PageObject folder, I have spec files i.e. LoginTestCases.spec.js and SignUpTestCases.spec.js

While running :

npx cypress open

It ran all js files present within Integration folder, but I want to run spec files only and i want to see only those files on my TestRunner as well.

I know that we do some little change in cypress.json file, but Don't remember at all. Can anyone help me out, here?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In your cypress.json file, add the list of spec files you want to run under testFiles array, something like this. And this will only execute the spec files that you have mentioned and also in the order you have mentioned.

If your spec files are inside integration folder

"testFiles": [
  "LoginTestCases.spec.js",
  "SignUpTestCases.spec.js"
]

If the spec files are somewhere else, then you have to give the absolute path.

"testFiles": [
  "path to TC/LoginTestCases.spec.js",
  "path to TC/SignUpTestCases.spec.js"
]

In case you want to just get only the .spec.js files and you have a lot of files, you can use the wild card using:

"testFiles": ["*.spec.js"]
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!