Skip to content

Commit

Permalink
chore(clip): add puppeteer getBoundingClientRect handling
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Sep 18, 2023
1 parent 496fde5 commit 9bd141b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
9 changes: 8 additions & 1 deletion kayle/lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
}

Expand Down
2 changes: 1 addition & 1 deletion kayle/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion kayle/tests/clips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9bd141b

Please sign in to comment.