TestKase
TestKase
|Docs
Organization & AccountIntegrationsCI/CD

Azure Pipelines

Run Automate from an Azure Pipelines job with the access key as a secret variable.

Store the access key

  1. Pipeline → Edit → Variables → New variable.
  2. Name TESTKASE_ACCESS_KEY, value = your access key, tick Keep this value secret. Save.

Azure does not expose secret variables to scripts automatically — they must be mapped with env: on the step, as the snippet does.

Add the job

Save this as azure-pipelines.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).

trigger: [main]
pool:
  vmImage: ubuntu-latest
steps:
  - task: NodeTool@0
    inputs: { versionSpec: '20.x' }
  - script: npm ci
  - script: npx testkase-playwright test
    displayName: E2E on TestKase
    env:
      TK_USERNAME: [email protected]
      ACCESS_KEY: $(TESTKASE_ACCESS_KEY)      # secret variable — must be mapped via env:
      TESTKASE_BUILD: ci-$(Build.BuildId)
trigger: [main]
pool:
  vmImage: ubuntu-latest
steps:
  - task: NodeTool@0
    inputs: { versionSpec: '20.x' }
  - script: npm ci
  - script: npm test   # your Selenium suite — see the note below
    displayName: E2E on TestKase
    env:
      TK_USERNAME: [email protected]
      ACCESS_KEY: $(TESTKASE_ACCESS_KEY)      # secret variable — must be mapped via env:
      TESTKASE_BUILD: ci-$(Build.BuildId)
trigger: [main]
pool:
  vmImage: ubuntu-latest
steps:
  - task: NodeTool@0
    inputs: { versionSpec: '20.x' }
  - script: npm ci
  - script: npm test   # your Appium suite — see the note below
    displayName: E2E on TestKase
    env:
      TK_USERNAME: [email protected]
      ACCESS_KEY: $(TESTKASE_ACCESS_KEY)      # secret variable — must be mapped via env:
      TESTKASE_BUILD: ci-$(Build.BuildId)

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-$(Build.BuildId) — 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.