Sorry-Cypress: It’s not me, It’s you

Gili Yaniv
3 min readAug 12, 2023

Sorry-cypress is an open-source alternative to the Cypress Dashboard for recording, managing, and analyzing your Cypress test runs. It allows you to set up your own test dashboard for your Cypress test suite.
In the following article I want to share with you we switched from working with Cypress Cloud to Sorry-Cypress.

Before we dive in, Here are some factors to consider when comparing “Sorry Cypress” and “Cypress Cloud”:

  1. Open Source vs. Commercial:
  • “Sorry Cypress” is an open-source solution that you can self-host. This gives you control over your testing infrastructure and allows you to customize it according to your needs.
  • “Cypress Cloud” is a commercial service provided by the creators of Cypress. It’s a paid solution (And expensive in my opinion, More on that in section 4.) that offers a managed testing platform, which can save you the effort of setting up and maintaining your own infrastructure.

2. Control and Customization:

  • With “Sorry Cypress,” you have more control over the testing environment, infrastructure, and data. You can host it on your own servers, behind your firewall, and customize it to your specific requirements.
  • “Cypress Cloud” abstracts away the infrastructure management, offering a more streamlined experience, but you might have less control over certain aspects of the setup.

3. Ease of Setup and Maintenance:

  • “Cypress Cloud” aims to simplify the setup and maintenance process by providing a managed cloud platform. This can be advantageous if you’re looking for a hassle-free way to run your tests.
  • “Sorry Cypress” might require more setup and maintenance effort, as you need to host and manage the infrastructure yourself.

4. Cost Considerations:

  • “Sorry Cypress” being open-source and self-hosted could potentially be more cost-effective if you already have the necessary infrastructure and expertise to manage it.
  • “Cypress Cloud” involves a subscription fee, which might be justified by the convenience it offers and the reduction in infrastructure management overhead. This factor was the main cause for switching to Cypress Cloud. We were 2 Front-End developers with massive test infrastructure and billed around 1000$ a month.

5. Integration and Features:

  • Both solutions offer integration with popular CI/CD tools and provide features for parallel test execution, video recording, and more.

6. Scalability:

  • “Cypress Cloud” might offer seamless scalability since it’s a managed service designed to handle a wide range of testing needs.
  • With “Sorry Cypress,” you’ll need to ensure that your self-hosted infrastructure can handle your desired scale.

To implement Sorry-cypress, you’ll need to follow these general steps:

  1. Prerequisites:
  • Make sure you have Node.js and npm (Node Package Manager) installed on your system.

2. Setup a Backend Server:

  • First, you need to set up a backend server for Sorry-cypress. You can use Express.js, Koa, or any other Node.js framework.
  • Initialize a new Node.js project in the server directory:
mkdir sorry-cypress-server
cd sorry-cypress-server
npm init -y
  • Install required packages:
npm install sorry-cypress express
  • Create an Express.js server that serves as the backend for Sorry-cypress. You’ll need to configure endpoints for test run data and other functionalities. An example server.js could look like this:
const express = require('express');
const app = express();
const { createProxyMiddleware } = require('http-proxy-middleware');

// Proxy requests to the Sorry-cypress API server
app.use('/api', createProxyMiddleware({
target: 'https://api.sorry-cypress.dev',
changeOrigin: true,
}));

// Other custom routes or configurations

const port = process.env.PORT || 4000;
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});

3. Configure Sorry-cypress:

  • Create a sorry-cypress.json configuration file in your project's root directory with the following contents:
{
"projectId": "<your_project_id>",
"dashboardUrl": "http://localhost:4000"
}

4. Install and Run Sorry-cypress CLI:

  • Install the Sorry-cypress CLI globally:
npm install -g sorry-cypress-cli
  • Initialize the configuration for the Sorry-cypress CLI:
sorry-cypress init
  • Run the Sorry-cypress daemon to capture and send test results to your backend server:
sorry-cypress run --config path/to/your/sorry-cypress.json

5. View Test Results:

  • Visit http://localhost:4000 in your web browser to access the Sorry-cypress dashboard and view your test results.

Remember that this is just a basic setup guide. You might need to customize and adapt the implementation based on your specific project requirements and infrastructure.

Additionally, you might want to consider using Docker to containerize your Sorry-cypress setup, enabling easier deployment and scaling. Make sure to refer to the official documentation and GitHub repository for any updates or changes beyond my last training data in September 2021.

Want to read more about Cypress? Check out Improving End-to-End Testing with Cypress.io: Tips and Best Practices

Follow me on Medium or Linkedin to read more!

--

--