TestKase
TestKase
|Docs
Organization & AccountIntegrationsCI/CD

GitLab CI

Run Automate from a GitLab CI pipeline with the access key as a masked CI/CD variable.

Store the access key

  1. Project → Settings → CI/CD → Variables → Add variable.
  2. Key TESTKASE_ACCESS_KEY, value = your access key, tick Mask variable. Save.

Add the job

Save this as .gitlab-ci.yml in your repository, replacing [email protected] with your TestKase username:

One-time setup: run this locally and commit the result, before the pipeline needs it.

npm install --save-dev @testkase/playwright-reporter

The CI job only installs what's already committed — it can't add packages on its own. Skip this and the job either fails (no internet access) or runs slow (fetches the package fresh every time).

e2e:
  image: node:20
  variables:
    TK_USERNAME: "[email protected]"
    ACCESS_KEY: "$TESTKASE_ACCESS_KEY"      # Settings → CI/CD → Variables (masked)
    TESTKASE_BUILD: "ci-${CI_PIPELINE_ID}"
  script:
    - npm ci
    - npx testkase-playwright test
e2e:
  image: node:20
  variables:
    TK_USERNAME: "[email protected]"
    ACCESS_KEY: "$TESTKASE_ACCESS_KEY"      # Settings → CI/CD → Variables (masked)
    TESTKASE_BUILD: "ci-${CI_PIPELINE_ID}"
  script:
    - npm ci
    - npm test   # your Selenium suite — see the note below
e2e:
  image: node:20
  variables:
    TK_USERNAME: "[email protected]"
    ACCESS_KEY: "$TESTKASE_ACCESS_KEY"      # Settings → CI/CD → Variables (masked)
    TESTKASE_BUILD: "ci-${CI_PIPELINE_ID}"
  script:
    - npm ci
    - npm test   # your Appium suite — see the note below

Playwright runs through the testkase-playwright wrapper, which reads these environment variables for you. Selenium and Appium have no wrapper — your existing test code builds the Hub URL from TK_USERNAME / ACCESS_KEY itself, exactly as it already does outside CI. See Selenium: point your suite at TestKase and Appium: getting started.

What to check

Build nameci-${CI_PIPELINE_ID} — sessions group under it on the Automate dashboard
Secretread from $TESTKASE_ACCESS_KEY into ACCESS_KEY; never in the repository
Tunneladd npx testkase-tunnel --token "$ACCESS_KEY" & before the test step if the tests open a URL the farm can't reach

Run the pipeline once. Within a few seconds the session appears on Automate → Sessions with the build name above; the job goes red if any test fails.