Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.qawolf.com/llms.txt

Use this file to discover all available pages before exploring further.

@qawolf/testkit is a small helper library for flow code and runner wiring. Use it when a test needs something outside normal browser or mobile automation:
  • generate an OTP code
  • decode a QR code from the page
  • mount a CIFS share
  • start OpenVPN
  • save a baseline screenshot
  • save and reload QA Wolf environment variables

Pick The Import

import {
  otp,
  reloadEnvironmentVariables,
  saveBaselineScreenshot,
  saveEnvironmentVariable,
  startOpenVpn,
} from "@qawolf/testkit";

Generate An OTP

import { otp } from "@qawolf/testkit";

const code = otp.fromUri(process.env["OTP_URI"]!);

await page.getByLabel("Verification code").fill(code);

Read A QR Code

import { readQRCode } from "@qawolf/testkit/web";

const qrValue = await readQRCode(page, "[data-testid='qr-code']");

if (!qrValue) throw new Error("QR code was not visible");

Save Environment Variables

Use saveEnvironmentVariable(...) to persist a string value to the current QA Wolf environment and update process.env for the running flow. Use reloadEnvironmentVariables() when the flow needs to refresh process.env from the latest environment values.
import {
  reloadEnvironmentVariables,
  saveEnvironmentVariable,
} from "@qawolf/testkit";

await saveEnvironmentVariable("SESSION_TOKEN", token);
await reloadEnvironmentVariables();

Use Runner-Backed Helpers

Some helpers call a client configured by the runner.
import { startOpenVpn } from "@qawolf/testkit";

const pid = await startOpenVpn({
  configPath: "/tmp/client.ovpn",
});
If the runner has not configured a client, these helpers fail fast with a setup error. That is intentional: flow code should not guess how to reach runner-only services.

Next Steps

Last modified on April 29, 2026