The Simplest Way to Make Drone and Playwright Work Like They Should
Teams use drone and playwright together to run automated browser tests inside clean containers. Drone builds your app on every commit, and Playwright checks each page in real browsers. This workflow catches broken screens before bad changes reach your live users. Because Drone runs every pipeline step inside isolated containers, browser tests get a fresh start. You do not need to manage long-lived test servers by hand. How drone and playwright handle logins, roles, and data To make drone and
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams use drone and playwright together to run automated browser tests inside clean containers. Drone builds your app on every commit, and Playwright checks each page in real browsers.
This workflow catches broken screens before bad changes reach your live users. Because Drone runs every pipeline step inside isolated containers, browser tests get a fresh start. You do not need to manage long-lived test servers by hand.
How drone and playwright handle logins, roles, and data
To make drone and playwright work well, both tools must share a network. In a Drone pipeline, your web app often runs as a background service container. The Playwright test step then starts in its own container on that same network. Playwright sends web requests to the app container using its step name as the host.
First, the pipeline must wait until the web app is ready to take requests. If Playwright starts too soon, the browser hits a dead port and fails. A simple check step can poll the app port before the browser tests begin.
Next, the test runner needs valid login details to check protected pages in your app. Teams store test user keys and tokens inside the Drone secret store. Drone passes these secrets into the Playwright container only when the test step starts. Playwright reads these values, logs in once, and saves the browser state to a local file. Later tests reuse that saved login state so they run much faster.
Finally, the browser container needs the right system libraries and browser binaries already installed. Pulling browser files on every single build wastes time and network bandwidth. Using a ready-made container image with pre-installed browsers keeps pipeline runs fast and stable.
Common failure modes and how to scope access
A common mistake is using one shared admin account for all browser test runs. When two builds run at once, one test can log out or break the other. Instead, have each pipeline run create its own temporary test user in a local database. When the build ends, Drone deletes the temporary containers and wipes all test data.
Right to Erasure Implementation: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Another risk is giving the Drone runner broad tokens that can touch live servers. If a pull request changes the test script, it could read or leak live keys. Scope your secrets so pull request builds only get keys for isolated test databases. Give each test account the smallest role needed to check that specific page.
Unlogged test runs also slow teams down when a browser check fails in the pipeline. Inside a headless container, you cannot watch the screen to see why a button failed. Set up Playwright to save trace files and screenshots to the shared workspace folder. Then add a final pipeline step that uploads those saved files to your storage bucket. Make sure that upload step uses a scoped key that can only write to one folder.
Also watch out for memory limits inside your container runner during heavy browser runs. Real browsers use a lot of memory when running many tabs at the same time. Limit the number of parallel test workers so the container does not crash mid-run. Keeping container roles tight and resource limits clear makes every test run predictable.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Why do my Playwright tests fail to find the app in Drone?
Your tests might use localhost instead of the Drone service step name. Point Playwright to the exact name of the step running your web server. Also add a short wait loop so the server boots before tests start.
How can I view Playwright test reports from a Drone build?
Drone cleans up container files as soon as the pipeline run finishes. Add a pipeline step that runs even when tests fail to copy report files out. Send those files to object storage using a write-only role scoped to test logs.
Should I install browsers during the Drone pipeline run?
No, downloading browsers during a build takes too long and can fail on slow networks. Use a base container image that already includes the Playwright browsers and operating system libraries. Keep the image version matched to the Playwright package version in your project.
Related guides
In this post