> ## Documentation Index
> Fetch the complete documentation index at: https://qawolf-mintlify-79e74a8b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Reference

> Reference for @qawolf/testkit/web, including the readQRCode helper that decodes QR codes from a page locator during a flow.

`@qawolf/testkit/web` currently exposes `readQRCode(page, selector)`.

## Current Signature

```ts theme={null}
readQRCode(page: Page, selector: string): Promise<string | undefined>
```

Example:

```ts theme={null}
import { readQRCode } from "@qawolf/testkit/web";

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

## Behavior

The helper:

* screenshots the locator matched by `selector`
* parses the result as PNG
* decodes the QR code if one is present
* returns `undefined` when no QR code is found

Example:

```ts theme={null}
import { readQRCode } from "@qawolf/testkit/web";

await page.goto("https://example.com");

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

if (qrValue) {
  console.log(qrValue);
}
```
