@axe-core/webdriverjs 4.8.2-9a65b64.0 → 4.8.2-b07d38c.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,84 @@
1
+ import { WebDriver } from 'selenium-webdriver';
2
+ import { AxeResults, SerialFrameSelector, RunOptions, Spec } from 'axe-core';
3
+
4
+ interface BuilderOptions {
5
+ noSandbox?: boolean;
6
+ logIframeErrors?: boolean;
7
+ }
8
+ type CallbackFunction = (error: Error | null, results: AxeResults | null) => void;
9
+
10
+ declare class AxeBuilder {
11
+ private driver;
12
+ private axeSource;
13
+ private includes;
14
+ private excludes;
15
+ private option;
16
+ private config;
17
+ private builderOptions;
18
+ private legacyMode;
19
+ private errorUrl;
20
+ constructor(driver: WebDriver, axeSource?: string | null, builderOptions?: BuilderOptions);
21
+ /**
22
+ * Selector to include in analysis.
23
+ * This may be called any number of times.
24
+ */
25
+ include(selector: SerialFrameSelector): this;
26
+ /**
27
+ * Selector to exclude in analysis.
28
+ * This may be called any number of times.
29
+ */
30
+ exclude(selector: SerialFrameSelector): this;
31
+ /**
32
+ * Set options to be passed into axe-core
33
+ */
34
+ options(options: RunOptions): this;
35
+ /**
36
+ * Limit analysis to only the specified rules.
37
+ * Cannot be used with `AxeBuilder#withTags`
38
+ */
39
+ withRules(rules: string | string[]): this;
40
+ /**
41
+ * Limit analysis to only specified tags.
42
+ * Cannot be used with `AxeBuilder#withRules`
43
+ */
44
+ withTags(tags: string | string[]): this;
45
+ /**
46
+ * Set the list of rules to skip when running an analysis.
47
+ */
48
+ disableRules(rules: string | string[]): this;
49
+ /**
50
+ * Set configuration for `axe-core`.
51
+ * This value is passed directly to `axe.configure()`
52
+ */
53
+ configure(config: Spec): this;
54
+ /**
55
+ * Performs an analysis and retrieves results.
56
+ */
57
+ analyze(callback?: CallbackFunction): Promise<AxeResults>;
58
+ /**
59
+ * Use frameMessenger with <same_origin_only>
60
+ *
61
+ * This disables use of axe.runPartial() which is called in each frame, and
62
+ * axe.finishRun() which is called in a blank page. This uses axe.run() instead,
63
+ * but with the restriction that cross-origin frames will not be tested.
64
+ */
65
+ setLegacyMode(legacyMode?: boolean): this;
66
+ /**
67
+ * Analyzes the page, returning a promise
68
+ */
69
+ private analyzePromise;
70
+ /**
71
+ * Use axe.run() to get results from the page
72
+ */
73
+ private runLegacy;
74
+ /**
75
+ * Get partial results from the current context and its child frames
76
+ */
77
+ private runPartialRecursive;
78
+ /**
79
+ * Use axe.finishRun() to turn partial results into actual results
80
+ */
81
+ private finishRun;
82
+ }
83
+
84
+ export { AxeBuilder, AxeBuilder as default };
package/dist/index.js CHANGED
@@ -528,6 +528,11 @@ ${error2}`
528
528
  return res;
529
529
  }
530
530
  };
531
+ if (typeof module === "object") {
532
+ module.exports = AxeBuilder;
533
+ module.exports.default = AxeBuilder;
534
+ module.exports.AxeBuilder = AxeBuilder;
535
+ }
531
536
  // Annotate the CommonJS export names for ESM import in node:
532
537
  0 && (module.exports = {
533
538
  AxeBuilder
package/dist/index.mjs CHANGED
@@ -493,6 +493,11 @@ ${error2}`
493
493
  return res;
494
494
  }
495
495
  };
496
+ if (typeof module === "object") {
497
+ module.exports = AxeBuilder;
498
+ module.exports.default = AxeBuilder;
499
+ module.exports.AxeBuilder = AxeBuilder;
500
+ }
496
501
  export {
497
502
  AxeBuilder,
498
503
  AxeBuilder as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axe-core/webdriverjs",
3
- "version": "4.8.2-9a65b64.0+9a65b64",
3
+ "version": "4.8.2-b07d38c.0+b07d38c",
4
4
  "description": "Provides a method to inject and analyze web pages using axe",
5
5
  "contributors": [
6
6
  {
@@ -49,7 +49,9 @@
49
49
  "prebuild": "rimraf dist",
50
50
  "build": "tsup src/index.ts --dts --format esm,cjs",
51
51
  "test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
52
+ "test:export": "npm run test:esm && npm run test:commonjs",
52
53
  "test:esm": "node test/esmTest.mjs",
54
+ "test:commonjs": "node test/commonjsTest.js",
53
55
  "coverage": "nyc npm run test",
54
56
  "prepare": "npm run build"
55
57
  },
@@ -70,9 +72,9 @@
70
72
  "@types/chromedriver": "^81.0.1",
71
73
  "@types/express": "^4.17.14",
72
74
  "@types/mocha": "^10.0.0",
73
- "@types/node": "^18.8.3",
75
+ "@types/node": "^20.8.10",
74
76
  "@types/selenium-webdriver": "^4.1.5",
75
- "@types/test-listen": "^1.1.0",
77
+ "async-listen": "^3.0.1",
76
78
  "axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
77
79
  "chai": "^4.3.6",
78
80
  "chromedriver": "latest",
@@ -81,9 +83,8 @@
81
83
  "nyc": "^15.1.0",
82
84
  "rimraf": "^5.0.5",
83
85
  "selenium-webdriver": "^4.8.1",
84
- "test-listen": "^1.1.0",
85
86
  "ts-node": "^10.9.1",
86
- "tsup": "^6.7.0",
87
+ "tsup": "^7.2.0",
87
88
  "typescript": "^4.8.4"
88
89
  },
89
90
  "dependencies": {
@@ -111,5 +112,5 @@
111
112
  "functions": 85,
112
113
  "lines": 85
113
114
  },
114
- "gitHead": "9a65b64304f7b4c375892eeb2d2fa6fb6c71ac87"
115
+ "gitHead": "b07d38cc2d85c6127391686482abf762758dce34"
115
116
  }