# Your test job
run-my-tests:
  stage: test
  needs: ["testpilot-install-linux-amd64"]  # Wait for Testpilot installation
  script:
    - ./bin/testpilot test your_test.pilot.yaml  # Replace with your test file
  # preserve artifacts and reports
  artifacts:
    reports:
      junit: testpilot-out/*.xml
    paths:
      - testpilot-out
    when: always
    expire_in: 1 week
```

### Step 2: Commit and Run[​](#step-2-commit-and-run "Direct link to 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[​](#step-3-view-your-artifacts "Direct link to 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[​](#step-4-understanding-what-happened "Direct link to 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[​](#platform-specific-setup "Direct link to 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)[​](#setting-up-for-linux-default "Direct link to Setting Up for Linux (Default)")

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

```yaml theme={null}
include:
  - component: gitlab.com/jetify-com/gitlab-components/testpilot-install@main
    inputs:
      stage: install

stages:
  - install
  - test

run-tests:
  stage: test
  needs: ["testpilot-install-linux-amd64"]
  script:
    - ./bin/testpilot test your_test.pilot.yaml
```

### Setting Up for macOS[​](#setting-up-for-macos "Direct link to 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`:

```yaml theme={null}