← Files Testkube SkillsARCHIVED FILE

skills/testworkflow-author/examples/k6-browser.yaml

1.27 KB · Oct 2, 2026 · 00:29 UTC

↓ Download file

# Example: K6 Browser Testing
# Patterns: k6-browser, specialized image, JSON output
# What this demonstrates: K6 can also run browser-based tests using the
#                       xk6-browser extension. This requires a special
#                       K6 image with browser support built in.

apiVersion: testworkflows.testkube.io/v1
kind: TestWorkflow
metadata:
  name: k6-browser
  labels:
    tool: k6-browser
    category: performance-testing
spec:
  content:
    git:
      uri: https://github.com/kubeshop/testkube
      revision: main
      paths:
      - test/k6/k6-browser-smoke-test.js

  container:
    # grafana/k6:*-with-browser images include the xk6-browser extension.
    # Standard k6 images do NOT include browser support.
    image: grafana/k6:1.3.0-with-browser
    workingDir: /data/repo/test/k6
    resources:
      requests:
        cpu: 128m
        memory: 256Mi

  steps:
  - name: Run browser test
    run:
      shell: |
        mkdir -p /data/artifacts
        # --out json: output results to JSON file for artifact collection
        # --tag: add metadata tags to the test run
        k6 run k6-browser-smoke-test.js \
          --out json=/data/artifacts/k6-browser-result.json \
          --tag test_type=browser
    artifacts:
      paths:
      - /data/artifacts/**

SHA-256: 7bfb7156936eb853d260aba52089a82e88946c98271d01308ad95f9dae3bbbc7