-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpa11y-ci.js
117 lines (112 loc) · 3.31 KB
/
pa11y-ci.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
const defaults = {
timeout: 30000,
standard: 'WCAG2AA',
runners: ['axe'],
viewport: {
width: 1300,
height: 1200,
},
chromeLaunchConfig: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
},
};
const log = {
debug: console.log,
error: console.error,
info: console.log,
};
const loginActions = [
'wait for path to be /login',
'screen capture captures/login.png',
'click element button',
'wait for element #username to be visible',
'screen capture captures/login1.png',
`set field #username to ${process.env.E2E_TEST_USERNAME}`,
'screen capture captures/login2.png',
`set field #password to ${process.env.E2E_TEST_PASSWORD}`,
'screen capture captures/login3.png',
'click element #kc-login',
'wait for url to be http://localhost:3000/applicants',
'wait for element table to be visible',
'wait for element .animate-spin to be removed',
];
const urls = [
{
// applicants
url: 'http://localhost:3000',
actions: [...loginActions],
hideElements: 'div[class*="placeholder"], div[class*="singleValue"], .text-bcGreenHiredText',
},
{
// details - recruitment
url: 'http://localhost:3000',
actions: [
...loginActions,
'click element #details-0',
'wait for path to be /details',
'wait for element #tab-IEN_Recruitment_Process to be visible',
'click element #tab-IEN_Recruitment_Process',
'screen capture captures/details.png',
],
hideElements: 'div[class*="placeholder"], div[class*="singleValue"], .text-bcGreenHiredText',
},
{
// details - recruitment - job milestones
url: 'http://localhost:3000',
actions: [
...loginActions,
'click element #details-0',
'wait for path to be /details',
'wait for element #tab-IEN_Recruitment_Process to be visible',
'click element #tab-IEN_Recruitment_Process',
'wait for element button[class*="bg-bcBlueBar"] to be visible',
'click element button[class*="bg-bcBlueBar"]',
'wait for element form to be visible',
'screen capture captures/job.png',
],
wait: 1000,
hideElements:
'div[class*="placeholder"], div[class*="singleValue"], .text-bcGreenHiredText, a[target="_blank"]',
},
{
// reporting
url: 'http://localhost:3000',
actions: [
...loginActions,
'navigate to http://localhost:3000/reporting',
'wait for element .animate-spin to be removed',
'screen capture captures/reporting.png',
],
hideElements: 'div[class*="placeholder"], div[class*="singleValue"]',
},
{
// user management
url: 'http://localhost:3000',
actions: [
...loginActions,
'navigate to http://localhost:3000/user-management',
'wait for element .animate-spin to be removed',
'screen capture captures/user-management.png',
],
hideElements: 'div[class*="placeholder"], div[class*="singleValue"]',
},
{
// user details
url: 'http://localhost:3000',
actions: [
...loginActions,
'navigate to http://localhost:3000/user-management',
'wait for element .animate-spin to be removed',
'click element #details-0',
'wait for element .animate-spin to be removed',
'screen capture captures/user-details.png',
],
},
];
if (process.env.DEBUG) {
urls.forEach(url => (url.log = log));
}
module.exports = {
defaults,
urls,
};