Skip to main content
Version: 1.x

Function: getPlaywrightVersion()

getPlaywrightVersion(): PlaywrightVersion

Reads the installed @playwright/test version from disk.

Returns

PlaywrightVersion

Parsed Playwright version.

Remarks

Uses createRequire to resolve and load the @playwright/test/package.json. This works in both ESM and CJS contexts.

Example

const version = getPlaywrightVersion();
logger.info(version.raw); // '1.58.2'