
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
@gemini-testing/playwright-utils
Advanced tools
Usefull playwright utilities, such as fixtures, custom commands and matchers.
npm install --save-dev @gemini-testing/playwright-utils
looks-same based visual comparison. It uses CIEDE2000 based tolerance instead of pixelmatch (which is used under the hood of toHaveScreenshot
) YIQ NTSC transmission color space threshold, which has severe problems calculating the color difference in shades of blue.
Setup:
// playwright.ts
import { test as base, expect } from "@playwright/test";
import { createMatchersFixture, type PlaywrightUtilsOptions } from "@gemini-testing/playwright-utils";
const test = base.extend<PlaywrightTestOptions & PlaywrightUtilsOptions>({
...createMatchersFixture(expect)
});
export { test, expect };
// playwright.config.ts
import { defineConfig, type PlaywrightTestOptions } from "@playwright/test";
import type { PlaywrightUtilsOptions } from "@gemini-testing/playwright-utils";
export default defineConfig<PlaywrightTestOptions, PlaywrightUtilsOptions>({
// ...
use: {
// ...
toMatchScreenshot: {
// Default project config
tolerance: 2.3,
antialiasingTolerance: 4,
maxDiffPixels: 0,
maxDiffPixelRatio: 0,
stopOnFirstImageDiff: false,
saveImageOnScreenshotMatch: true,
animations: "disabled",
caret: "hide",
maskColor: "#FF00FF",
scale: "css",
timeout: 30000,
fullPage: false,
}
}
});
Usage:
await expect(page.locator("body")).toMatchScreenshot("plain", {
// Comparison options, have higher priority than project options
maxDiffPixels: 3
});
Args:
string
Object
number
number
boolean
- Used by [html-reporter][html-reporter]'s diffBubblesnumber
- Used by [html-reporter][html-reporter]'s diffBubblesnumber
number
boolean
- Stop test execution immediately after image comparison errorboolean
- Save image on image comparison success (used by reporters)"disabled" | "allow"
"hide" | "initial"
string
"css" | "device"
boolean
number
- Screenshot capturing timeouttoHaveScreenshot
:toHaveScreenshot
calls without specified name
, it is required to name them.toHaveScreenshot
options from expect
section of playwright config to toMatchScreenshot
at use
section of playwright config, then remove threshold
property (toMatchScreenshot
uses tolerance
instead. Preferred value is 2.3).Note: Screenshot comparison errors, caused by toMatchScreenshot
, won't stop test execution by default. You can configure it with stopOnFirstImageDiff
option.
FAQs
Usefull playwright utilities
The npm package @gemini-testing/playwright-utils receives a total of 27 weekly downloads. As such, @gemini-testing/playwright-utils popularity was classified as not popular.
We found that @gemini-testing/playwright-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.