1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "baseline": {
12 "violations": [
13 {
14 "id": "button-name",
15 "impact": "serious",
16 "help": "Buttons must have discernible text",
17 "helpUrl": "https://dequeuniversity.com/rules/axe/4.10/button-name",
18 "tags": [
19 "wcag2a",
20 "wcag412"
21 ],
22 "nodes": [
23 {
24 "target": [
25 "#save-button"
26 ]
27 }
28 ]
29 }
30 ]
31 },
32 "current": {
33 "violations": [
34 {
35 "id": "image-alt",
36 "impact": "critical",
37 "help": "Images must have alternative text",
38 "helpUrl": "https://dequeuniversity.com/rules/axe/4.10/image-alt",
39 "tags": [
40 "wcag2a",
41 "wcag111"
42 ],
43 "nodes": [
44 {
45 "target": [
46 "img.hero"
47 ]
48 }
49 ]
50 }
51 ]
52 }
53};
54
55
56const run = await client.actor("enfex/wcag-regression-diff-auditor").call(input);
57
58
59console.log('Results from dataset');
60console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
61const { items } = await client.dataset(run.defaultDatasetId).listItems();
62items.forEach((item) => {
63 console.dir(item);
64});
65
66