@qawolf/testkit
v1.0.0
Published
`@qawolf/testkit` is a TypeScript toolkit designed to help you use QA Wolf flow helpers and runner integrations for cases outside normal browser or mobile automation.
Keywords
Readme
@qawolf/testkit
@qawolf/testkit is a TypeScript toolkit designed to help you use QA Wolf flow
helpers and runner integrations for cases outside normal browser or mobile
automation.
To learn more about how to use @qawolf/testkit, check out the
API Reference
and Documentation.
Install
npm install @qawolf/testkitUsage
Generate an OTP to complete a two-factor challenge inside your flow.
import { otp } from "@qawolf/testkit";
const code = otp.fromUri(process.env["OTP_URI"]!);
await page.getByLabel("Verification code").fill(code);Decode a QR code from the page when your app uses QR-based setup or login.
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");Use runner-backed helpers for environment setup, such as connecting through OpenVPN before the rest of the flow runs.
import { startOpenVpn } from "@qawolf/testkit";
await startOpenVpn({
configPath: "/tmp/client.ovpn",
});