Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypress Parallelisation Without Cypress Dashboard

Is there a way I could run parallel cypress executors without access to the cypress dashboard?

I'm trying to have cypress run my tests in parallel but it seems that you must have internet connectivity to reach the cypress dashboard to record the tests.

Anyone knows how I can get around this and have tests run in parallel without being dependent on Cypress Dashboard or a specific CI tool like Circle CI?

Thanks in advance!

like image 552
JohnD Avatar asked May 23 '20 14:05

JohnD


People also ask

How do you run Cypress tests in parallel without dashboard?

To use it, simply add parallel: 4 to the GitLab CI job, and then call node parallelCypress. js <some options> . It will then scan for tests and split them up to the available parallel jobs, then invoke cypress with the --spec option, so that each job only runs a part of the tests.

Can I run Cypress tests in parallel locally?

Cypress restricts running tests parallelly on a local machine. The framework was explicitly designed to do this, and multiple reasons for this can be found in the Cypress official docs. Cypress provides a Parallel Testing option by setting up multiple machines.

Can you run Cypress headless?

By default, cypress run will run all tests headlessly.

Is Cypress dashboard paid?

Cypress is a free, downloadable and open source (MIT license) application. This is always free to use. Our Dashboard Service is a web application that offers a variety of billing plans (including a free, open source plan) for when you want to record your test runs in CI.


2 Answers

Look at this free solution https://github.com/agoldis/sorry-cypress I use only director service in docker-compose to make tests run parallel , as a simple example:

version: '3.7'
networks:
  default:
    external:
      name: bridge

services:
  cypress:
    container_name: cypress
    build:
      context: ../
      dockerfile: ./docker/cy.Dockerfile
    links:
      - director
    ports:
      - '5555:5555'
    network_mode: bridge

  cypress2:
    container_name: cypress2
    build:
      context: ../
      dockerfile: ./docker/cy.Dockerfile
    links:
      - director
    ports:
      - '5556:5556'
    network_mode: bridge

  mongo:
    image: mongo:4.0
    network_mode: bridge
    ports:
      - 27017:27017

  director:
    image: agoldis/sorry-cypress-director:latest
    environment:
      MONGODB_URI: "mongodb://mongo:27017"
    network_mode: bridge
    ports:
      - 1234:1234
    depends_on:
      - mongo
like image 53
Floyd Rose Avatar answered Sep 28 '22 10:09

Floyd Rose


you can try this cypress-parallel-specs-locally

like image 27
Zhenëk Avatar answered Sep 28 '22 11:09

Zhenëk