@axe-core/playwright 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 +5 -28
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -0
- package/dist/index.mjs +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -6,33 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
Install [Node.js](https://docs.npmjs.com/getting-started/installing-node) if you haven't already.
|
|
8
8
|
|
|
9
|
-
Install Playwright:
|
|
9
|
+
Install Playwright: `npm install playwright`
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```console
|
|
14
|
-
npm install playwright
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Yarn:
|
|
18
|
-
|
|
19
|
-
```console
|
|
20
|
-
yarn add playwright
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Install `@axe-core/playwright` and its dependencies:
|
|
24
|
-
|
|
25
|
-
NPM:
|
|
26
|
-
|
|
27
|
-
```console
|
|
28
|
-
npm install @axe-core/playwright
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Yarn:
|
|
32
|
-
|
|
33
|
-
```console
|
|
34
|
-
yarn add @axe-core/playwright
|
|
35
|
-
```
|
|
11
|
+
Install @axe-core/playwright: `npm install @axe-core/playwright`
|
|
36
12
|
|
|
37
13
|
## Usage
|
|
38
14
|
|
|
@@ -41,11 +17,11 @@ This module uses a chainable API to assist in injecting, configuring, and analyz
|
|
|
41
17
|
Here is an example of a script that will drive Playwright to a page, perform an analysis, and then log results to the console.
|
|
42
18
|
|
|
43
19
|
```js
|
|
44
|
-
const AxeBuilder = require('@axe-core/playwright')
|
|
20
|
+
const { AxeBuilder } = require('@axe-core/playwright');
|
|
45
21
|
const playwright = require('playwright');
|
|
46
22
|
|
|
47
23
|
(async () => {
|
|
48
|
-
const browser = await playwright.chromium.launch();
|
|
24
|
+
const browser = await playwright.chromium.launch({ headless: true });
|
|
49
25
|
const context = await browser.newContext();
|
|
50
26
|
const page = await context.newPage();
|
|
51
27
|
await page.goto('https://dequeuniversity.com/demo/mars/');
|
|
@@ -56,6 +32,7 @@ const playwright = require('playwright');
|
|
|
56
32
|
} catch (e) {
|
|
57
33
|
// do something with the error
|
|
58
34
|
}
|
|
35
|
+
|
|
59
36
|
await browser.close();
|
|
60
37
|
})();
|
|
61
38
|
```
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
AxeBuilder: () => AxeBuilder,
|
|
33
34
|
default: () => AxeBuilder
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -367,3 +368,7 @@ var AxeBuilder = class {
|
|
|
367
368
|
`;
|
|
368
369
|
}
|
|
369
370
|
};
|
|
371
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
372
|
+
0 && (module.exports = {
|
|
373
|
+
AxeBuilder
|
|
374
|
+
});
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axe-core/playwright",
|
|
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
|
{
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"scripts": {
|
|
43
43
|
"prebuild": "rimraf dist",
|
|
44
44
|
"build": "tsup src/index.ts --dts --format esm,cjs",
|
|
45
|
-
"test": "mocha --timeout 60000 -r ts-node/register '
|
|
46
|
-
"test:esm": "node esmTest.mjs",
|
|
45
|
+
"test": "mocha --timeout 60000 -r ts-node/register 'test/**.spec.ts'",
|
|
46
|
+
"test:esm": "node test/esmTest.mjs",
|
|
47
47
|
"coverage": "nyc npm run test",
|
|
48
|
-
"prepare": "npm run build"
|
|
48
|
+
"prepare": "npx playwright install && npm run build"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"axe-core": "^4.7.0"
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"functions": 100,
|
|
91
91
|
"lines": 95
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "4a5591347aeb1ee09c23a5543a0cf8c9c01cb5ea"
|
|
94
94
|
}
|