> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testdino.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Playwright GitLab CI Integration

> Connect TestDino to GitLab for MR comments and merge request sync.

The GitLab integration connects your GitLab repositories to TestDino using OAuth. Once connected, it posts AI-generated test summaries to merge requests and commits, and syncs MR data back into TestDino. No changes to your CI pipeline required.

<Note>
  **Note**

  Only one Git provider (GitHub or GitLab) can be active per project at a time. If you need GitHub, see [GitHub Integration](/integrations/ci-cd/github). Running GitLab on your own infrastructure? See [GitLab Self-Managed Integration](/integrations/playwright-gitlab-self-hosted).
</Note>

## What the GitLab Integration Does

| Feature                 | What It Does                                                                                                                         | Where It Appears                                                     |
| :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------- |
| MR Comments             | Posts AI-generated summary with pass/fail counts, failure analysis grouped by file, and a link to the full report                    | GitLab merge request comments                                        |
| Commit Comments         | Posts the same AI summary attached to the specific commit                                                                            | GitLab commit detail page                                            |
| MR State Sync           | Syncs merge request state (open, merged, closed) so TestDino stays current with your MR lifecycle                                    | TestDino → [Pull Requests](/platform/pull-requests/summary)          |
| Merge Request Dashboard | Syncs MR metadata (author, reviewers, status, branches) and displays test run KPIs, pass rate trends, and AI failure insights per MR | TestDino → [Pull Requests](/platform/pull-requests/summary)          |
| Timeline                | Syncs commits, test runs, and code review events into a chronological feed per MR                                                    | TestDino → [MR Timeline](/platform/pull-requests/timeline)           |
| Files Changed           | Syncs file diffs, additions, deletions, and code-level comments with resolved/unresolved status                                      | TestDino → [MR Files Changed](/platform/pull-requests/files-changed) |

<Info>
  **Info**

  GitLab does not support CI Checks (quality gates that block merges). That feature is available with the [GitHub integration](/integrations/ci-cd/github) only. GitLab comment summaries still give your team full visibility into test results on every MR.
</Info>

## Prerequisites

* A TestDino account with a project created ([Getting Started](/getting-started))
* An API key generated for your project ([Generate API Keys](/guides/generate-api-keys))
* TestDino configured in your Playwright project ([Node.js CLI](/cli/testdino-playwright-nodejs))
* GitLab Maintainer or Owner access on the repository you want to connect

## Connect TestDino with GitLab

Connection is a two-step process: authorize TestDino via GitLab OAuth, then select which repository to connect in TestDino.

### 1. Authorize TestDino in GitLab

Go to **Settings → Integrations → CI/CD** in your TestDino project and select **GitLab**. This redirects you to GitLab to authorize TestDino.

Sign in to GitLab (if not already) and approve the OAuth request. TestDino requests access to read your repositories, merge requests, and commits.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/integrations/ci-cd/playwright-gitlab-ci/integration-gitlab-authorized.webp" alt="GitLab Connected confirmation screen after OAuth authorization" style={{ maxWidth:"50%" }} />

<Note>
  **Note**

  This step grants TestDino access to your GitLab account. It does not connect a specific repo to your TestDino project yet. You can revoke access anytime from **GitLab → Settings → Applications**.
</Note>

### 2. Connect a repository to your TestDino project

After authorization, the browser redirects back to TestDino. You land on the repository selection screen. Search for the repository you want to connect by name, then select it. Once selected, the repository is connected and ready to use.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/integrations/ci-cd/playwright-gitlab-ci/integration-gitlab-repo-select.webp" alt="TestDino repository selection screen listing GitLab repos available to connect" style={{ maxWidth:"60%" }} />

After selecting a repo, the GitLab card in **Settings → Integrations** shows the connected repository name.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/integrations/ci-cd/playwright-gitlab-ci/integration-gitlab-connected.webp" alt="TestDino Settings showing GitLab card in connected state with repo name and gear icon" style={{ maxWidth:"60%" }} />

TestDino starts syncing MR metadata and attaching test runs to commits from this point forward.

***

The sections below cover what you can configure and access after the connection is active.

## Configure MR Comments

<img src="https://tdstorageus.blob.core.windows.net/public/docs/integrations/ci-cd/playwright-gitlab-ci/integration-gitlab-pr-comment.webp" alt="GitLab merge request comment showing AI-generated test summary with pass/fail counts and failure analysis" />

When a Playwright run finishes, TestDino can post an AI-generated test summary directly to the merge request or commit in GitLab. To control where and when these comments appear, you configure them through **GitLab Settings** in TestDino.

Open **Settings → Integrations → GitLab** and click the ⚙️ icon on the GitLab card. This opens the **GitLab Settings** panel.

<img src="https://tdstorageus.blob.core.windows.net/public/docs/integrations/ci-cd/playwright-gitlab-ci/integration-gitlab-settings.webp" alt="GitLab Settings panel showing MR and commit comment toggles with environment overrides table" />

### Default comment toggles

At the top, two toggles control the global defaults:

* **Merge Request Comments**: posts a test summary to every MR on a mapped branch
* **Commit Comments**: posts a test summary to every commit on a mapped branch

These defaults apply to all environments unless overridden below.

### Environment overrides

Below the defaults, the **Environment Overrides** table lists each environment configured in your project (e.g., PROD, DEV, MAIN, QA, STAGE). Each row shows:

| Column          | What It Controls                                                                        |
| :-------------- | :-------------------------------------------------------------------------------------- |
| Environment     | The environment name (configured in [Environment Mapping](/guides/environment-mapping)) |
| Branch Patterns | Which branches map to this environment (e.g., `main`, `dev`, `staging`)                 |
| MR              | Toggle MR comments on or off for this specific environment                              |
| Commits         | Toggle commit comments on or off for this specific environment                          |

Environment-level toggles override the global defaults. For example, you can enable MR comments globally but disable them for the DEV environment.

<Tip>
  **Tip**

  Environment overrides are optional. If the global toggles are on and no overrides are configured, TestDino posts comments on every MR and commit. Use overrides when you want different behavior per environment. For example: post both MR and commit summaries on PROD branches, but only MR summaries on DEV branches.
</Tip>

## Merge Requests in TestDino

Once connected, TestDino syncs your GitLab merge requests into the [Pull Requests](/platform/pull-requests/summary) view. Each MR shows:

| Tab                                                    | What It Shows                                                                                                                    |
| :----------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
| [Overview](/platform/pull-requests/overview)           | MR status, test run KPIs (pass rate, duration, files changed), latest run with AI failure insights, and test results trend graph |
| [Timeline](/platform/pull-requests/timeline)           | Chronological feed of commits, test runs, and code review events synced from GitLab                                              |
| [Files Changed](/platform/pull-requests/files-changed) | File diffs with additions, deletions, and code-level comments with resolved/unresolved status                                    |

TestDino keeps MR state in sync with GitLab. When a merge request is opened, merged, or closed in GitLab, the status updates in TestDino automatically.

<Tip>
  **Tip**

  The merge request view updates automatically as new commits and test runs arrive. No manual refresh needed.
</Tip>

## Troubleshooting

<AccordionGroup>
  <Accordion title="MR comments not appearing" icon="comment-slash">
    * Verify the global comment toggles are enabled in **Settings → Integrations → GitLab → ⚙️**
    * Confirm the branch that triggered the run is mapped to an environment (if using overrides)
    * Check that the CLI is uploading with the correct project API key
  </Accordion>

  <Accordion title="Merge requests not syncing in TestDino" icon="arrows-rotate">
    * Verify the GitLab OAuth connection is still active in **Settings → Integrations**
    * Ensure the correct repository is connected to the TestDino project
    * Confirm tests have run on the MR branch at least once after connecting
  </Accordion>

  <Accordion title="OAuth authorization failed" icon="lock">
    * Ensure you have Maintainer or Owner access on the GitLab repository
    * Try revoking the TestDino app in **GitLab → Settings → Applications** and reconnecting
  </Accordion>

  <Accordion title="Repository not appearing in selection list" icon="folder-open">
    * The OAuth token may not have access to that repo. Revoke and re-authorize to refresh permissions
    * Ensure the repository is not archived in GitLab
  </Accordion>
</AccordionGroup>

<CardGroup cols={2}>
  <Card title="GitLab Self-Managed" icon="server" href="/integrations/playwright-gitlab-self-hosted">
    Connect TestDino to a self-managed GitLab instance via OAuth
  </Card>

  <Card title="GitHub Integration" icon="github" href="/integrations/ci-cd/github">
    Connect GitHub with PR comments, CI checks, and quality gates
  </Card>

  <Card title="Environment Mapping" icon="map" href="/guides/environment-mapping">
    Map branches to environments for targeted reporting
  </Card>

  <Card title="Pull Requests Dashboard" icon="code-pull-request" href="/platform/pull-requests/summary">
    View all MRs with test run results, trends, and AI insights
  </Card>
</CardGroup>
