Skip to main content
Version: 1.x

Interface: PlaywrightFeatures

Feature flags indicating available Playwright APIs.

Example​

const features: PlaywrightFeatures = detectFeatures(version);
if (features.hasClockAPI) { ... }

Properties​

hasAbortSignal​

readonly hasAbortSignal: boolean

AbortSignal support via the signal option on waiting APIs.


hasApiResponseTiming​

readonly hasApiResponseTiming: boolean

apiResponse.timing() — real resource timing for an API response.

Remarks​

Added in v1.62, per the API doc badge. Replaces wall-clock Date.now() deltas, which measure Playwright's own round-trip rather than the request.


hasAriaSnapshot​

readonly hasAriaSnapshot: boolean


hasAriaSnapshotBoxes​

readonly hasAriaSnapshotBoxes: boolean


hasAriaSnapshotDepth​

readonly hasAriaSnapshotDepth: boolean


hasAriaSnapshotJSON​

readonly hasAriaSnapshotJSON: boolean

locator.ariaSnapshotJSON() / page.ariaSnapshotJSON() — JSON, not YAML.


hasBoxedStep​

readonly hasBoxedStep: boolean


hasBrowserContextEvent​

readonly hasBrowserContextEvent: boolean


hasClockAPI​

readonly hasClockAPI: boolean


hasConsoleMessageFilter​

readonly hasConsoleMessageFilter: boolean

page.consoleMessages() / page.pageErrors() accept a filter option.

Remarks​

The base methods exist at the 1.57 floor, but take no arguments there. JavaScript silently ignores surplus arguments, so passing { filter } on an older runtime returns every message while the caller believes it received only the filtered set — wrong data rather than a crash. Always guard the option on this flag.


hasCustomExpect​

readonly hasCustomExpect: boolean


hasDialogClosedEvent​

readonly hasDialogClosedEvent: boolean

page.on('dialogclosed') / browserContext.on('dialogclosed').


hasFilterLocator​

readonly hasFilterLocator: boolean


hasGetByRoleDescription​

readonly hasGetByRoleDescription: boolean


hasHttpCredentialsArray​

readonly hasHttpCredentialsArray: boolean

httpCredentials accepts an array, for per-origin credentials.

Remarks​

No "Added in" badge exists for the array form — the API docs show the Object | Array<Object> union without a version note, so the usual badge check could not settle it. Established instead by diffing the published type definitions: [email protected] declares httpCredentials?: {…}|Array<{…}> (types.d.ts:11450), while 1.57.0 and 1.62.0 contain no array form at all.

Declared but not consumed: Praman has no httpCredentials call site, and the six auth strategies are form/SAML/certificate based rather than HTTP Basic. Catalogued so the record is complete and so any future use is guarded — an array passed to an older runtime would be read as a single malformed credentials object, not rejected.


hasLocatorAssertions​

readonly hasLocatorAssertions: boolean


hasLocatorDrop​

readonly hasLocatorDrop: boolean


hasLocatorHighlightStyle​

readonly hasLocatorHighlightStyle: boolean


hasLocatorNormalize​

readonly hasLocatorNormalize: boolean


hasLocatorWaitForFunction​

readonly hasLocatorWaitForFunction: boolean

locator.waitForFunction() — element-scoped wait predicates.

Remarks​

Verified absent in 1.60 and 1.61, present in 1.62. This is additive to waitForUI5Stable, not a replacement: UI5 stability is a global property read off the core, while this is scoped to one element and receives that element as its argument.


hasOpfsStorageState​

readonly hasOpfsStorageState: boolean

storageState({ opfs }) — origin private file system in storage state.


hasPageAriaSnapshot​

readonly hasPageAriaSnapshot: boolean


hasRetryStrategyIsolated​

readonly hasRetryStrategyIsolated: boolean

testConfig.retryStrategy, including 'isolated'.


hasRouteFromHAR​

readonly hasRouteFromHAR: boolean


hasScreencastAPI​

readonly hasScreencastAPI: boolean


hasScreencastTimestamp​

readonly hasScreencastTimestamp: boolean


hasScreenshotCaret​

readonly hasScreenshotCaret: boolean


hasScrollOption​

readonly hasScrollOption: boolean

scroll: 'auto' | 'none' on actions — opt out of auto scroll-into-view.

Remarks​

Added in v1.62, per the API doc badge (locator.click option scroll).

Declared but not yet consumed, deliberately: passing { scroll: 'none' } to an older runtime is silently ignored, so the caller would believe it had opted out while Playwright scrolled anyway — the same trap PlaywrightFeatures.hasConsoleMessageFilter documents. Any future use of the option must guard on this flag.


hasSetStorageState​

readonly hasSetStorageState: boolean


hasSoftPoll​

readonly hasSoftPoll: boolean


hasStepParams​

readonly hasStepParams: boolean

test.step() accepts subtitle and params, surfaced on TestStep.

Remarks​

Reporters receive structured step data rather than only a title. Guard the option rather than the read: on an older runtime the extra options object is silently ignored, so a reporter would render blank subtitles while believing it had them.


hasSubtreeFrameLocator​

readonly hasSubtreeFrameLocator: boolean

page.frameLocator() / frame.frameLocator() with the selector omitted.

Remarks​

Searches every frame in the subtree instead of requiring the iframe to be located first, throwing if the match spans more than one frame. The floor-compatible form is the same call with a selector, so this degrades rather than throws.


hasTestAbort​

readonly hasTestAbort: boolean


hasTestLocks​

readonly hasTestLocks: boolean

test() and test.describe() accept lock — named mutual exclusion.

Remarks​

Tests holding the same lock name never run concurrently across files, workers and projects. Directly relevant to SAP: FLP user settings, a shared backend customizing transaction, or a single named test user are all global state that parallel specs otherwise corrupt.

There is no equivalent on the 1.57 floor — fullyParallel: false is per-project and far blunter — so per the module policy above, callers must throw rather than degrade when this is unavailable.


hasTracingHAR​

readonly hasTracingHAR: boolean


hasURLPatternMatcher​

readonly hasURLPatternMatcher: boolean


hasVideoRetainModes​

readonly hasVideoRetainModes: boolean


hasVisibleLocator​

readonly hasVisibleLocator: boolean

locator.visible() — the supported replacement for the :visible pseudo-class.


hasWebAuthnCredentials​

readonly hasWebAuthnCredentials: boolean


hasWebPScreenshots​

readonly hasWebPScreenshots: boolean

screenshot({ type: 'webp' }) — smaller failure artifacts.


hasWebStorageAPI​

readonly hasWebStorageAPI: boolean