@lewiswright/vitest-plugin-vis
Version:
Vitest visual testing plugin
14 lines (13 loc) • 462 B
JavaScript
export function playwright(context) {
return {
async takeScreenshot(filePath, selector, options) {
// The `Locator` type from `vitest` has less props than the `Locator` in `playwright`
const subject = context.iframe.locator(selector);
return subject.screenshot({
timeout: options?.timeout,
animations: 'disabled',
path: filePath,
});
},
};
}