Skip to main content
You can check out an example repo with our Gitlab integration for more details.

Getting Started

Prerequisites

Before you begin, make sure you have:
  • A GitLab project with CI/CD enabled
  • At least one Testpilot test file (.pilot.yaml) in your repository
  • Access to GitLab runners (SaaS or self-hosted)

Step 1: Create Your First Pipeline

Let’s start by creating a simple GitLab CI pipeline that installs Testpilot and runs a test. Create or edit your .gitlab-ci.yml file in your project root:

Step 2: Commit and Run

Now that you have your pipeline defined, let’s run it:
  1. Save your .gitlab-ci.yml file
  2. Commit and push to your GitLab repository
  3. Navigate to your project’s CI/CD > Pipelines section
  4. Watch your pipeline run!
You should see two jobs:
  • testpilot-install-linux-amd64 - Downloads and sets up Testpilot
  • run-my-tests - Runs your Testpilot tests

Step 3: View your Artifacts

The artifacts section of the job above will preserve a static report of your Testpilot tests, including images and videos. You can view it by browsing to the Artifacts section of your Gitlab project. Testpilot also generates a JUnit report that can be directly reported to your merge requests

Step 4: Understanding What Happened

The Testpilot component automatically:
  • Downloaded the Testpilot installer
  • Installed Testpilot and its dependencies (Playwright, Node.js)
  • Created a ./bin/testpilot launcher script
  • Cached everything for faster future runs
  • Made Testpilot available to your test job

Platform-Specific Setup

Testpilot supports running your tests on Linux and macOS runners. You can easily configure your pipeline to handle both platforms:

Setting Up for Linux (Default)

The component works out-of-the-box with GitLab’s standard Linux runners. No additional configuration needed!

Setting Up for macOS

Since macOS runners can’t (currently) run Docker Images directly, they require a slightly different setup. Here’s how to configure your pipeline to use GitLab’s SaaS macOS runners: Step 1: Define your macOS runner configuration at the top of your .gitlab-ci.yml:
Step 2: Include the component with macOS-specific settings:

Setting up Custom Runners

If you’re using self-hosted runners, you can configure Testpilot to run on them using a configuration like the following

Multi-Platform Testing

Want to test on both Linux and macOS? Here’s how:

Sharding your Tests and Running in Parallel

Testpilot can shard your test files across multiple runners using the --shard flag, which is useful for parallelizing and speeding up your test runs. Note that after sharding and running your tests in parallel, you will probably want to merge the reports back together using testpilot report merge. You can see an example of sharding testpilot files in our example repo. An example gitlab.yaml file is below:

Understanding the Component

Behind the Scenes

When you include the Testpilot component, it creates a job that:
  1. Downloads the installer from https://get.jetify.com/testpilot
  2. Installs Testpilot and its dependencies (Playwright, Node.js)
  3. Creates a launcher script at ./bin/testpilot that handles environment setup
  4. Caches everything so future pipeline runs are faster
  5. Shares the installation with your test jobs via GitLab artifacts

Component Configuration Options

The component accepts these parameters:

Caching and Performance

Caching Strategy

The component automatically caches:
  • The Testpilot binary and dependencies
  • Your ./bin/testpilot launcher script
This means the second time your pipeline runs, Testpilot installation will be much faster!

Custom Cache Directory

If you need to change where files are cached:

Best Practices Summary

Do:
  • Always use needs: to ensure proper job dependencies
  • Leverage the built-in caching for faster pipelines
  • Use descriptive job names that reflect what you’re testing
  • Test on multiple platforms if your application supports them
  • Structure your tests in logical directories
Don’t:
  • Forget to specify the correct job name in needs:
  • Modify the cache directory unless necessary
  • Run tests without waiting for the installation job
  • Use the same job name for multiple platforms