I am using create-react-app and I am running my development webpack server in https. So running npm run cypress:open, I would expect

  1. My application to run in https://localhost:3000
  2. Once the server is up, the cypress launcher to run on it.

Only the first step happens, cypress launcher is not opening up.

This is my scripts config in package.json.

 "scripts": {
        "watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
        "start-js": "export HTTPS=true&&react-scripts start",
        "start": "npm-run-all -p watch-css start-js",
        "cy:open": "cypress open",
        "cypress:open": "start-server-and-test start http-get://localhost:3000 cy:open"
    }

I am facing this issue only for https, not http.

1 Answers

0
Zach Bloomquist On

You're using http-get, but you probably need to use https-get since you're using HTTPS, not HTTP.

In your package.json, it should look like this:

{
  "scripts": {
    "cypress:open": "start-server-and-test start https-get://localhost:3000 cy:open"
  }
}

You can check out the wait-on usage docs for more info (start-server-and-test is based on wait-on)