The Simplest Way to Make Gitea and Selenium Work Like They Should
Teams pair gitea and selenium to run browser tests on every code push. Gitea stores code and runs workflows, while Selenium drives browsers to check your app. This setup catches UI bugs before new code reaches real users. Yet linking your git server to a test grid often causes slow runs. Teams also struggle with secret keys and network rules between runners and browsers. How gitea and selenium share data and keys A clean setup starts with a clear flow between your repo and browser nodes. A d
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 pair gitea and selenium to run browser tests on every code push. Gitea stores code and runs workflows, while Selenium drives browsers to check your app.
This setup catches UI bugs before new code reaches real users. Yet linking your git server to a test grid often causes slow runs. Teams also struggle with secret keys and network rules between runners and browsers.
How gitea and selenium share data and keys
A clean setup starts with a clear flow between your repo and browser nodes. A developer pushes code to a branch or opens a pull request in Gitea. Gitea Actions spots this change and wakes up a runner host. The runner pulls the latest code and starts your test suite.
Next, the test script talks to a local browser or a remote Selenium Grid. It sends step-by-step commands over HTTP to open pages, click buttons, and read text. The browser runs against a test build of your web app. When the test ends, the grid sends pass or fail logs back to Gitea. Gitea then marks the commit as green or red for the whole team.
Permissions play a big role in this flow. The Gitea runner needs a scoped token to pull code from private repos. The test script also needs login data to check protected pages in your app. Store these values inside Gitea secret stores at the repo or team level. Pass them into the runner only when a job starts. Never hardcode app passwords or grid keys inside your test files.
Common failure modes and how to fix them
Many teams hit the same walls when they scale browser tests. The worst mistake is using one shared admin account for all test runs. When two pull requests run at once, they change the same user state. One test logs out while the other test still checks a page. Both tests fail for no clear reason. Give each test worker its own test user or isolated database seed instead.
Broad tokens create another big risk in CI pipelines. If a runner uses a wide personal key, any bad script can read all repos. Scope every runner token to the single repo it needs to build. Set tokens to expire and rotate them on a set schedule.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged test actions also waste hours during a bug hunt. When a browser test fails on a headless node, teams guess what went wrong. Configure your test runner to save browser logs and screenshots on every failure. Attach those files as build artifacts inside the Gitea workflow summary.
Scoping network paths and test data
Network design keeps your test grid fast and safe. Do not expose your Selenium Grid hub to the public internet. An open grid lets outsiders run browser jobs on your servers. Place the Gitea runner and the browser nodes inside the same private network. Allow traffic only on the exact port that the grid hub listens on.
Your browser nodes also need to reach the test build of your web app. Spin up a fresh app container inside the runner job for each push. This keeps test traffic local and prevents slow network hops. Tear down the app container and the browser session right after the test finishes. Fresh containers stop leftover cookies or cache files from breaking the next run.
Keep production data out of your staging and test environments. If tests use real data, masking rewrites matched fields like emails and phone numbers in results. Card numbers and national IDs stay safe during test runs.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Should I run browsers on the Gitea runner or a separate grid?
For small apps, run headless browsers right inside the Gitea runner container. For large suites that need many browser types, send jobs to a separate Selenium Grid.
How do I stop flaky browser tests in Gitea Actions?
Use explicit waits in your test code instead of fixed sleep timers. Also give each test run a clean database state and its own login user.
Where should I store test user passwords for browser checks?
Save all test credentials inside Gitea repo secrets. Inject them into the test runner as runtime variables only during the test step.
Related guides
In this post