Running shell scripts in plugins file for particular spec on cypress run and cypress open #21580
Unanswered
shubham-lagshetti-zz
asked this question in
Questions and Help
Replies: 1 comment 1 reply
-
specific spec file event on execution of test : not sure what this means You want per spec file script execution capability? cy.exec might be what you need https://docs.cypress.io/api/commands/exec. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
questions- Can we write plugins in such way that they can run for only particular spec file not just for all tests on cypress run and cypress open commands?
-note : i am new to the cypress still learning things.
In my project i am trying to do some event creation and deletion and validation after a particular spec file execution.
current what i did i write the shell script in plugins/index.js file as below"
`module.export=(on,config)=>{
on('before:spec',(spec)=>{
//shell scripts
}
on('after:spec',(spec)=>{
//shell script
}
}
`
**this is what i am currently did but the shell script is running for every spec file on npx cypress run command i dont want that i want it to run for specific spec file event on execution of test via cypress runnner
looking for solution.**
Beta Was this translation helpful? Give feedback.
All reactions