ESProfiler Handbook
Front End

Testing

Unit Tests

As a standard practice we do not write unit tests for the front-end code, however there is a strict requirement for E2E tests to be written for all new features and bug fixes.

E2E Tests

Running E2E Tests

Local Development Environment

When running the E2E tests against your local development environment, where you are running the front-end server directly, you can run the E2E tests by running the following commands:

Run the web server:

yarn dev

Run the E2E tests:

yarn test:e2e:run-node-local

This will run all of the E2E tests against your local development environment.

If you want to run just a few tests, or see the tests explicitely running in a browser, you can open the E2E tests by running the following command:

yarn test:e2e:dev-node-local

Docker

To run all fo the E2E tests in a Docker container, run the following command:

yarn test:e2e:run

To run the E2E tests in a Docker container and see the tests explicitely running in Cypress for debugging, run the following command:

yarn test:e2e:dev

Writing E2E Tests

Defining Selectors

We use a couple of tools that require easy selection/searching of DOM node elements in our rendered content. We have a standard for tagging DOM elements with data- attributes to make node selection easier. These standards are also shared for DOM selection in PostHog, and the details can be found in hte Handbook here.

Copyright © 2026