@axe-core/webdriverjs 4.7.2-alpha.392 → 4.7.2-alpha.394
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.
- package/README.md +21 -26
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -5
- package/dist/index.mjs +2 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -10,21 +10,9 @@ Install [Node.js](https://docs.npmjs.com/getting-started/installing-node) if you
|
|
|
10
10
|
|
|
11
11
|
> Download and install any necessary browser drivers on your machine's PATH. [More on Webdriver setup](https://www.selenium.dev/documentation/en/webdriver/).
|
|
12
12
|
|
|
13
|
-
Install Selenium Webdriver: `npm install selenium-webdriver
|
|
13
|
+
Install Selenium Webdriver: `npm install selenium-webdriver`
|
|
14
14
|
|
|
15
|
-
Install @axe-core/webdriverjs
|
|
16
|
-
|
|
17
|
-
NPM:
|
|
18
|
-
|
|
19
|
-
```console
|
|
20
|
-
npm install @axe-core/webdriverjs
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Yarn:
|
|
24
|
-
|
|
25
|
-
```console
|
|
26
|
-
yarn add @axe-core/webdriverjs
|
|
27
|
-
```
|
|
15
|
+
Install @axe-core/webdriverjs: `npm install @axe-core/webdriverjs`
|
|
28
16
|
|
|
29
17
|
## Usage
|
|
30
18
|
|
|
@@ -33,19 +21,26 @@ This module uses a chainable API to assist in injecting, configuring, and analyz
|
|
|
33
21
|
Here is an example of a script that will drive WebdriverJS to a page, perform an analysis, and then log results to the console.
|
|
34
22
|
|
|
35
23
|
```js
|
|
36
|
-
const AxeBuilder = require('@axe-core/webdriverjs');
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
driver
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
const { AxeBuilder } = require('@axe-core/webdriverjs');
|
|
25
|
+
const { Builder } = require('selenium-webdriver');
|
|
26
|
+
const chrome = require('selenium-webdriver/chrome');
|
|
27
|
+
|
|
28
|
+
(async () => {
|
|
29
|
+
const driver = Builder()
|
|
30
|
+
.forBrowser('chrome')
|
|
31
|
+
.setChromeOptions(new chrome.Options().headless())
|
|
32
|
+
.build();
|
|
33
|
+
await driver.get('https://dequeuniversity.com/demo/mars/');
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
const results = await new AxeBuilder(driver).analyze();
|
|
46
37
|
console.log(results);
|
|
47
|
-
})
|
|
48
|
-
|
|
38
|
+
} catch(e) {
|
|
39
|
+
// do something with the error
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
await driver.quit();
|
|
43
|
+
})();
|
|
49
44
|
```
|
|
50
45
|
|
|
51
46
|
## AxeBuilder(driver: Webdriver.WebDriver[, axeSource: string])
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,7 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
-
|
|
33
|
+
AxeBuilder: () => AxeBuilder,
|
|
34
|
+
default: () => AxeBuilder
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(src_exports);
|
|
36
37
|
var import_axe_core2 = __toESM(require("axe-core"));
|
|
@@ -514,7 +515,7 @@ ${error2}`
|
|
|
514
515
|
return res;
|
|
515
516
|
}
|
|
516
517
|
};
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
519
|
+
0 && (module.exports = {
|
|
520
|
+
AxeBuilder
|
|
521
|
+
});
|
package/dist/index.mjs
CHANGED
|
@@ -480,10 +480,7 @@ ${error2}`
|
|
|
480
480
|
return res;
|
|
481
481
|
}
|
|
482
482
|
};
|
|
483
|
-
if (typeof module === "object") {
|
|
484
|
-
exports = module.exports = AxeBuilder;
|
|
485
|
-
}
|
|
486
|
-
var src_default = AxeBuilder;
|
|
487
483
|
export {
|
|
488
|
-
|
|
484
|
+
AxeBuilder,
|
|
485
|
+
AxeBuilder as default
|
|
489
486
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axe-core/webdriverjs",
|
|
3
|
-
"version": "4.7.2-alpha.
|
|
3
|
+
"version": "4.7.2-alpha.394+4a55913",
|
|
4
4
|
"description": "Provides a method to inject and analyze web pages using axe",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"scripts": {
|
|
49
49
|
"prebuild": "rimraf dist",
|
|
50
50
|
"build": "tsup src/index.ts --dts --format esm,cjs",
|
|
51
|
-
"test": "mocha --timeout
|
|
52
|
-
"test:esm": "node esmTest.mjs",
|
|
51
|
+
"test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
|
|
52
|
+
"test:esm": "node test/esmTest.mjs",
|
|
53
53
|
"coverage": "nyc npm run test",
|
|
54
54
|
"prepare": "npm run build"
|
|
55
55
|
},
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"functions": 85,
|
|
120
120
|
"lines": 85
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "4a5591347aeb1ee09c23a5543a0cf8c9c01cb5ea"
|
|
123
123
|
}
|