forked from patternfly/patternfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patternfly-a11y.config.js
81 lines (78 loc) · 2.19 KB
/
patternfly-a11y.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const { fullscreenRoutes } = require('@patternfly/documentation-framework/routes');
async function waitFor(page) {
await page.waitForSelector('#root > *');
}
const urls = Object.keys(fullscreenRoutes)
.map(key => {
if (fullscreenRoutes[key].isFullscreenOnly) {
return key;
} else {
const path = fullscreenRoutes[key].path
if (path.match(/\/patterns\/.*\/html-demos$/g)) {
return path.replace(/\/html-demos$/, '');
} else {
if (
path.includes('/application-launcher/') |
path.includes('/options-menu/') |
path.includes('/dropdown/') |
path.includes('/select/')
) {
return path.replace(/\/html-deprecated$/, '')
} else if (
path.includes('/password-generator/') |
path.includes('/password-strength/')
) {
return path.replace(/\/html-demos$/, '');
}
return path.replace(/\/html$/, '')
}
}
})
.reduce((result, item) => (result.includes(item) ? result : [...result, item]), []);
module.exports = {
prefix: 'http://localhost:5000',
waitFor,
crawl: false,
urls: [
{
url: '/',
label: 'home fullscreen nav expanded',
viewportDimensions: { width: 1920, height: 1080 },
afterNav: async page => {
await page.click('button#nav-toggle');
}
},
{
url: '/',
label: 'home fullscreen nav collapsed',
viewportDimensions: { width: 1920, height: 1080 }
},
{
url: '/',
label: 'home mobile nav collapsed',
viewportDimensions: { width: 400, height: 900 }
},
{
url: '/',
label: 'home mobile nav expanded',
viewportDimensions: { width: 400, height: 900 },
afterNav: async page => {
await page.click('button#nav-toggle');
}
},
{
url: '/components/table',
label: 'html table content on mobile screen',
viewportDimensions: { width: 400, height: 900 }
},
...urls
],
ignoreRules: [
'color-contrast',
'landmark-no-duplicate-main',
'landmark-main-is-top-level',
'scrollable-region-focusable'
].join(','),
ignoreIncomplete: true,
skip: '(mailto)|(/(developer-resources)/.+)'
};