Skip to content
The UI Testing Dilemma (and a Better Way Forward)
Api Testing·

The UI Testing Dilemma (and a Better Way Forward)

Ido Cohen
by Ido Cohen
The UI Testing Dilemma (and a Better Way Forward)

Teams scaling Playwright often hit the same wall—and there’s a practical way around it. Playwright at scale: why suites slow down

What starts fast and flexible can drag as the suite grows:

  • Standards drift across repositories, making reviews more challenging.

  • Debugging becomes detective work that eats hours.

  • Complex UI elements slip through coverage because they’re slow to automate well.

  • Keeping tests stable begins to consume as much time as adding new tests. Left unchecked, that becomes a bottleneck for releases.

    Why this is business-critical (not only technical)

  • Release velocity: slow or flaky checks delay features and hotfixes.

  • Cost: Parallelizing a large UI suite increases infra spend and triage time.

  • Developer time: engineers context-switch to chase flakes instead of shipping.

Quality risk: brittle checks miss defects or, worse, block good code. Engineering teams already utilize AI tools to accelerate development. QA needs the same lift- with a model that validates business logic where it actually lives: primarily in APIs/services, with UI focused on the user’s critical paths. **Note on “slow pipelines = just run in parallel”: parallelism helps, but UI tests remain heavier and more brittle per minute than API checks. Scaling parallelism increases cost and orchestration complexity, and doesn’t reduce the human time spent diagnosing UI flakes.

Loadmill + Playright: a Hybrid Model Loadmill integrates with Playwright to let teams keep UI where it matters and shift the rest to faster, stable API checks- without discarding the Playwright suite you already have.

What this looks like in practice

  • Run Playwright tests inside Loadmill, reusing the existing suite.

  • Blend UI and API in one flow. Example:

    1. Use Playwright to assert the login button and submit the form.

    2. Switch to API steps to validate the session and downstream business rules.

    3. Return to Playwright to confirm a post-login modal appears. One test, one report, less flake.

  • Sessions and data are shared automatically (cookies, tokens, parameters) between UI and API steps- no brittle harness code.

  • Unified reporting (HTML output, screenshots, video) across hybrid runs.

  • AI suggestions highlight flaky UI tests and propose API-based replacements when a browser isn’t needed.

  • PR-aware selection runs only the suites relevant to a code change (details below).

Execution control for stability: run Playwright via self-hosted Docker (or hosted) and size machines to your needs. Doesn’t Playwright already run in Docker? Yes. The value here is above the runner: hybrid authoring (UI+API), shared sessions, PR-aware selection, orchestration, and unified analytics—so the suite is faster to author, cheaper to run, and easier to trust. Authoring speed: You can record clicks to generate Playwright code inside Loadmill and toggle between UI and API capture in one pass to build hybrid tests quickly.

How PR-aware selection works (simple example)

  1. Label suites by feature/domain (e.g., tinder-plus, paywall, gender, ui, core).

  2. A PR lands touching files under /payments/paywall/*.

  3. Loadmill’s change analysis maps the diff → paywall, core labels.

  4. CI runs only those suites (including Playwright segments inside them).

  5. Developers get faster, focused feedback.

A migration plan testers can follow (no buzzwords)

  1. Triage the current suite

    • Mark each UI test as P0 (must be UI) or Candidate for API.

    • Typical P0s: accessibility/visual checks, browser/device-specific flows, core UX (signup, checkout).

  2. Convert candidates

    • Keep a thin UI step for the user action if needed; move business-rule checks to API.

    • Reuse Loadmill shared flows and test data across cases.

  3. Speed up CI

    • Add labels to suites, enable PR-aware selection, and cap “run everything” jobs to nightly.

  4. Stabilize execution

    • Pin Playwright runner images and right-size Docker (CPU/RAM/parallelism).

    • Track flake rate and MTTR in Loadmill reports; refactor high-flake tests to AP

Smarter Testing, Not Just More Testing

Modern test automation isn’t about “more tests.” It’s about applying the right kind of test to each layer of your product.

By combining Playwright and Loadmill’s strengths, teams can accelerate delivery, reduce failures, and cut back on test maintenance.

playright_test

Smarter Testing, Not Just More Testing

Modern automation isn’t about adding checks—it’s about putting each check at the right layer. With Playwright for the moments that must be seen and Loadmill for the business logic and scale, teams ship faster, cut costs, and trust their tests again.

Ready to get started with Loadmill?

Try our powerful testing platform and see the difference it makes.

BOOK A DEMO