Skip to content

Commit

Permalink
chore(runners): remove expiremental ace
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Dec 24, 2023
1 parent 0556cfb commit 19d39a9
Show file tree
Hide file tree
Showing 15 changed files with 2,172 additions and 2,303 deletions.
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
compressionLevel: mixed

enableGlobalCache: false

nodeLinker: node-modules
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const page = await browser.newPage();
const results = await kayle({
page,
browser,
runners: ["htmlcs"] // options are "htmlcs", "axe", and "ace". The order is from fastest to slowest. Defaults to htmlcs.
runners: ["htmlcs"] // options are "htmlcs" and "axe". The order is from fastest to slowest. Defaults to htmlcs.
origin: "https://a11ywatch.com",
// html: "<html>...</html>"
});
Expand Down Expand Up @@ -76,13 +76,11 @@ const results = await autoKayle({
# Rust/WASM 10.863582968711853
# FAST_HTMLCS 29.915208011865616
# FAST_AXE 162.87204200029373
# ACE 512.5237080156803

# playwright - the speed depends on the version
# Rust/WASM TIME 10.163457989692688
# FAST_HTMLCS TIME 33.50962498784065
# FAST_AXE TIME 203.2565419971943
# ACE TIME 905.6748749911785
```

## Clips
Expand All @@ -109,7 +107,6 @@ const results = await kayle({

- [`fast_axecore`](./fast_htmlcs/README.md): run tests using fork of [axe-core](./lib/runners/axe.ts).
- [`fast_htmlcs`](./fast_htmlcs/README.md): run tests using fork of [HTML CodeSniffer](./lib/runners/htmlcs.ts).
- `ace`: run tests using [IBM ACE](https://github.com/IBMa/equal-access/blob/master/accessibility-checker-engine/README.md)
- `custom`: custom runners using `injectRunner` util.

## Linting
Expand Down Expand Up @@ -149,7 +146,7 @@ type RunnerConfig = {
// only allow WCAG RULES.
rules?: string[];
// axe or htmlcs - the forks.
runners?: ("axe" | "htmlcs" | "ace")[];
runners?: ("axe" | "htmlcs")[];
// the accessibility standard.
standard?: Standard;
// stop test that go beyond time.
Expand Down
1 change: 0 additions & 1 deletion kayle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ kayle supports multiple test runners which return different results. The built-i

- `axe`: run tests using [axe-core](./lib/runners/axe.ts).
- `htmlcs` (default): run tests using [HTML CodeSniffer](./lib/runners/htmlcs.ts)
- `ace`: run tests using [IBM ACE](https://github.com/IBMa/equal-access/blob/master/accessibility-checker-engine/README.md)
- `custom`: custom runners using `injectRunner` util.

## Playwright/Puppeteer
Expand Down
2 changes: 1 addition & 1 deletion kayle/lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type Issue = {
message: string;
type: "error" | "warning" | "notice";
typeCode: number;
runner: "htmlcs" | "axe" | "ace" | "a11ywatch";
runner: "htmlcs" | "axe" | "a11ywatch";
runnerExtras: Record<string, unknown>;
recurrence: number;
selector: string;
Expand Down
2 changes: 1 addition & 1 deletion kayle/lib/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function extractArgs(o, watcher?: Watcher) {
// default to a runner
if (
!options.runners.some(
(runner) => runner === "axe" || runner === "htmlcs" || runner === "ace"
(runner) => runner === "axe" || runner === "htmlcs"
// ||
// // wasm build when released
// runner === "kayle"
Expand Down
8 changes: 0 additions & 8 deletions kayle/lib/runner-js.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { readFileSync } from "fs";
import { axeRunner } from "./runners/axe";
import { htmlcsRunner } from "./runners/htmlcs";
import { aceRunner } from "./runners/ace";

const loadRunnerFile = (run, langauge) => {
if (run === "htmlcs") {
Expand All @@ -12,10 +11,6 @@ const loadRunnerFile = (run, langauge) => {
return axeRunner[langauge || "en"];
}

if (run === "ace") {
return aceRunner[langauge || "en"];
}

return require(run);
};

Expand Down Expand Up @@ -57,9 +52,6 @@ const runnersJavascript = {
axe_ko: loadRunnerScript("axe", "ko"),
// axe_no_NB: loadRunnerScript("axe", "no-NB"),
// axe_pt_BR: loadRunnerScript("axe", "pt-BR"),
// expiremental
// ace by IBM
ace: loadRunnerScript("ace", ""),
};

// inject a new runner for testing
Expand Down
4 changes: 2 additions & 2 deletions kayle/lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
const A_2 = "duplicate-id";
const H_2 = "Principle4.Guideline41.411.F77";
const IA_2 = "Principle4.Guideline4_1.4_1_1.F77";
// element_id_unique todo: add optional 3rd ref to track combo for ace runner
// element_id_unique
const A_3 = "empty-heading";
const H_3 = "Principle1.Guideline13.131.H42.2";
const IA_3 = "Principle1.Guideline1_3.1_3_1.H42.2";
Expand Down Expand Up @@ -106,7 +106,7 @@
type: issue.type || issueCodeReverseMap[typeCode],
typeCode: typeCode || 0,
message: issue.message,
runner: issue.runner ? issue.runner : issue.bounds ? "ace" : "kayle",
runner: issue.runner ? issue.runner : "kayle",
runnerExtras: issue.runnerExtras,
recurrence: issue.recurrence || 0,
clip: issue.bounds
Expand Down
53 changes: 0 additions & 53 deletions kayle/lib/runners/ace.ts

This file was deleted.

6 changes: 2 additions & 4 deletions kayle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kayle",
"version": "0.7.13",
"version": "0.8.0",
"description": "Extremely fast and accurate accessibility engine built for any headless tool like playwright or puppeteer.",
"main": "./build/index.js",
"keywords": [
Expand All @@ -9,8 +9,7 @@
"a11ywatch",
"web-accessibility-automation",
"axe",
"htmlcs",
"ace"
"htmlcs"
],
"author": "Jeff Mendez",
"contributors": [
Expand Down Expand Up @@ -41,7 +40,6 @@
"test:puppeteer": "npm run compile:test && node _tests/tests/basic.js",
"test:puppeteer:axe": "npm run compile:test && node _tests/tests/basic-axe.js",
"test:puppeteer:htmlcs": "npm run compile:test && node _tests/tests/basic-htmlcs.js",
"test:puppeteer:ace": "npm run compile:test && node _tests/tests/basic-ace.js",
"test:missing": "npm run compile:test && node _tests/tests/missing.js",
"test:selectors": "npm run compile:test && node _tests/tests/selectors.js",
"test:playwright": "npm run compile:test && npx playwright test ./tests/basic-playwright.spec.ts",
Expand Down
40 changes: 0 additions & 40 deletions kayle/tests/basic-ace.ts

This file was deleted.

4 changes: 2 additions & 2 deletions kayle/tests/full.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// run fast_axe, fast_htmlcs, and ace
// run fast_axe and fast_htmlcs
import assert from "assert";
import puppeteer from "puppeteer";
import { Standard, kayle } from "kayle";
Expand All @@ -15,7 +15,7 @@ import { performance } from "perf_hooks";
const { issues, pageUrl, documentTitle, meta, automateable } = await kayle({
page,
browser,
runners: ["htmlcs", "axe", "ace"],
runners: ["htmlcs", "axe"],
includeWarnings: true,
html: drakeMock,
standard: Standard.WCAG2AA,
Expand Down
18 changes: 2 additions & 16 deletions kayle/tests/innate-playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { performance } from "perf_hooks";
import { test } from "@playwright/test";
import { _audit_not_ready } from "kayle_innate";

test("kayle_innate, fast_htmlcs, fast_axecore, and ace audit drakeMock profiling compare", async ({
test("kayle_innate, fast_htmlcs and fast_axecore audit drakeMock profiling compare", async ({
page,
browser,
}, _) => {
Expand All @@ -24,7 +24,7 @@ test("kayle_innate, fast_htmlcs, fast_axecore, and ace audit drakeMock profiling
""
);
const startTime = performance.now();
const audit = await _audit_not_ready(mock, css, false);
await _audit_not_ready(mock, css, false);
const nextTime = performance.now() - startTime;
console.log("Rust/WASM TIME ", nextTime);

Expand Down Expand Up @@ -53,18 +53,4 @@ test("kayle_innate, fast_htmlcs, fast_axecore, and ace audit drakeMock profiling
});
const n = performance.now() - s;
console.log("FAST_AXE TIME", n);

const a = performance.now();
await kayle({
page,
browser,
runners: ["ace"],
includeWarnings: true,
origin: "https://www.drake.com",
html: drakeMock,
noIntercept: true,
});
const an = performance.now() - a;
console.log("ACE TIME", an);
console.log(`Rust Audit: `, audit);
});
16 changes: 1 addition & 15 deletions kayle/tests/innate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { _audit_not_ready } from "kayle_innate";
);

const startTime = performance.now();
const audit = await _audit_not_ready(mock, css, false);
await _audit_not_ready(mock, css, false);
const nextTime = performance.now() - startTime;
console.log("Rust/WASM TIME ", nextTime);

Expand Down Expand Up @@ -63,19 +63,5 @@ import { _audit_not_ready } from "kayle_innate";
const n = performance.now() - s;
console.log("FAST_AXE TIME", n);

const a = performance.now();
await kayle({
page,
browser,
runners: ["ace"],
includeWarnings: true,
origin: "https://www.drake.com",
html: drakeMock,
noIntercept: true,
});
const an = performance.now() - a;
console.log("ACE TIME", an);
console.log(`Rust Audit: `, audit);

await browser.close();
})();
2 changes: 1 addition & 1 deletion kayle_innate/kayle_innate/tests/mock.rs

Large diffs are not rendered by default.

Loading

0 comments on commit 19d39a9

Please sign in to comment.