Browser doesn't open due to Warning:Cypress could not verify that the server set as your 'baseUrl' is running: http://localhost:3000

See original GitHub issue

Is this a Feature or Bug? Not sure.

Current behavior:

Currently when i click on run all specs the chrome browser doesn’t open.

Desired behavior:

My tests do not run and browser isn’t opening when i click on run all specs button.

Steps to reproduce: (app code and test code)

i checked if its doing the ensureURL check but this is not happening and is not the cause of the error. I type in the command: yarn cypress:dev:mobile and the server is running, but then the test window in cypress opens and i see the warning:

Warning:Cypress could not verify that the server set as your 'baseUrl' is running: http://localhost:3000

At this point when i click on run all specs button, it tries to open chrome but it just keeps trying and it cant open it.

Versions

Cypress version 3.1 , Mac OS and . Chrome 71 version.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

15reactions
saas2813commented, Jun 28, 2019

I got the “Cypress failed to verify that your server is running:” problem and solved it when I realised that the /etc/hosts file did not include a line: 127.0.0.1 localhost Adding info here for Googlers, took me way too long to find it.

2reactions
s-gbzcommented, Jul 19, 2021

Just encountered the same error when using GitHub Action. The solution is to wait for the server to start. Use the wait-on parameter. I’m not sure if start is mandatory, but it’s listed in the examples so…

      - name: Run cypress e2e tests
        uses: cypress-io/github-action@v2
        with:
          start: npm run e2e
          browser: chrome
          headless: true
          wait-on: 'http://localhost:4200'

Here’s the complete workflow file for running the whole Angular test suite:

name: run-tests

on:
  pull_request:
    branches: [ master ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: Use Node.js 12.14
        uses: actions/setup-node@v1
        with:
          node-version: 12.14
          
      - name: Install dependencies
        run: npm install

      - name: Run headless unit tests
        run: npm run test-headless

      - name: Run cypress e2e tests
        uses: cypress-io/github-action@v2
        with:
          start: npm run e2e
          browser: chrome
          headless: true
          wait-on: 'http://localhost:4200'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress could not verify that the server set as your 'baseUrl ...
I got the "Cypress failed to verify that your server is running" problem despite being able to access the site through a browser....
Read more >
cypress-io/cypress - Gitter
... this error: Browser doesn't open due to Warning:Cypress could not verify that the server set as your 'baseUrl' is running: http://localhost:3000 ....
Read more >
Troubleshooting
If Cypress cannot find a browser but you know you have it installed, there are ways to ensure that Cypress can "see" it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found