Monorepo with multiple apps usage - allow passing of `projects` array to `cypress run`
See original GitHub issueSay I have a monorepo with multiple apps which share libs. If i modify a shared lib and want to test if my apps pass the tests, what is the best approach?
- packages
- app-1
- cypress
- app-2
- cypress
- shared-library-1
- shared-library-2
- Can I have cypress search for multiple
integrationFolders
so that a single test run will test all my apps? - Maybe I could use a
cypress
dir in the monorepo root, then have symlinks to the differentcypress/integration
folders in each app in the monorepo?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Utilizing Cypress Testing in a Multi-App Monorepo
Getting it set up for an app is pretty straightforward, and you can be off and writing tests in a matter of minutes....
Read more >Running Cypress tests in a monorepo - Jonathan Creamer
Cypress is a fantastic testing tool for running your applications in a browser like environment. It's reminiscent of Selenium, but runs quicker ...
Read more >Drastically Simplify Testing on CI with Cypress GitHub Action
Here is an example GH Action workflow that splits entire test load across 3 machines using strategy > matrix > machines: [1, 2,...
Read more >A Complete Guide to Running a Full-Stack Angular ...
The monorepo strategy follows the approach (as in the following image) where we can have multiple projects in a single repository. This strategy ......
Read more >@cypress/github-action - npm
Start using @cypress/github-action in your project by running `npm i ... Use specific config file; Run tests in parallel; Build app before running...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vjpr @jennifer-shehane This isn’t complete workaround because it won’t handle the case where tests have different support files, fixtures, or different configurations in
cypress.json
.Can we re-open this issue?
We also use a monorepo at Airbnb, that looks something like:
You can symlink all the integration tests but that will still break on any test with its own fixture files or custom commands in the
support
directory. We also use mutually exclusive support commands, some teams choose to convert fetch to XHR, while others don’t.Right now, we invoke Cypress multiple times for a project in CI, and this comes with unexpected problems, eg. xvfb exitting non-zero (that could be fixed by https://github.com/cypress-io/cypress-docker-images/issues/54#issuecomment-487060555).
It would be great if cypress run + open supported projects by allowing you to pass in multiple directories that contained their own
cypress.json
files – this is similar to Jest’s projects:See: https://jestjs.io/docs/en/configuration#projects-arraystring--projectconfig
That way, in the root
cypress.json
we could specify the projects that we want to invoke cypress for like this:And then when invoking cypress at the root of a monorepo, we can run all projects, or pick specific ones by using a flag to override the config like:
--projects frontend/projectA
.@sharmilajesupaul I would make sure to express your issue in the https://github.com/cypress-io/cypress-docker-images/issues/54 issue, as commenting / expressing how this is a blocker definitely helps when prioritizing which things we work on.
Passing a
projects
flag is not a bad idea. It will not be as simple to implement as expected though. I will reopen this issue with the intent being to allow running multiple projects from a singlecypress run
command, but this would not be very high priority for us at the moment unfortunately.