Skip to main content

Docker

Serenity/JS Docker images enable you to run Serenity/JS tests in containerised environments, including CI/CD pipelines, cloud development environments, and local development setups. The images are maintained in the serenity-js/serenity-js-docker repository and published through the Serenity/JS GitHub Container Registry.

Using Serenity/JS Docker Images​

Learn how to integrate Serenity/JS Docker images with your workflow:

Available Images​

Serenity/JS Playwright image​

Recommended for: Playwright Test, Cucumber.js with Playwright, and WebdriverIO projects using modern browsers.

The Serenity/JS Playwright Docker image provides a complete testing environment with all Playwright browser engines, plus the latest stable Chrome and Edge browsers. Image versions follow Playwright's versioning convention to ensure compatibility.

Install from the command line

📦 View all versions

What's Included​

Browsers:

  • Microsoft Edge (Stable)
  • Google Chrome (Stable)
  • Playwright Chromium Engine
  • Playwright Chromium Headless Shell
  • Playwright Firefox Engine
  • Playwright WebKit Engine

Runtimes:

  • Node.js 24
  • OpenJDK Java Runtime Environment

Operating System:

  • Ubuntu 24.04 LTS (Noble Numbat)
  • Git
  • cURL
  • OpenSSH Client
  • Playwright system dependencies

Extending Serenity/JS Docker images​

Serenity/JS base images are ready for immediate use, but there are many situations where layering your own image provides more control. Common needs include installing system tools, adding language runtimes, embedding corporate CA certificates, or adjusting environment-level settings for browsers, Node.js, or the JVM.

Creating a Custom Image​

Start by using an official Serenity/JS image as your base. This preserves the full testing toolchain—browsers, drivers, system dependencies, and Serenity/JS reporting—while giving you space to tailor the environment.

Dockerfile

Adding Custom CA Certificates​

Teams using Serenity/JS often run tests against internal services protected by certificates signed by private Certificate Authorities (CAs). Without installing those CAs, TLS requests from your test suite may fail. Extending the base image ensures both the OS and Node.js trust your internal CA.

Example: Embedding and Trusting Corporate CA Certificates​

Dockerfile

Things to Watch Out For​
  • Certificate Rotation: If you rotate or add new CA certs, you’ll need to rebuild and redeploy the image.
  • Credential Management: Be careful not to bake in sensitive private keys or credentials unless the image is stored in a secure (private) registry.
  • User Permissions: Serenity/JS images run under a non-root serenity-js user by default. When installing packages or updating certificates, switch to root temporarily and revert afterwards to maintain secure defaults.

Building and publishing your custom image​

To build and publish your Docker image, follow the instructions from your artifact registry vendor: