The Simplest Way to Make Github and Selenium Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use github and selenium together to run browser tests on every code change. When a developer pushes code, the pipeline starts a browser and checks the web app. This setup catches visual bugs and broken workflows before they reach live users. It turns slow manual checks into fast, repeatable tasks for the whole engineering team. How github and selenium share permissions and data The workflow starts when a developer opens a pull request or merges a branch. The source control platform det

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 github and selenium together to run browser tests on every code change. When a developer pushes code, the pipeline starts a browser and checks the web app.

This setup catches visual bugs and broken workflows before they reach live users. It turns slow manual checks into fast, repeatable tasks for the whole engineering team.

How github and selenium share permissions and data

The workflow starts when a developer opens a pull request or merges a branch. The source control platform detects this event and starts a clean runner machine.

That runner pulls the latest code and installs the browser driver and test framework. Next, the runner needs permission to reach the staging web app and test database.

Teams store test keys and login secrets inside the repo secret store. The runner reads those secrets and passes them into the test script at runtime.

Then the browser driver opens a headless browser session and loads the target web page. It clicks buttons, fills out forms, and checks the page text against expected results.

When the test finishes, the runner sends pass or fail logs back to the pull request. If a step fails, the runner saves screenshots and logs as build files for review.

Common failure modes and how to scope roles

Many teams struggle with flaky tests and broad permissions in their browser test pipelines. A common mistake is using one shared admin account for all automated browser runs.

If two pipelines run at the same time, they change the same user state. One test logs out or deletes data while the other test still needs it.

Shared admin keys also create a major security risk if a build log leaks. Another problem happens when test runners use wide network paths to reach internal staging apps.

GitHub Actions Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Opening your staging network to all cloud runner IP addresses exposes internal services to outsiders. Unlogged database queries during test seed steps also make it hard to track bad data.

To fix these issues, scope every test role down to the minimum required permissions. Give each pipeline run its own isolated test user account and separate test data.

Use short-lived tokens for repo runners instead of static keys that never expire. Restrict the runner role so it can only read code and write test statuses.

Keep your browser nodes inside a private network close to the staging web app. Make sure every database setup query and browser action writes to a central audit log.

If staging holds sensitive data like emails or card numbers, mask those fields in results. Masking rewrites matched fields in results so test logs stay safe for the team.

Keeping browser test pipelines fast and reliable

Browser tests take longer to run than small unit tests because real pages must load. You can speed up the pipeline by splitting large test suites across parallel runners.

Run only the most critical login and checkout flows on every single pull request. Schedule the full browser test suite to run on a timer or before a release.

Always pin your browser version and driver version so updates do not break builds. Clean up test users and temporary database rows at the end of every test run.

Clear state habits keep your staging app fast and keep your test results clean.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How do we stop browser tests from failing on slow page loads?

Use explicit waits that check for a specific page element before clicking or typing. Avoid fixed sleep timers because they make tests slow and fail under heavy load.

Where should we store login secrets for automated browser tests?

Store all test passwords and API keys in the encrypted secret store of your repo. Inject them into the runner only during the test step and mask them in logs.

Should we run browser tests against live production systems?

Run most browser tests against an isolated staging app with synthetic test data. If you test production, restrict the bot account to safe, read-only page checks.

The query runs. The emails stay hidden.