import { expect, Locator, Page } from "@playwright/test";

export const verifyScreenshot = async (snapshotName: string, target: Page | Locator, mask?: Locator[]) => {
    expect(async () => {
        expect(await target.screenshot({
            mask
        })).toMatchSnapshot(snapshotName)
    }).toPass();
}

export const takeScreenshot = async (snapshotName: string, target: Page | Locator, mask?: Locator[]) => {
    expect(await target.screenshot({
        mask
    })).toMatchSnapshot(snapshotName)
}