Interface: PlaywrightFeatures
Feature flags indicating available Playwright APIs.
Example
const features: PlaywrightFeatures = detectFeatures(version);
if (features.hasClockAPI) { ... }
Properties
hasAbortSignal
readonlyhasAbortSignal:boolean
AbortSignal support via the signal option on waiting APIs.
hasApiResponseTiming
readonlyhasApiResponseTiming: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
readonlyhasAriaSnapshot:boolean
hasAriaSnapshotBoxes
readonlyhasAriaSnapshotBoxes:boolean
hasAriaSnapshotDepth
readonlyhasAriaSnapshotDepth:boolean
hasAriaSnapshotJSON
readonlyhasAriaSnapshotJSON:boolean
locator.ariaSnapshotJSON() / page.ariaSnapshotJSON() — JSON, not YAML.
hasBoxedStep
readonlyhasBoxedStep:boolean
hasBrowserContextEvent
readonlyhasBrowserContextEvent:boolean
hasClockAPI
readonlyhasClockAPI:boolean
hasConsoleMessageFilter
readonlyhasConsoleMessageFilter: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
readonlyhasCustomExpect:boolean
hasDialogClosedEvent
readonlyhasDialogClosedEvent:boolean
page.on('dialogclosed') / browserContext.on('dialogclosed').
hasFilterLocator
readonlyhasFilterLocator:boolean
hasGetByRoleDescription
readonlyhasGetByRoleDescription:boolean
hasHttpCredentialsArray
readonlyhasHttpCredentialsArray: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
readonlyhasLocatorAssertions:boolean
hasLocatorDrop
readonlyhasLocatorDrop:boolean
hasLocatorHighlightStyle
readonlyhasLocatorHighlightStyle:boolean
hasLocatorNormalize
readonlyhasLocatorNormalize:boolean
hasLocatorWaitForFunction
readonlyhasLocatorWaitForFunction: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
readonlyhasOpfsStorageState:boolean
storageState({ opfs }) — origin private file system in storage state.
hasPageAriaSnapshot
readonlyhasPageAriaSnapshot:boolean
hasRetryStrategyIsolated
readonlyhasRetryStrategyIsolated:boolean
testConfig.retryStrategy, including 'isolated'.
hasRouteFromHAR
readonlyhasRouteFromHAR:boolean
hasScreencastAPI
readonlyhasScreencastAPI:boolean
hasScreencastTimestamp
readonlyhasScreencastTimestamp:boolean
hasScreenshotCaret
readonlyhasScreenshotCaret:boolean
hasScrollOption
readonlyhasScrollOption: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
readonlyhasSetStorageState:boolean
hasSoftPoll
readonlyhasSoftPoll:boolean
hasStepParams
readonlyhasStepParams: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
readonlyhasSubtreeFrameLocator: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
readonlyhasTestAbort:boolean
hasTestLocks
readonlyhasTestLocks: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
readonlyhasTracingHAR:boolean
hasURLPatternMatcher
readonlyhasURLPatternMatcher:boolean
hasVideoRetainModes
readonlyhasVideoRetainModes:boolean
hasVisibleLocator
readonlyhasVisibleLocator:boolean
locator.visible() — the supported replacement for the :visible
pseudo-class.
hasWebAuthnCredentials
readonlyhasWebAuthnCredentials:boolean
hasWebPScreenshots
readonlyhasWebPScreenshots:boolean
screenshot({ type: 'webp' }) — smaller failure artifacts.
hasWebStorageAPI
readonlyhasWebStorageAPI:boolean