I am using create-react-app for my building my application and I am using cypress for automation.
"scripts": {
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"cy:run": "cypress run ,
"cypress:all": "start-server-and-test start http-get://localhost:3000 cy:run"
}
In order to run the test, firstly I need to boot up my application using npm start
and then I can run command npm run cy:run -- --record --key <record-key>
.
Instead what I am doing is run the command npm run cypress:all
which will call npm start
and once server is up and running it runs tests on it.
But how do I pass the record flag for this command? npm run cypress:all -- --record <record-key>
doesn't work here.