question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support having tests in separate folders

See original GitHub issue

Current behavior:

Tests must all exist in the same folder.

Desired behavior:

I like to store tests in the folder of the component they are testing.

When running this command cypress run --browser chrome --spec app/components/**/*.cyp.js

I get the error:

Can't run because no spec files were found.
We searched for any files matching this glob pattern:
app/components/**/*.cyp.js

Versions

Cypress v3.0.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
Garrett-Rcommented, Sep 14, 2021

In case it helps anyone stumbling across this thread, here’s an example:

If you want to grab all tests from the src/pages and src/components directories that have .spec. in them, you could update your cypress.json to be:

{
  "integrationFolder": "./",
  "testFiles": "{./src/pages/**/*.spec.*,./src/components/**/*.spec.*}"
}

This seems to work well and the Cypress GUI is not slow to open.

4reactions
sebastianjungcommented, Aug 27, 2020

@jamie-kupka-acl can you try adding integrationFolder: './' to your cypress.json ?

This seems to make my cypress GUI load forever and longer.

Is there any way to add multiple folders to the ‘integrationFolder’ option?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run all test files from separate folders - jest
I am able to test each file using Jest, but I cannot figure out how to test multiple test files from separate folders....
Read more >
Writing and Organizing Tests
Configuring Folder Structure. While Cypress allows you to configure where your tests, fixtures, and support files are located, if you're starting your first ......
Read more >
why have a separate test folder ? : r/haskell
In separate files hspec will auto- discover your tests and run them all. This is preferred IMHO because it means you don't have...
Read more >
Should I separate unit tests and integration tests?
In general: yes, you should put integration tests and unit tests into different folders. Often, programmers don't draw a clear line between ...
Read more >
Multiple Folders for test cases
My project has two source trees for test classes -- one for integration tests and the other for unit tests.Should I happen to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found