1

In my cypress.json I have baseUrl configured as

{
  "baseUrl": "http://localhost:3000"
}

The package.json contains

"scripts": {
    "cy:version": "cypress version",
    "cy:verify": "cypress verify",
    "cy:run": "CYPRESS_baseUrl=http://localhost:3000 cypress run --record --browser chrome",
    "start": "serve --listen ${PORT:-3000}"
  }

And in semaphore.yml I have these lines

jobs:
  -name: Execute E2E
   commands:
     - npm start & wait-on http://localhost:3000
     - npm run cy:run

But for some reason the application doesn't get serve on localhost:3000 and instead I see this

cypress serve

How can I fix this and serve the application on localhost:3000? Thanks.

muskrat_
  • 101
  • 7

2 Answers2

0

You can do a couple of things to debug the problem:

  1. Are you using a proxy somewhere, maybe as env variable ..?
  2. Check the Cypress proxy settings and see if there is something there.
  3. Try to change the port to something else. Use a port that you know for sure that its not used by anything else. You can check that with netstat command.
  4. Is your localhost running on http or is it https instead?

If i think of something else, ill update the answer.

Telperien
  • 1
  • 1
0

You need to build the app before serve some application, basically you don't have any index.html file