Docker helps teams make Playwright execution more consistent by packaging the browser, system dependencies, and test environment into a versioned container image.
That is useful in CI, where each job may otherwise start from a clean runner and reinstall the same dependencies. But it also means the team now owns another layer: building, updating, storing, scaling, and troubleshooting the container environment.
Leapwork Play simplifies that part of the workflow by providing the cloud browser execution environment. You can run a test case or RunList in Play without creating and maintaining a Docker environment just to execute the browser tests.
How to use Docker with Playwright
Use Docker to make Playwright test execution more predictable across local, CI and cloud environments.
-
Start with the local problem. A Playwright test may pass locally because the required browsers and system dependencies are already installed.
-
Recreate that setup for CI. In CI or another cloud environment, the same browser and dependency setup has to be available for every run.
-
Run tests from a versioned Docker image. The image packages the browser, system dependencies and test runtime so each runner starts from the same baseline.
-
Use the same image for parallel execution. This is especially useful for shards or matrix jobs, where every worker should execute against the same setup.
Where does Docker add overhead?
How does Play simplify the browser execution environment?
With Leapwork Play, you do not need to create a Docker workflow simply to provide a browser runtime for the test.
Play provides the cloud browser execution environment directly.
The workflow becomes:
-
Create or record the test case in Play.
-
Add test cases to a RunList when you want to execute them together.
-
Start the test or RunList.
-
Play provides the runtime when execution starts.
-
Review the execution results in Play.
You do not need to configure a separate runner or install the browser as part of a Docker workflow just to execute the Play test.
How Play extends the Playwright execution workflow
|
With Playwright and Docker |
With Leapwork Play |
|---|---|
|
Build and maintain the browser container |
Play provides the cloud browser runtime |
|
Keep browser and system dependencies in the image |
Browser execution environment is handled by Play |
|
Configure the runner to execute the container |
Run a test case or RunList through Play |
|
Scale containers and CI workers as required |
Use Play's managed execution workflow |
|
Preserve and process test artifacts separately |
Review execution results through Play |
|
QA team maintains tests and runtime configuration |
QA team can focus more directly on the test workflow |
Play keeps Playwright underneath while reducing the infrastructure the QA team needs to maintain around browser execution.
How-to: choose the right approach
Use this quick decision flow to choose between Playwright with Docker and Leapwork Play.
-
Identify who should own the runtime.
-
Choose Playwright with Docker when your team needs direct control over the container image, dependencies, runner configuration, and CI infrastructure.
-
Choose Leapwork Play when you want to run Playwright tests while the platform manages the browser execution environment.
-
-
Check your operating model.
-
Use Docker if you are comfortable maintaining the image and CI pipeline.
-
Use Leapwork Play if you prefer a managed cloud browser runtime.
-
Compare runtime ownership:
Playwright + Docker
Tests → Docker image → Runner → Browser → Results
Leapwork Play
Tests → RunList → Play cloud browser → Results
Decision rule: both approaches execute browser automation; choose based on who should own and maintain the runtime around it.
How to use Play for day-to-day QA work
Use Play to reduce the environment setup a QA engineer needs to handle before running a test.
-
Run browser tests without setting up Docker separately.
-
Avoid maintaining browser installation steps in a CI container for Play execution.
-
Execute test cases individually or through RunLists.
-
Onboard new team members without requiring them to understand the container setup first.
-
Keep execution results inside the Play workflow.
-
Feed RunList execution into Play's reporting workflow.
This keeps the focus on the test case, test data, and expected application behaviour rather than the container around them.
Best practices
-
Use Play's cloud browser when you want to avoid maintaining a Docker environment purely for Playwright browser execution.
-
If you use Docker, pin and version the execution image.
-
Keep the same image and dependency versions across CI workers where consistency matters.
-
Update container images deliberately rather than allowing runtime changes to happen unexpectedly.
-
Keep parallel tests independent when scaling across containers or Play executions.
-
Separate test failures from infrastructure failures when troubleshooting.
-
Choose the execution model based on how much runtime infrastructure your team wants to own.
Troubleshooting
|
Problem |
What to check |
|---|---|
|
Tests behave differently between CI workers |
Check that they use the same container image and dependency versions |
|
Docker image becomes difficult to maintain |
Review browser, system dependency, and image update requirements |
|
Parallel containers behave differently |
Check for image drift and shared test state |
|
CI spends significant time preparing the browser environment |
Review whether the environment can be prebuilt or whether managed execution is more appropriate |
|
Play test execution fails |
Investigate the test and its Play execution results rather than maintaining a separate Docker runtime |
Frequently asked questions
Why use Docker with Playwright?
Docker packages the browser and required dependencies into a repeatable environment, which can make Playwright execution more consistent across CI and cloud runners.
Do I need Docker to run Playwright?
Not necessarily. Docker is one way to provide a controlled execution environment. The appropriate setup depends on where and how your tests run.
Does Leapwork Play require Docker to run Playwright tests?
Not for the Play cloud browser workflow described here. Play provides the browser execution environment, so the QA team does not need to create a Docker setup simply to execute the test.
Can I run multiple tests through Play?
Yes. Tests can be executed individually or grouped in a RunList for execution through Play.
Is Play replacing Playwright or Docker?
No. Playwright remains the underlying browser automation technology. Docker is an infrastructure choice for packaging an execution environment. Play adds a managed execution workflow around Playwright so teams that do not want to own that runtime layer can use the platform-managed environment.
When should I use Play instead of maintaining a Docker runtime?
Use the Play-managed execution approach when the goal is to reduce the browser-runtime infrastructure your QA team needs to configure and maintain while continuing to work with Playwright-based tests.