The Simplest Way to Make Bitbucket and Cypress Work Like They Should
Using bitbucket and cypress together lets teams run browser tests on every code change. When a coder pushes code, the pipeline spins up an app and runs checks. This workflow catches bugs before bad code reaches the main branch. Teams get fast feedback on pull requests and keep their web apps stable. How bitbucket and cypress share data and permissions The pipeline starts when a coder opens a pull request or pushes a commit. Bitbucket reads the pipeline file and starts a fresh Linux container
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.
Using bitbucket and cypress together lets teams run browser tests on every code change. When a coder pushes code, the pipeline spins up an app and runs checks.
This workflow catches bugs before bad code reaches the main branch. Teams get fast feedback on pull requests and keep their web apps stable.
How bitbucket and cypress share data and permissions
The pipeline starts when a coder opens a pull request or pushes a commit. Bitbucket reads the pipeline file and starts a fresh Linux container for the job.
That container needs a few things to run the browser checks. It needs the source code, a browser binary, and the test runner package.
To log in to external services, the runner reads secret keys from the store. Teams store these keys in the repo or deployment settings inside the source host.
The pipeline injects those variables into the container memory at runtime. The test runner then uses those keys to log in to the staging app.
It can also send test results and screenshots back to a cloud dashboard. Once the checks finish, the runner sends an exit code back to the pipeline.
A zero code marks the build as green and unlocks the merge button. A non-zero code stops the merge and alerts the team right away.
If a check fails, the pipeline saves videos and screenshots as build artifacts. Coders download these files from the build tab to see what broke.
Common failure modes and how to scope roles
Many teams hit trouble when they use shared admin keys in their test runs. If a test script holds a broad token, a leaked log exposes everything.
Long-lived service accounts also create big risks for the whole engineering team. Nobody knows which test run or coder made a specific change in staging.
End-to-End Encryption + Bitbucket Pipelines Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged database queries during test seed steps cause another big headache. When a test wipes a shared table, other parallel builds fail right away.
You can fix this by giving each pipeline role only what it needs. Create a test user role that can only read and write test rows.
Never reuse human admin accounts for automated browser runs in your pipeline. Scope repo variables to specific branches so feature builds cannot touch production.
Lock down network paths between the cloud runner and your private staging servers. Allow traffic only from known runner IP addresses or use a private runner.
Run your web server inside the same build container whenever you can. This setup removes the need to open inbound ports on your staging network.
Keeping browser test runs fast and clean
Browser tests take a lot of memory and CPU power during a build. If you install dependencies from scratch on every push, builds will crawl.
You should cache both the package folders and the test runner binary folder. Caching saves minutes on every single run and cuts down cloud build costs.
Split large test suites across multiple parallel steps in your pipeline definition. Running four small containers at once finishes much faster than one giant run.
Make sure each parallel container uses its own isolated test data set. When tests do not share state, they stop failing for random reasons.
Clean up test records after every run so the database stays fast. If your app stores test emails or card numbers, mask them in logs.
Masking rewrites matched fields in results so sensitive data stays out of build logs.
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
Where should we store secret keys for our browser tests?
Store secret keys as secured variables inside your repo or deployment settings. Never put passwords or API tokens inside your test files or config files.
Why do our browser tests pass locally but fail in the pipeline?
Cloud containers have less memory and slower CPUs than a coder laptop. Add extra memory to the build step and wait for network calls to finish.
How can our cloud runner reach a private staging app?
You can run a self-hosted runner inside your own private network. You can also boot the app inside the build container on localhost.
Related guides
In this post