浏览代码

Add threshold option to argosScreenshot for improved visual comparison

codecalm 6 月之前
父节点
当前提交
b0a62b7cf5
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      tests/visual.test.ts

+ 3 - 1
tests/visual.test.ts

@@ -11,6 +11,8 @@ for (const file of htmlFiles) {
 	test(`Compare ${file}`, async ({ page }) => {
 		await page.goto(`file://${path.join(previewDir, file)}`)
 		await page.waitForLoadState("networkidle")
-		await argosScreenshot(page, `${file}`)
+		await argosScreenshot(page, `${file}`, {
+			threshold: 0.7,
+		})
 	})
 }