admin管理员组

文章数量:1289508

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.

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.

Share Improve this question edited Dec 7, 2023 at 2:01 Penny Liu 17.5k5 gold badges86 silver badges108 bronze badges asked Oct 4, 2022 at 9:23 Eoin CorrEoin Corr 851 gold badge3 silver badges9 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

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

本文标签: javascriptHow to exclude spec files from test runs in cypressStack Overflow