Run Tests in CI
Run saved FastTest suites in CI and post results as GitHub PR comments. Works with GitHub Actions, GitLab CI, or any CI system.
Prerequisites
- A saved test suite (create one with Vibe Shield)
- Cloud auth completed — you’ll need your API key
- A GitHub repository (for PR comments)
Set Up GitHub Integration
-
Create a GitHub Personal Access Token
Create a classic token with
reposcope, or a fine-grained token withContents: ReadandPull requests: Read and writepermissions. -
Store the token via FastTest
Set my GitHub token to ghp_xxxx
The token is encrypted and stored per-organization.
-
Test PR comments locally
Run the login suite against PR https://github.com/myorg/myrepo/pull/42
FastTest executes the suite and posts a comment on the PR with pass/fail results, regressions, and healed selectors.
Add to GitHub Actions
Add this workflow to .github/workflows/fasttest.yml:
name: FastTeston: pull_request: branches: [main]
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Start app run: | npm ci npm run build npm start & npx wait-on http://localhost:3000
- name: Run FastTest run: | npx -y @fasttest-ai/qa-agent ci \ --api-key ${{ secrets.FASTTEST_API_KEY }} \ --suite-id ${{ vars.QA_SUITE_ID }} \ --app-url http://localhost:3000 \ --pr-url ${{ github.event.pull_request.html_url }}Required secrets and variables
| Name | Type | Description |
|---|---|---|
FASTTEST_API_KEY | Secret | Your FastTest API key (from dashboard Settings) |
QA_SUITE_ID | Variable | Suite ID to run (from dashboard or list tool) |
If your test suite uses {{VAR_NAME}} placeholders, add the corresponding values as GitHub secrets. FastTest resolves them from environment variables automatically.
CI Runner Options
npx -y @fasttest-ai/qa-agent ci \ --api-key <key> \ --suite-id <id> \ [--app-url <url>] # Override suite's base URL [--pr-url <url>] # Post results as PR comment [--environment <name>] # Use environment config for URL + variables [--browser chromium] # Browser engine (chromium/firefox/webkit) [--json] # Output JSON for custom integrationsExit codes: 0 for all tests passed, 1 for any failure. CI pipelines auto-fail on test regressions.
What PR Comments Look Like
FastTest posts (and updates on re-run) a comment showing:
- Pass/fail summary with duration
- Regressions since last run
- Healed selectors (auto-repaired without failing)
- Flaky test retries
- Link to full results in the dashboard
Next Steps
- See the full CI/CD reference for advanced configuration
- Find security bugs and run security suites in CI
- Create more suites for different parts of your app