https://cypress.io logo
Adding API tests to existing UI tests
# i-need-help
s
Hello, I am trying to add my first API test to existing UI tests. My UI tests are in e2e folder and I added a new api folder for api tests. When I run cypress, the runner not picking up the api folder. I am not able to figure out the configuration for this. Can I please get some help here? This is my folder structure. Thanks.
g
Look at the
specPattern
option in https://on.cypress.io/configuration You can specify both
cypress/e2e
and
cypress/api
patterns there
b
@silly-student-97216 Looks like Gleb got to this question already, if you have any additional questions feel free to bring them to our event next month - https://discord.gg/cypress?event=1069675127182200903
s
Thank you Both. I will check it out.
Posting the solution for others. Thanks to @gray-kilobyte-89541 and other cypress community 🙂 Insert as per below into cypress.config. module.exports = { e2e: { specPattern: '**/*.cy.js', setupNodeEvents(on, config) {}, }, }
2 Views