
Overview
- Goal: connect your GitHub repository to TestSprite so your tests run automatically every time a new deployment is ready — either on a pull request, or on a push to a branch.
- Time needed: about 10 minutes.
- You will need: permission to install a GitHub App on the repo’s organization, a repo that already produces deployments, and a TestSprite project that already has test cases.
How This Works
TestSprite does not build or deploy your app. It listens for a GitHub event that means “the new build is deployed and the URL is live,” then runs your test suite against that URL:- Your CI/CD pipeline builds and deploys your app, producing a deployment event in GitHub.
- TestSprite receives that event through the GitHub integration.
- TestSprite resolves the target URL to test — from the deployment, or from a URL pattern you define.
- TestSprite runs your tests and posts results back to GitHub as a PR comment or a commit check.
Prerequisite: Prepare a Deployment in Your GitHub Repo
TestSprite triggers off a deployment that GitHub reports, so confirm your repository creates one before connecting anything:-
Testing on push to a branch — the branch must have a deployment attached to it. Confirm the branch has a recent, successful deployment check (e.g. a “Deploy” workflow run) with a live URL behind it.

-
Testing on a pull request — the PR must produce its own preview deployment. Open an existing PR and confirm a deploy bot (Vercel, Amplify, or similar) has commented with a clickable preview URL, then open that URL to check the preview environment actually loads.
Any deploy bot works the same way. Here’s the equivalent Amplify comment:


Step 1: Connect GitHub to Your Workspace
A one-time setup per workspace that lets TestSprite read events from your repositories.Open the integration

Choose the account and repository access

Return to TestSprite
Step 2: Connect GitHub Action to a Project
Now link a specific repository to a specific TestSprite project.Open the project's GitHub Action tab

Connect GitHub Action and pick a trigger type
Trigger Rules
Each rule watches for a real signal from your own CI/CD (a check finishing, a workflow run completing, or a deploy bot’s PR comment), not just “a PR was opened” or “a commit was pushed”.
Setting Up a Pull Request Trigger
Paste a sample PR link and detect events


Select the event that means 'deployment finished', and fill in the Target URL pattern
{pr}, {branch}, {branch-slug}, {sha}, {short-sha} (e.g. a Vercel-style pattern: https://my-app-git-{branch-slug}-my-team.vercel.app).
Send a test event and verify



Create the trigger
Setting Up a Push Trigger
Pick the repository and branch, and detect events
main, dev), then click Detect Events.
Select the event
CI), a named CI check (e.g. Lint / Typecheck / Test), or the raw push itself (push to <branch>). Pick whichever one means “this push is ready to test.”
Select the Environment to test
Create the trigger
Verify on your next push

Trigger Activity
Below the Triggers list, the Trigger activity card — “What your triggers heard from GitHub, and what happened” — lists recent matches across all of a project’s rules.
github-pr-745), an outcome badge (Tests started for a normal dispatch), a link to the Execution it started, the short commit SHA, and when it happened.
Disconnecting a Repository
To stop a specific trigger without uninstalling anything, click its trash icon in the Triggers list — that trigger stops firing immediately, and existing run history stays accessible. To fully revoke TestSprite’s access to a repository (not just stop a trigger), edit the GitHub App’s repository access from GitHub’s side: Settings → Applications → Installed GitHub Apps → TestSprite → Configure, and change or remove that repo from the access list.Uninstalling the App Entirely
To remove the integration completely:- From GitHub, go to Settings → Applications → Installed GitHub Apps
- Find TestSprite and click Configure
- Scroll to the bottom and click Uninstall
Exporting Test Code to GitHub
Separate from everything above: Export to GitHub pushes the test code TestSprite generated for a project into a GitHub repository, so it lives alongside your source instead of only inside TestSprite.Trigger the export

Connect GitHub, if you haven't
TestSprite pushes the code
main:testsprite_test_code/latest/— the most recent execution’s teststestsprite_test_code/history/execution_<timestamp>_<id>/— every past execution that finished (passed or failed), kept as a history
Tips
Start with non-blocking for new triggers
Start with non-blocking for new triggers
Use draft PRs for quick checks
Use draft PRs for quick checks
Pair with scheduled monitoring
Pair with scheduled monitoring