Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to exclude spec files from test runs in cypress

I want to be able to exclude particular spec files from my test runs in cypress. I guess this will be some config entered into the cypress.config.ts file. All I have found is the ‘excludeSpecPattern’ argument but this seems to be to exclude file patterns, not specific files/folders.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can use excludeSpecPattern and define exact folders or files.

excludeSpecPattern: [
    '*/*/**/spec.cy.ts',
    '*/**/FolderToExclude'
],

If this doesn’t work, then the defined path is wrong. Maybe this link will be helpful:

https://docs.cypress.io/guides/references/configuration#excludeSpecPattern

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading