Skip to content

[Feature] Deterministic playwright tests across all machines and environments #28880

@younesjallouli

Description

@younesjallouli

Hello team,

I want first to thank you for the amazing work on playwright. It's really having a spring phase and becoming the leading tool in e2e automation.
However, there is still a big issue in the test development phase. I call this issue the spray and pray situation. it touches all kinds of teams, from startups to enterprises in my opinion:

A lot of times tests are not deterministic. Even if we try as teams to make them as deterministic as possible, by controlling the data in the app under test for example, or by setting the browser resolution ... There are still situations where tests will succeed on a tester's machine, but fail on the colleague's machine.
Oftentimes they fail because playwright could not find some locators (even if they are there), or screenshots that could differ between machines ... Chrome on macOS may behave differently from Chrome on Linux, etc.
This simply breaks the confidence in the tests: If I develop a feature, write a test and make it pass locally, there is always a probability that I will break another developer's workflow, because that test will fail for them.

(PS: Btw this spray and pray issue is exactly what that tools like dagger.io is trying to solve for the CI/CD world)

For local playwright tests, the solution to this kind of problem is to use containers to avoid these differences between environments, as many have tried in the past:

So far, even if testers have experimented this idea, NO one has really solved this problem, by running tests locally in docker across all team members, mainly because:
Major reason: Running tests in docker implies that playwright tooling won't work anymore. However, everybody wants to keep using playwright codegen, playwright inspector and the vscode extension during test development phase, these tools are too valuable.
Minor reason: Nobody wants to write install scripts that install XServer, Xquartz, VNC, or whatever tool depending on the user's machine (linux, macOS...) and handle this complexity in a dockerfile.

I think solving this problem will unlock a new level of testing and confidence for the industry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions