@axe-core/playwright 4.2.3-alpha.191 → 4.2.3-alpha.192
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/error-handling.md +42 -0
- package/package.json +2 -2
package/error-handling.md
CHANGED
|
@@ -1 +1,43 @@
|
|
|
1
1
|
# Error Handling
|
|
2
|
+
|
|
3
|
+
## Table of Content
|
|
4
|
+
|
|
5
|
+
1. [Having Popup blockers enabled](#having-popup-blockers-enabled)
|
|
6
|
+
2. [AxeBuilder.setLegacyMode(legacy: boolean)](#axebuildersetlegacymodelegacy-boolean)
|
|
7
|
+
|
|
8
|
+
Version 4.3.0 and above of the axe-core integrations use a new technique when calling `AxeBuilder.analyze()` which opens a new window at the end of a run. Many of the issues outlined in this document address common problems with this technique and their potential solutions.
|
|
9
|
+
|
|
10
|
+
### Having Popup blockers enabled
|
|
11
|
+
|
|
12
|
+
Popup blockers prevent us from opening the new window when calling `AxeBuilder.analyze()`. The default configuration for most automation testing libraries should allow popups. Please make sure that you do not explicitly enable popup blockers which may cause an issue while running the tests.
|
|
13
|
+
|
|
14
|
+
### AxeBuilder.setLegacyMode(legacy: boolean)
|
|
15
|
+
|
|
16
|
+
If for some reason you are unable to run the new `AxeBuilder.analyze` technique without errors, axe provides a new chainable method that allows you to run the legacy version of `AxeBuilder.analyze`. When using this method axe excludes accessibility issues that may occur in cross-domain frames and iframes.
|
|
17
|
+
|
|
18
|
+
**Please Note:** `AxeBuilder.setLegacyMode` is deprecated and will be removed in v5.0. Please report any errors you may have while running `AxeBuilder.analyze` so that they can be fixed before the legacy version is removed.
|
|
19
|
+
|
|
20
|
+
#### Example:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
const AxeBuilder = require('@axe-core/playwright').default;
|
|
24
|
+
const playwright = require('playwright');
|
|
25
|
+
|
|
26
|
+
(async () => {
|
|
27
|
+
const browser = await playwright.chromium.launch();
|
|
28
|
+
const context = await browser.newContext();
|
|
29
|
+
const page = await context.newPage();
|
|
30
|
+
await page.goto('https://dequeuniversity.com/demo/mars/');
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const results = await new AxeBuilder({ page })
|
|
34
|
+
// enables legacy mode
|
|
35
|
+
.setLegacyMode()
|
|
36
|
+
.analyze();
|
|
37
|
+
console.log(results);
|
|
38
|
+
} catch (e) {
|
|
39
|
+
// do something with the error
|
|
40
|
+
}
|
|
41
|
+
await browser.close();
|
|
42
|
+
})();
|
|
43
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axe-core/playwright",
|
|
3
|
-
"version": "4.2.3-alpha.
|
|
3
|
+
"version": "4.2.3-alpha.192+d49359f",
|
|
4
4
|
"description": "Provides a method to inject and analyze web pages using axe",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"functions": 100,
|
|
78
78
|
"lines": 95
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "d49359f3e105cabf9b2c9ca7883f872a1e7ed694"
|
|
81
81
|
}
|