/
githubmirror
/
tabler
Обзор
Документация
Войти
/
githubmirror
/
tabler
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.2.0
tests/visual.test.ts
18 строк
552 B
codecalm
Add threshold option to argosScreenshot for improved visual comparison
19 фев 2025, 04:09
19 фев 2025, 04:09
b0a62b7
Код
Авторство
О чём код?
import test, { expect } from '@playwright/test'; import { argosScreenshot } from "@argos-ci/playwright" import fs from "fs" import path from "path" const previewDir = path.join(__dirname, "../preview/dist") const htmlFiles = fs.readdirSync(previewDir).filter((file) => file.endsWith(".html")) 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}`, { threshold: 0.7, }) }) }