Skip to main content
Version: 1.x

Interface: WebStorageFixture

The webStorage fixture API exposed to test bodies.

Remarks​

Provides typed access to both localStorage and sessionStorage via the Playwright 1.61+ Web Storage API. Feature-gated — throws PramanError with ErrorCode.ERR_COMPAT_FEATURE_UNAVAILABLE when the installed Playwright version is older than 1.61.

Capability​

webStorage.fixture

Example​

import { test } from 'playwright-praman';

test('check persisted theme', async ({ webStorage }) => {
await webStorage.localStorage.seed({ theme: 'dark' });
await page.goto('/');
expect(await webStorage.localStorage.getItem('theme')).toBe('dark');
});

Properties​

localStorage​

readonly localStorage: WebStorageHelper

Typed helper for localStorage.


sessionStorage​

readonly sessionStorage: WebStorageHelper

Typed helper for sessionStorage.