Run scripts on a VM before or after a test
On Windows machines, if you need to run scripts on a VM before or after running Cypress tests, perform the following configuration steps:
-
In the
perfecto-config.json
file, add a new option calledrunScripts
that can contain any of the following:-
A before key, where the value is the name of the script that should be run before Cypress tests
-
An after key, where the value is the name of the script that should be run after Cypress tests
-
-
In the
package.json
file, add ascripts
object. For more information, see the documentation.The key name must match the script name that is defined in the
perfecto-config.json
file.CopySample code
"scripts": {
"test": "echo this script will run before cypress tests",
"endtest": "echo this script will run after cypress tests"
},