-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.schema.json
590 lines (588 loc) · 19.9 KB
/
manifest.schema.json
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "manifest.schema.json",
"title": "Audit manifest",
"description": "The manifest file allows to describe the audit scenario and configuration.",
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "Name of the web application",
"type": "string",
"example": "My website"
},
"description": {
"title": "Description",
"description": "Description of the web application or of the current test",
"type": "string",
"example": "A website that must comply with eco-design best practices"
},
"url": {
"title": "URL",
"description": "Main/root URL of the web application",
"type": "string",
"example": "https://mywebsite.net"
},
"config": {
"title": "Configuration",
"description": "Audit configuration (merged with CLI flags and environment variables)",
"type": "object",
"properties": {
"browser": {
"title": "Browser",
"description": "Browser to run the audit with",
"type": "string",
"enum": [ "msedge", "chrome", "chromium", "firefox", "webkit" ],
"example": "chromium"
},
"headless": {
"title": "Headless",
"description": "Run browser in headless mode",
"type": "boolean",
"example": true
},
"device": {
"title": "Device",
"description": "Simulate browser behavior for a specific device",
"type": "string",
"example": "Galaxy S8"
},
"headers": {
"title": "Headers",
"description": "Additional HTTP headers to be sent with every request",
"type": "object",
"example": { "X-User": "user" },
"patternProperties": {
"^[A-Za-z0-9_-]+$": {
"type": "string"
}
},
"additionalProperties": false
},
"proxy": {
"title": "Proxy",
"description": "Network proxy settings",
"type": "object",
"properties": {
"server": {
"title": "Server",
"description": "Proxy to be used for all requests",
"type": "string",
"example": "http://myproxy.com:3128"
},
"bypass": {
"title": "Bypass",
"description": "Comma-separated domains to bypass proxy",
"type": "string",
"example": ".com, chromium.org, .domain.com"
},
"username": {
"title": "Username",
"description": "Username to use if HTTP proxy requires authentication",
"type": "string",
"example": "username"
},
"password": {
"title": "Password",
"description": "Password to use if HTTP proxy requires authentication",
"type": "string",
"example": "password"
}
},
"required": [ "server" ],
"additionalProperties": false
},
"timeout": {
"title": "Timeout",
"description": "Maximum time to wait for navigations or actions, in milliseconds",
"type": "integer",
"minimum": 0,
"maximum": 600000,
"example": 10000
},
"retries": {
"title": "Retries",
"description": "Number of retries in case of failure",
"type": "integer",
"minimum": 0,
"maximum": 100,
"example": 3
},
"output": {
"title": "Output",
"description": "Directory to write reports to",
"type": "string",
"example": "./reports/"
},
"formats": {
"title": "Formats",
"description": "Output report formats",
"type": "array",
"example": [ "html" ],
"items": {
"title": "Items",
"description": "Output report format",
"type": "string",
"enum": [ "html", "json", "influxdb" ]
}
},
"influxdb": {
"title": "InfluxDB",
"description": "InfluxDB connection configuration",
"type": "object",
"properties": {
"url": {
"title": "URL",
"description": "Base URL",
"type": "string",
"format": "uri",
"example": "http://localhost:8086"
},
"token": {
"title": "Token",
"description": "Authentication token",
"type": "string",
"example": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"org": {
"title": "Organisation",
"description": "Destination organisation for writes",
"type": "string",
"example": "my-org"
},
"bucket": {
"title": "Bucket",
"description": "Destination bucket for writes",
"type": "string",
"example": "my-bucket"
},
"prefix": {
"title": "Prefix",
"description": "Measurement name prefix",
"type": "string",
"example": "eco_"
}
},
"required": [ "url", "token", "org", "bucket" ],
"additionalProperties": false
},
"dryRun": {
"title": "DryRun",
"description": "Simulate the audit without actually running the browser",
"type": "boolean",
"example": true
},
"verbose": {
"title": "Verbose",
"description": "Enable verbose output",
"type": "boolean",
"example": true
}
},
"minProperties": 0,
"additionalProperties": false
},
"procedures": {
"title": "Procedures",
"description": "Procedures allow to define reusable sequences of actions.",
"type": "object",
"patternProperties": {
"^[A-Za-z0-9_-]+$": {
"$ref": "#/properties/actions"
}
},
"additionalProperties": false
},
"actions": {
"title": "Actions",
"description": "Actions allow to define the browsing scenario to run and audit.",
"type": "array",
"items": {
"description": "A browsing action",
"type": "object",
"properties": {
"check": {
"title": "Check or uncheck a checkbox or a radio button.",
"oneOf": [
{
"description": "The selector to use when resolving the DOM element and the state to set (`check` or `uncheck`, default to `check`)",
"type": "string",
"pattern": "^.+(, *(un)?check)?$",
"example": "input[name='remember'], check"
},
{
"type": "object",
"properties": {
"selector": {
"title": "Selector",
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "input[name='remember']"
},
"state": {
"title": "State",
"description": "The state to set (`check` or `uncheck`, default to `check`)",
"type": "string",
"enum": [ "check", "uncheck" ],
"example": "check"
}
},
"required": [ "selector" ],
"additionalProperties": false
}
]
},
"click": {
"title": "Click on an element.",
"oneOf": [
{
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "button[type='submit']"
},
{
"type": "object",
"properties": {
"selector": {
"title": "Selector",
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "button[type='submit']"
}
},
"required": [ "selector" ],
"additionalProperties": false
}
]
},
"fill": {
"title": "Fill an input or a textarea with a text.",
"oneOf": [
{
"description": "The selector to use when resolving the DOM element and the value to set (supports templating)",
"type": "string",
"pattern": "^.+,.+$",
"example": "#search, Eco-design"
},
{
"type": "object",
"properties": {
"selector": {
"title": "Selector",
"description": "The selector to use when resolving the DOM element (supports templating)",
"type": "string",
"example": "#search"
},
"value": {
"title": "Value",
"description": "The value to set (supports templating)",
"type": "string",
"example": "Eco-design"
}
},
"required": [ "selector", "value" ],
"additionalProperties": false
}
]
},
"goto": {
"title": "Navigate to the given URL.",
"oneOf": [
{
"description": "The target HTTP/HTTPS URL (supports templating)",
"type": "string",
"example": "https://mywebsite.net/admin"
},
{
"type": "object",
"properties": {
"url": {
"title": "Url",
"description": "The target HTTP/HTTPS URL (supports templating)",
"type": "string",
"example": "https://mywebsite.net/admin"
}
},
"required": [ "url" ],
"additionalProperties": false
}
]
},
"page": {
"title": "Mark the current state as a stable page to analyse.",
"oneOf": [
{
"description": "The page name",
"type": "string",
"example": "Profile page"
},
{
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "The page name",
"type": "string",
"example": "Profile page"
}
},
"required": [ "name" ],
"additionalProperties": false
}
]
},
"procedure": {
"title": "Execute actions from a procedure.",
"oneOf": [
{
"description": "The procedure name",
"type": "string",
"example": "login"
},
{
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "The procedure name",
"type": "string",
"example": "login"
},
"args": {
"title": "Args",
"description": "Procedure arguments",
"type": "object",
"example": {
"username": "admin"
},
"patternProperties": {
"^\\w+$": {
"title": "+$",
"description": "A procedure argument",
"type": "string"
}
},
"additionalProperties": false
}
},
"required": [ "name" ],
"additionalProperties": false
}
]
},
"scenario": {
"title": "Start a scenario (allows to group page audit results).",
"oneOf": [
{
"description": "The scenario name",
"type": "string",
"example": "Browse my profile"
},
{
"description": "Scenario properties",
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "The scenario name",
"type": "string",
"example": "Browse my profile"
},
"newContext": {
"title": "NewContext",
"description": "Close the current context and create a new one",
"type": "boolean",
"example": false
},
"exclude": {
"title": "Exclude",
"description": "Exclude this scenario from analysis (only run actions)",
"type": "boolean",
"example": false
}
},
"required": [ "name" ],
"additionalProperties": false
}
]
},
"screenshot": {
"title": "Take a screenshot of the current page.",
"oneOf": [
{
"description": "The file path to save the image to",
"type": "string",
"example": "posts.png"
},
{
"type": "object",
"properties": {
"path": {
"title": "Path",
"description": "The file path to save the image to",
"type": "string",
"example": "posts.png"
}
},
"required": [ "path" ],
"additionalProperties": false
}
]
},
"scroll": {
"title": "Scroll an element into view.",
"oneOf": [
{
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "#footer"
},
{
"type": "object",
"properties": {
"selector": {
"title": "Selector",
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "#footer"
}
},
"required": [ "selector" ],
"additionalProperties": false
}
]
},
"select": {
"title": "Select option or options in select.",
"oneOf": [
{
"description": "The selector to use when resolving the DOM element and option(s) to select",
"type": "string",
"pattern": "^(.+(,|$)){2,}",
"example": "select[name='lang'], fr"
},
{
"type": "object",
"properties": {
"selector": {
"title": "Selector",
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "select[name='lang']"
},
"value": {
"title": "Value",
"description": "The option to select",
"type": "string",
"example": "fr"
},
"values": {
"title": "Values",
"description": "Options to select",
"type": "array",
"example": [ "fr", "en" ],
"items": {
"title": "Value",
"description": "The option to select",
"type": "string"
}
}
},
"required": [ "selector" ],
"minProperties": 2,
"additionalProperties": false
}
]
},
"upload": {
"title": "Select input files for upload.",
"oneOf": [
{
"description": "The selector to use when resolving the DOM element and input file(s) to set",
"type": "string",
"pattern": "^(.+(, *|$)){2,}",
"example": "input[name='file'], myfile.txt"
},
{
"type": "object",
"properties": {
"selector": {
"title": "Selector",
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "select[name='lang']"
},
"file": {
"title": "File",
"description": "The input file to set",
"type": "string",
"example": "myfile.txt"
},
"files": {
"title": "Files",
"description": "Input files to set",
"type": "array",
"example": [ "myfile1.txt", "myfile2.txt" ],
"items": {
"title": "File",
"description": "The input file to set",
"type": "string"
}
}
},
"required": [ "selector" ],
"minProperties": 2,
"additionalProperties": false
}
]
},
"wait": {
"title": "Wait for the required load state to be reached or for an element to be visible.",
"oneOf": [
{
"description": "The load state to wait for",
"type": "string",
"enum": [ "load", "domcontentloaded", "networkidle" ],
"example": "load"
},
{
"description": "The selector to use when resolving the DOM element",
"type": "string",
"not": {
"enum": [ "load", "domcontentloaded", "networkidle" ]
},
"example": "main#container"
},
{
"type": "object",
"properties": {
"state": {
"title": "State",
"description": "The load state to wait for",
"type": "string",
"enum": [ "load", "domcontentloaded", "networkidle" ],
"example": "load"
},
"selector": {
"title": "Selector",
"description": "The selector to use when resolving the DOM element",
"type": "string",
"example": "main#container"
}
},
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": false
}
]
}
},
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": false
}
}
},
"required": [ "url" ],
"additionalProperties": false
}