diff --git a/README.md b/README.md index 1e5f4d0..674c91b 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,6 @@ const results = await autoKayle({ ## Clips You can include base64 images with the audits to get a visual of the exact location of the issue. -Currently this is only supported with playwright with default chrome launch args. ```ts const results = await kayle({ diff --git a/kayle/lib/kayle.ts b/kayle/lib/kayle.ts index 4e176f7..03a0d27 100644 --- a/kayle/lib/kayle.ts +++ b/kayle/lib/kayle.ts @@ -138,12 +138,7 @@ export const kayle = async ( o.clipDir.endsWith("/") ? "" : "/" }${selector.trim()}.png` : undefined, - clip: { - x: clip.x, - y: clip.y, - width: clip.width, - height: clip.height, - }, + clip, }); // use a dynamic property to inject - todo: set the config initially before this iteration to keep shape aligned. diff --git a/kayle/lib/runner.ts b/kayle/lib/runner.ts index 482f178..d810f4f 100644 --- a/kayle/lib/runner.ts +++ b/kayle/lib/runner.ts @@ -54,7 +54,14 @@ context = getElementContext(issue.element); selector = getElementSelector(issue.element); if (cliped) { - clip = issue.element.getBoundingClientRect(); + const { x, y, width, height } = issue.element.getBoundingClientRect(); + + clip = { + x, + y, + width, + height, + }; } } diff --git a/kayle/package.json b/kayle/package.json index 9ded678..1ffb1f2 100644 --- a/kayle/package.json +++ b/kayle/package.json @@ -1,6 +1,6 @@ { "name": "kayle", - "version": "0.6.0", + "version": "0.6.1", "description": "Extremely fast and accurate accessibility engine built for any headless tool like playwright or puppeteer.", "main": "./build/index.js", "keywords": [ diff --git a/kayle/tests/clips.ts b/kayle/tests/clips.ts index acb3740..c4b895a 100644 --- a/kayle/tests/clips.ts +++ b/kayle/tests/clips.ts @@ -26,7 +26,7 @@ import { performance } from "perf_hooks"; }); const nextTime = performance.now() - startTime; - console.log(issues) + console.log(issues); console.log(`Issue count ${issues.length}`); console.log(meta);