Skip to main content
Version: 1.x

Interface: VisualRegressionFixture

Visual regression fixture API.

Capability​

visualRegression.fixture

Example​

await visualRegression.compareScreenshot('overview.png', {
mask: visualRegression.maskFLPChrome(),
threshold: 0.15,
});

Methods​

compareScreenshot()​

compareScreenshot(name, options?): Promise<void>

Compares a screenshot of the current page against a stored baseline.

Parameters​

name​

string

Snapshot file name (e.g. 'po-list.png').

options?​

VisualRegressionOptions

Optional comparison settings.

Returns​

Promise<void>

Example​

await visualRegression.compareScreenshot('login-page.png');

maskFLPChrome()​

maskFLPChrome(): Locator[]

Returns locators for the three standard FLP shell chrome elements.

Returns​

Locator[]

Remarks​

Pass the returned array as the mask option to compareScreenshot to exclude session-specific shell content from visual comparisons.

Example​

const flpMask = visualRegression.maskFLPChrome();
await visualRegression.compareScreenshot('detail.png', { mask: flpMask });