Skip to content

GitLab CI โ€‹

Run your Shiplight E2E tests in GitLab CI and upload the results to Shiplight Cloud. GitLab uses the same shiplight CLI as every other provider โ€” only the pipeline syntax differs.

Before you start โ€‹

  • A scaffolded Shiplight test project (/shiplight init). See the CI/CD overview for how the pieces fit together.
  • An org API token from app.shiplight.ai/api-tokens, stored as a masked CI/CD variable named SHIPLIGHT_API_TOKEN (Settings โ†’ CI/CD โ†’ Variables). GitLab injects it into the job automatically.

Pipeline โ€‹

Create .gitlab-ci.yml at your repository root:

yaml
e2e:
  image: node:22
  variables:
    SHIPLIGHT_REPORT_TO_CLOUD: "1"
    # SHIPLIGHT_API_TOKEN comes from a masked CI/CD variable โ€” no need to repeat it here.
  script:
    - npm install
    - npx playwright install --with-deps chromium
    - npx shiplight test
  after_script:
    - npx shiplight report # after_script always runs, even when tests fail

Notes โ€‹

  • SHIPLIGHT_API_TOKEN and SHIPLIGHT_REPORT_TO_CLOUD=1 are required on every non-Shiplight runner โ€” they are provided automatically only on Shiplight-hosted GitHub runners.
  • With SHIPLIGHT_API_TOKEN set, AI-powered actions (natural-language steps, self-healing locators) run through the Shiplight LLM proxy, and healed locators persist to the Shiplight Cloud action cache so later runs replay at full speed.
  • Install Chromium yourself (npx playwright install --with-deps chromium); no stock image ships it.
  • after_script runs regardless of whether the tests passed, which is how the upload survives a red run.
  • Not available on GitLab: Shiplight-hosted runners and auto-triage โ€” those are GitHub Actions only.
  • Project in a subdirectory (e.g. tests/e2e)? cd into it before each command, or set a default: { before_script: [cd tests/e2e] }.

Released under the MIT License.