@delurio/cli 0.11.0 → 0.12.0

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.
@@ -0,0 +1,2211 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://unpkg.com/@delurio/cli@0.12.0/schemas/binding.schema.json",
4
+ "title": "delurio binding (binding.yaml, <name>.binding.yaml)",
5
+ "description": "How a flow, or a navigation graph, maps onto a running app, for replay and recording (SPEC.md §7). A binding may `extends` a shared one, which may leave out what the bindings that extend it give. The keys are those the replay reads; what they name in the graph (a state, a node, an event, a scenario) is checked when a replay loads the binding (`replay --check`).",
6
+ "type": "object",
7
+ "required": [
8
+ "kind"
9
+ ],
10
+ "if": {
11
+ "anyOf": [
12
+ {
13
+ "required": [
14
+ "nav"
15
+ ]
16
+ },
17
+ {
18
+ "required": [
19
+ "setup"
20
+ ]
21
+ },
22
+ {
23
+ "required": [
24
+ "personas"
25
+ ]
26
+ },
27
+ {
28
+ "required": [
29
+ "frames"
30
+ ]
31
+ },
32
+ {
33
+ "required": [
34
+ "pages"
35
+ ]
36
+ },
37
+ {
38
+ "required": [
39
+ "entries"
40
+ ]
41
+ }
42
+ ]
43
+ },
44
+ "then": {
45
+ "$ref": "#/$defs/nav"
46
+ },
47
+ "else": {
48
+ "$ref": "#/$defs/flow"
49
+ },
50
+ "$comment": "a binding with nav, setup, personas, frames, pages or entries binds a navigation graph; any other, a flow",
51
+ "$defs": {
52
+ "flow": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "properties": {
56
+ "schema": {
57
+ "$ref": "#/$defs/formatVersion"
58
+ },
59
+ "kind": {
60
+ "const": "binding",
61
+ "description": "The kind of graph file. A binding is `binding`."
62
+ },
63
+ "extends": {
64
+ "type": "string",
65
+ "description": "A shared binding this one extends, relative to it: its keys come first, and the maps (apps, data, accounts, scenarios, …) are merged key by key.",
66
+ "examples": [
67
+ "../replay.base.binding.yaml"
68
+ ]
69
+ },
70
+ "root": {
71
+ "type": "string",
72
+ "description": "The folder commands run in, relative to the binding's file; its folder when left out."
73
+ },
74
+ "apps": {
75
+ "type": "object",
76
+ "description": "Each app's base address, used as {<app>} in addresses.",
77
+ "additionalProperties": {
78
+ "type": "string"
79
+ },
80
+ "examples": [
81
+ {
82
+ "app": "http://127.0.0.1:3000"
83
+ }
84
+ ]
85
+ },
86
+ "browser": {
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "properties": {
90
+ "width": {
91
+ "type": "integer",
92
+ "minimum": 1,
93
+ "description": "The window's width in CSS pixels (1280)."
94
+ },
95
+ "height": {
96
+ "type": "integer",
97
+ "minimum": 1,
98
+ "description": "The window's height in CSS pixels (720)."
99
+ },
100
+ "locale": {
101
+ "$ref": "#/$defs/locale",
102
+ "description": "The BCP 47 tag the browser is set to; every screen is read against the flow's catalog of that language."
103
+ },
104
+ "timezone": {
105
+ "type": "string",
106
+ "description": "The IANA time zone the browser is set to.",
107
+ "examples": [
108
+ "Europe/Istanbul"
109
+ ]
110
+ },
111
+ "timeout": {
112
+ "type": "number",
113
+ "exclusiveMinimum": 0,
114
+ "description": "How many seconds a step waits at most (10)."
115
+ },
116
+ "ignoreHTTPSErrors": {
117
+ "type": "boolean",
118
+ "description": "true: a page served with a certificate no authority signed opens all the same."
119
+ }
120
+ },
121
+ "description": "The browser the replay opens."
122
+ },
123
+ "data": {
124
+ "type": "object",
125
+ "description": "Sources of values, each a JSON or dotenv file, used as {<source>.<path>}; read when a walk starts, after its setup, and again after each command. Secrets in them are masked in reports.",
126
+ "additionalProperties": {
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "properties": {
130
+ "json": {
131
+ "type": "string"
132
+ },
133
+ "dotenv": {
134
+ "type": "string"
135
+ }
136
+ },
137
+ "oneOf": [
138
+ {
139
+ "required": [
140
+ "json"
141
+ ]
142
+ },
143
+ {
144
+ "required": [
145
+ "dotenv"
146
+ ]
147
+ }
148
+ ],
149
+ "$comment": "a source is { json: <path> } or { dotenv: <path> }"
150
+ }
151
+ },
152
+ "signIn": {
153
+ "type": "array",
154
+ "description": "How an account signs in: the actions, with the account's fields as {placeholders}. It signs in whoever acts, so no action carries `as`.",
155
+ "items": {
156
+ "$ref": "#/$defs/action"
157
+ }
158
+ },
159
+ "accounts": {
160
+ "type": "object",
161
+ "description": "The people a walk acts as, each with the fields signIn and the steps use as {placeholders}.",
162
+ "additionalProperties": {
163
+ "type": "object",
164
+ "additionalProperties": {
165
+ "type": [
166
+ "string",
167
+ "number",
168
+ "boolean"
169
+ ]
170
+ }
171
+ }
172
+ },
173
+ "samples": {
174
+ "type": "object",
175
+ "additionalProperties": {
176
+ "type": [
177
+ "string",
178
+ "number"
179
+ ]
180
+ },
181
+ "description": "Values for the sample placeholders of the graph's texts (a flow) or the :params of the routes (a navigation graph)."
182
+ },
183
+ "settle": {
184
+ "type": "object",
185
+ "additionalProperties": false,
186
+ "properties": {
187
+ "quiet": {
188
+ "type": "integer",
189
+ "minimum": 0,
190
+ "maximum": 10000,
191
+ "description": "How many milliseconds the page is still before a screen is read (400)."
192
+ },
193
+ "max": {
194
+ "type": "integer",
195
+ "minimum": 0,
196
+ "description": "How many milliseconds a screen waits for that at most: browser.timeout, which it never passes."
197
+ }
198
+ },
199
+ "description": "When a screen is read: once the page has been still for `quiet` ms, waiting at most `max` ms."
200
+ },
201
+ "parallel": {
202
+ "description": "Walks at once: true (as many as the machine holds), a number from 1 to 16, auto, or { walks, serial }, where each serial group names scenarios or accounts (a navigation graph's personas or accounts) whose walks share something fixed and go one after another. false: one at a time.",
203
+ "anyOf": [
204
+ {
205
+ "type": "boolean"
206
+ },
207
+ {
208
+ "$ref": "#/$defs/atOnce"
209
+ },
210
+ {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "properties": {
214
+ "walks": {
215
+ "$ref": "#/$defs/atOnce"
216
+ },
217
+ "serial": {
218
+ "type": "array",
219
+ "items": {
220
+ "anyOf": [
221
+ {
222
+ "type": "string"
223
+ },
224
+ {
225
+ "type": "array",
226
+ "minItems": 1,
227
+ "items": {
228
+ "type": "string"
229
+ }
230
+ }
231
+ ]
232
+ }
233
+ }
234
+ }
235
+ }
236
+ ]
237
+ },
238
+ "session": {
239
+ "type": "object",
240
+ "additionalProperties": false,
241
+ "properties": {
242
+ "check": {
243
+ "type": "object",
244
+ "additionalProperties": false,
245
+ "properties": {
246
+ "open": {
247
+ "type": "string",
248
+ "description": "An address a signed-in person opens."
249
+ },
250
+ "find": {
251
+ "$ref": "#/$defs/locator",
252
+ "description": "What only a signed-in page shows."
253
+ }
254
+ },
255
+ "required": [
256
+ "open",
257
+ "find"
258
+ ]
259
+ },
260
+ "maxAge": {
261
+ "description": "How long a saved sign-in lasts: 30m, 12h, 2d, or a number of seconds (12h).",
262
+ "anyOf": [
263
+ {
264
+ "type": "number",
265
+ "exclusiveMinimum": 0
266
+ },
267
+ {
268
+ "type": "string",
269
+ "pattern": "^\\s*\\d+\\s*[smhd]\\s*$"
270
+ }
271
+ ]
272
+ },
273
+ "fresh": {
274
+ "type": "array",
275
+ "description": "Scenarios (a navigation graph's personas) or accounts that always sign in anew.",
276
+ "items": {
277
+ "type": "string"
278
+ }
279
+ }
280
+ },
281
+ "required": [
282
+ "check"
283
+ ],
284
+ "description": "A sign-in through signIn is kept and reused across runs once checked."
285
+ },
286
+ "flow": {
287
+ "$ref": "#/$defs/graphId",
288
+ "description": "The id of the flow it binds."
289
+ },
290
+ "mask": {
291
+ "type": "array",
292
+ "description": "The sensitivities of the domain's fields (credential, personal, internal) whose nodes a recording, a video made from it and a replay's screenshots blur: [credential] when left out, [credential, personal] for an app whose data is real, [] for nothing (a tutorial filmed with a password made up for it).",
293
+ "uniqueItems": true,
294
+ "items": {
295
+ "enum": [
296
+ "credential",
297
+ "personal",
298
+ "internal"
299
+ ]
300
+ },
301
+ "examples": [
302
+ [
303
+ "credential",
304
+ "personal"
305
+ ],
306
+ []
307
+ ]
308
+ },
309
+ "pageErrors": {
310
+ "enum": [
311
+ "fail",
312
+ "report"
313
+ ],
314
+ "description": "An error the page leaves uncaught fails the walk (`fail`, the default), or is only listed (`report`)."
315
+ },
316
+ "snapshot": {
317
+ "type": "object",
318
+ "additionalProperties": false,
319
+ "properties": {
320
+ "save": {
321
+ "type": "array",
322
+ "description": "Run after a scenario's setup and sign-in.",
323
+ "items": {
324
+ "$ref": "#/$defs/runOnly"
325
+ },
326
+ "minItems": 1
327
+ },
328
+ "restore": {
329
+ "type": "array",
330
+ "description": "Run in place of the setup on the scenario's later walks.",
331
+ "items": {
332
+ "$ref": "#/$defs/runOnly"
333
+ },
334
+ "minItems": 1
335
+ },
336
+ "drop": {
337
+ "type": "array",
338
+ "description": "Run once for each snapshot when the replay ends.",
339
+ "items": {
340
+ "$ref": "#/$defs/runOnly"
341
+ }
342
+ }
343
+ },
344
+ "required": [
345
+ "save",
346
+ "restore"
347
+ ],
348
+ "description": "A scenario's setup run once, kept, and given back to its later walks: commands only."
349
+ },
350
+ "scenarios": {
351
+ "type": "object",
352
+ "description": "How walks start, by name.",
353
+ "additionalProperties": {
354
+ "type": "object",
355
+ "additionalProperties": false,
356
+ "properties": {
357
+ "given": {
358
+ "type": "object",
359
+ "description": "Where the walk starts: a value for each context variable the flow starts with `initial: any`.",
360
+ "additionalProperties": {
361
+ "type": [
362
+ "string",
363
+ "number",
364
+ "boolean",
365
+ "null"
366
+ ]
367
+ }
368
+ },
369
+ "as": {
370
+ "type": "string",
371
+ "description": "The account whose browser the walk is in."
372
+ },
373
+ "signIn": {
374
+ "type": "boolean",
375
+ "description": "false: the account is not signed in through signIn first."
376
+ },
377
+ "open": {
378
+ "type": "string",
379
+ "description": "The address the walk starts at.",
380
+ "examples": [
381
+ "{app}/team"
382
+ ]
383
+ },
384
+ "vars": {
385
+ "type": "object",
386
+ "additionalProperties": {
387
+ "type": [
388
+ "string",
389
+ "number"
390
+ ]
391
+ },
392
+ "description": "Values for {placeholders} of this scenario's walks. A var is not named like a field of an account the scenario acts as."
393
+ },
394
+ "samples": {
395
+ "type": "object",
396
+ "additionalProperties": {
397
+ "type": [
398
+ "string",
399
+ "number"
400
+ ]
401
+ },
402
+ "description": "Values for the sample placeholders of the graph's texts, over the binding's samples."
403
+ },
404
+ "setup": {
405
+ "type": "array",
406
+ "description": "Commands run before the walk, such as seeding the database: run only.",
407
+ "items": {
408
+ "$ref": "#/$defs/runOnly"
409
+ }
410
+ },
411
+ "teardown": {
412
+ "type": "array",
413
+ "description": "Commands run after the walk: run only.",
414
+ "items": {
415
+ "$ref": "#/$defs/runOnly"
416
+ }
417
+ },
418
+ "javaScript": {
419
+ "type": "boolean",
420
+ "description": "false: the walk's browser runs no JavaScript, through the pages marked `script`."
421
+ },
422
+ "viewport": {
423
+ "$ref": "#/$defs/viewport",
424
+ "description": "The walk's window, instead of the binding's browser width and height: a phone's."
425
+ },
426
+ "enter": {
427
+ "description": "How the scenario's walk comes into the flow after it opens its page: by an entry of a navigation graph ({ nav, bind, entry }), or from another flow that starts this one ({ flow, bind, given, event }). Paths are relative to the binding's file.",
428
+ "type": "object",
429
+ "$comment": "enter by a nav entry with nav, else from a flow",
430
+ "if": {
431
+ "required": [
432
+ "nav"
433
+ ]
434
+ },
435
+ "then": {
436
+ "type": "object",
437
+ "additionalProperties": false,
438
+ "properties": {
439
+ "nav": {
440
+ "type": "string",
441
+ "description": "The navigation graph's folder."
442
+ },
443
+ "bind": {
444
+ "type": "string",
445
+ "description": "Its binding; may be left out when the entry's label alone finds it."
446
+ },
447
+ "entry": {
448
+ "type": "string",
449
+ "description": "The entry, as `<from>-><to>`.",
450
+ "examples": [
451
+ "frame:workspace->projects"
452
+ ]
453
+ }
454
+ },
455
+ "required": [
456
+ "nav",
457
+ "entry"
458
+ ]
459
+ },
460
+ "else": {
461
+ "type": "object",
462
+ "additionalProperties": false,
463
+ "properties": {
464
+ "flow": {
465
+ "type": "string",
466
+ "description": "The other flow's folder."
467
+ },
468
+ "bind": {
469
+ "type": "string",
470
+ "description": "Its binding."
471
+ },
472
+ "given": {
473
+ "type": "object",
474
+ "description": "Where the other flow starts: its context."
475
+ },
476
+ "event": {
477
+ "type": "string",
478
+ "description": "The event of the transition whose `starts` names this flow."
479
+ }
480
+ },
481
+ "required": [
482
+ "flow",
483
+ "bind",
484
+ "event"
485
+ ]
486
+ }
487
+ }
488
+ },
489
+ "required": [
490
+ "open"
491
+ ],
492
+ "description": "How a walk starts: where (`given`), as whom, on which page, after what setup."
493
+ }
494
+ },
495
+ "events": {
496
+ "type": "object",
497
+ "description": "The actions that cause an event no node on screen sends, by event.",
498
+ "additionalProperties": {
499
+ "type": "array",
500
+ "description": "The actions.",
501
+ "items": {
502
+ "$ref": "#/$defs/action"
503
+ }
504
+ }
505
+ },
506
+ "states": {
507
+ "type": "object",
508
+ "description": "By state.",
509
+ "additionalProperties": {
510
+ "type": "object",
511
+ "additionalProperties": false,
512
+ "properties": {
513
+ "url": {
514
+ "type": "string",
515
+ "description": "A glob the page's address matches in this state (* is one path segment, ** anything)."
516
+ },
517
+ "text": {
518
+ "type": "string",
519
+ "description": "A text the state shows."
520
+ },
521
+ "reach": {
522
+ "type": "string",
523
+ "description": "A scenario whose shortest drivable path reaches this state, for a tutorial's `cut`."
524
+ },
525
+ "call": {
526
+ "description": "The server call the state makes: its URL glob, or { url, method, action, code, returns }. Held while the state's own screen is checked, and its HTTP status compared with the refusal's on a FAIL.<class> walk.",
527
+ "anyOf": [
528
+ {
529
+ "type": "string",
530
+ "minLength": 1
531
+ },
532
+ {
533
+ "type": "object",
534
+ "additionalProperties": false,
535
+ "properties": {
536
+ "url": {
537
+ "type": "string",
538
+ "description": "The URL glob the call goes to (a server action: the page's own address).",
539
+ "minLength": 1
540
+ },
541
+ "method": {
542
+ "type": "string",
543
+ "description": "Its HTTP method.",
544
+ "pattern": "^[A-Za-z]+$",
545
+ "examples": [
546
+ "POST"
547
+ ]
548
+ },
549
+ "action": {
550
+ "description": "The server action's id, as its Next-Action header carries it (a text between slashes is a regular expression), or true for any server action posted there.",
551
+ "anyOf": [
552
+ {
553
+ "type": "string"
554
+ },
555
+ {
556
+ "const": true
557
+ }
558
+ ]
559
+ },
560
+ "code": {
561
+ "type": "string",
562
+ "description": "The path of the refusal code in what the call returned.",
563
+ "examples": [
564
+ "error.code"
565
+ ]
566
+ },
567
+ "returns": {
568
+ "type": "object",
569
+ "description": "By DONE or a FAIL event of the state: what the call returned, { path, equals } or { text }.",
570
+ "additionalProperties": {
571
+ "type": "object",
572
+ "additionalProperties": false,
573
+ "properties": {
574
+ "path": {
575
+ "type": "string",
576
+ "description": "Keys and indexes in what it returned.",
577
+ "examples": [
578
+ "error.code"
579
+ ]
580
+ },
581
+ "equals": {
582
+ "description": "The value there."
583
+ },
584
+ "text": {
585
+ "type": "string",
586
+ "description": "A text its answer holds. A text between slashes is a regular expression."
587
+ }
588
+ },
589
+ "minProperties": 1
590
+ }
591
+ }
592
+ },
593
+ "required": [
594
+ "url"
595
+ ]
596
+ }
597
+ ]
598
+ },
599
+ "fail": {
600
+ "type": "object",
601
+ "description": "FAIL.<class> → how the held call is made to fail on a walk that leaves the state so, where the context does not cause it. Needs `call`.",
602
+ "propertyNames": {
603
+ "pattern": "^FAIL(\\.|$)"
604
+ },
605
+ "additionalProperties": {
606
+ "description": "How the held call is made to fail: abort (no answer, or { abort: <network error> }), { status, body, contentType, headers } (an answer the replay gives instead of the server), hang (no answer while the walk is at the state) or signOut (the session ends and the call goes on without its credentials).",
607
+ "anyOf": [
608
+ {
609
+ "enum": [
610
+ "abort",
611
+ "hang",
612
+ "signOut"
613
+ ]
614
+ },
615
+ {
616
+ "type": "object",
617
+ "additionalProperties": false,
618
+ "properties": {
619
+ "abort": {
620
+ "enum": [
621
+ "aborted",
622
+ "accessdenied",
623
+ "addressunreachable",
624
+ "blockedbyclient",
625
+ "blockedbyresponse",
626
+ "connectionaborted",
627
+ "connectionclosed",
628
+ "connectionfailed",
629
+ "connectionrefused",
630
+ "connectionreset",
631
+ "internetdisconnected",
632
+ "namenotresolved",
633
+ "timedout",
634
+ "failed"
635
+ ],
636
+ "description": "The browser's network error."
637
+ }
638
+ },
639
+ "required": [
640
+ "abort"
641
+ ]
642
+ },
643
+ {
644
+ "type": "object",
645
+ "additionalProperties": false,
646
+ "properties": {
647
+ "status": {
648
+ "type": "integer",
649
+ "minimum": 200,
650
+ "maximum": 599,
651
+ "description": "The answer's HTTP status."
652
+ },
653
+ "body": {
654
+ "type": "string",
655
+ "description": "The answer's text; {placeholders} are filled as in every binding string."
656
+ },
657
+ "contentType": {
658
+ "type": "string",
659
+ "description": "Its media type.",
660
+ "examples": [
661
+ "application/json"
662
+ ]
663
+ },
664
+ "headers": {
665
+ "type": "object",
666
+ "description": "Each header's name and value.",
667
+ "additionalProperties": {
668
+ "type": "string"
669
+ }
670
+ }
671
+ },
672
+ "required": [
673
+ "status"
674
+ ]
675
+ }
676
+ ]
677
+ }
678
+ },
679
+ "as": {
680
+ "type": "string",
681
+ "description": "The account whose screen this state is: it is checked, and its nodes pressed, in that person's context."
682
+ },
683
+ "before": {
684
+ "type": "array",
685
+ "description": "Done when the walk reaches the state, before it is checked.",
686
+ "items": {
687
+ "$ref": "#/$defs/action"
688
+ }
689
+ }
690
+ },
691
+ "description": "What a replay checks of a state beyond its nodes, and the call it holds.",
692
+ "allOf": [
693
+ {
694
+ "$comment": "fail makes the state's call fail, so it needs call",
695
+ "if": {
696
+ "required": [
697
+ "fail"
698
+ ]
699
+ },
700
+ "then": {
701
+ "required": [
702
+ "call"
703
+ ]
704
+ }
705
+ }
706
+ ]
707
+ }
708
+ },
709
+ "nodes": {
710
+ "type": "object",
711
+ "description": "By node of ui.yaml.",
712
+ "additionalProperties": {
713
+ "type": "object",
714
+ "additionalProperties": false,
715
+ "properties": {
716
+ "frame": {
717
+ "type": "string",
718
+ "description": "The CSS selector of the iframe the element is drawn in, such as a payment provider's hosted form; looked in first."
719
+ },
720
+ "role": {
721
+ "type": "string",
722
+ "description": "The element's WAI-ARIA role.",
723
+ "examples": [
724
+ "button",
725
+ "textbox",
726
+ "link"
727
+ ]
728
+ },
729
+ "name": {
730
+ "type": [
731
+ "string",
732
+ "number"
733
+ ],
734
+ "description": "With role: its accessible name. A text between slashes is a regular expression."
735
+ },
736
+ "text": {
737
+ "type": [
738
+ "string",
739
+ "number"
740
+ ],
741
+ "description": "The text it shows. A text between slashes is a regular expression."
742
+ },
743
+ "label": {
744
+ "type": [
745
+ "string",
746
+ "number"
747
+ ],
748
+ "description": "The label of a form control. A text between slashes is a regular expression."
749
+ },
750
+ "testId": {
751
+ "type": "string",
752
+ "description": "Its test id (data-testid)."
753
+ },
754
+ "css": {
755
+ "type": "string",
756
+ "description": "A CSS selector."
757
+ },
758
+ "hasText": {
759
+ "type": [
760
+ "string",
761
+ "number"
762
+ ],
763
+ "description": "Of what the rest finds, those that hold this text. A text between slashes is a regular expression."
764
+ },
765
+ "within": {
766
+ "$ref": "#/$defs/locator",
767
+ "description": "Looked for inside what this locator finds."
768
+ },
769
+ "nth": {
770
+ "type": "integer",
771
+ "minimum": 0,
772
+ "description": "Of what the rest finds, this one, from 0."
773
+ },
774
+ "before": {
775
+ "type": "array",
776
+ "description": "Done before the node is pressed, such as opening the menu it sits in.",
777
+ "items": {
778
+ "$ref": "#/$defs/action"
779
+ }
780
+ },
781
+ "skip": {
782
+ "type": "string",
783
+ "description": "Not checked, with the reason."
784
+ },
785
+ "count": {
786
+ "description": "How many elements its locator finds: a number, or a value of the data (\"{data.path}\").",
787
+ "anyOf": [
788
+ {
789
+ "type": "integer",
790
+ "minimum": 0
791
+ },
792
+ {
793
+ "type": "string",
794
+ "pattern": "^(?:\\{[^{}]+\\}|[0-9]+)$"
795
+ }
796
+ ]
797
+ }
798
+ },
799
+ "description": "Where the replay finds a node that its role and name cannot find, what it does before pressing it, how many elements it finds, or that it is skipped."
800
+ }
801
+ },
802
+ "effects": {
803
+ "type": "object",
804
+ "description": "By flow effect, or domain action a state invokes: the checks of what a step changes outside the screen, run after a walked transition applies it (typically `run` with `expect`).",
805
+ "additionalProperties": {
806
+ "type": "array",
807
+ "description": "The checks.",
808
+ "items": {
809
+ "$ref": "#/$defs/action"
810
+ }
811
+ }
812
+ }
813
+ },
814
+ "description": "A binding of a flow."
815
+ },
816
+ "nav": {
817
+ "type": "object",
818
+ "additionalProperties": false,
819
+ "properties": {
820
+ "schema": {
821
+ "$ref": "#/$defs/formatVersion"
822
+ },
823
+ "kind": {
824
+ "const": "binding",
825
+ "description": "The kind of graph file. A binding is `binding`."
826
+ },
827
+ "extends": {
828
+ "type": "string",
829
+ "description": "A shared binding this one extends, relative to it: its keys come first, and the maps (apps, data, accounts, scenarios, …) are merged key by key.",
830
+ "examples": [
831
+ "../replay.base.binding.yaml"
832
+ ]
833
+ },
834
+ "root": {
835
+ "type": "string",
836
+ "description": "The folder commands run in, relative to the binding's file; its folder when left out."
837
+ },
838
+ "apps": {
839
+ "type": "object",
840
+ "description": "Each app's base address, used as {<app>} in addresses.",
841
+ "additionalProperties": {
842
+ "type": "string"
843
+ },
844
+ "examples": [
845
+ {
846
+ "app": "http://127.0.0.1:3000"
847
+ }
848
+ ]
849
+ },
850
+ "browser": {
851
+ "type": "object",
852
+ "additionalProperties": false,
853
+ "properties": {
854
+ "width": {
855
+ "type": "integer",
856
+ "minimum": 1,
857
+ "description": "The window's width in CSS pixels (1280)."
858
+ },
859
+ "height": {
860
+ "type": "integer",
861
+ "minimum": 1,
862
+ "description": "The window's height in CSS pixels (720)."
863
+ },
864
+ "locale": {
865
+ "$ref": "#/$defs/locale",
866
+ "description": "The BCP 47 tag the browser is set to; every screen is read against the flow's catalog of that language."
867
+ },
868
+ "timezone": {
869
+ "type": "string",
870
+ "description": "The IANA time zone the browser is set to.",
871
+ "examples": [
872
+ "Europe/Istanbul"
873
+ ]
874
+ },
875
+ "timeout": {
876
+ "type": "number",
877
+ "exclusiveMinimum": 0,
878
+ "description": "How many seconds a step waits at most (10)."
879
+ },
880
+ "ignoreHTTPSErrors": {
881
+ "type": "boolean",
882
+ "description": "true: a page served with a certificate no authority signed opens all the same."
883
+ }
884
+ },
885
+ "description": "The browser the replay opens."
886
+ },
887
+ "data": {
888
+ "type": "object",
889
+ "description": "Sources of values, each a JSON or dotenv file, used as {<source>.<path>}; read when a walk starts, after its setup, and again after each command. Secrets in them are masked in reports.",
890
+ "additionalProperties": {
891
+ "type": "object",
892
+ "additionalProperties": false,
893
+ "properties": {
894
+ "json": {
895
+ "type": "string"
896
+ },
897
+ "dotenv": {
898
+ "type": "string"
899
+ }
900
+ },
901
+ "oneOf": [
902
+ {
903
+ "required": [
904
+ "json"
905
+ ]
906
+ },
907
+ {
908
+ "required": [
909
+ "dotenv"
910
+ ]
911
+ }
912
+ ],
913
+ "$comment": "a source is { json: <path> } or { dotenv: <path> }"
914
+ }
915
+ },
916
+ "signIn": {
917
+ "type": "array",
918
+ "description": "How an account signs in: the actions, with the account's fields as {placeholders}. It signs in whoever acts, so no action carries `as`.",
919
+ "items": {
920
+ "$ref": "#/$defs/action"
921
+ }
922
+ },
923
+ "accounts": {
924
+ "type": "object",
925
+ "description": "The people a walk acts as, each with the fields signIn and the steps use as {placeholders}.",
926
+ "additionalProperties": {
927
+ "type": "object",
928
+ "additionalProperties": {
929
+ "type": [
930
+ "string",
931
+ "number",
932
+ "boolean"
933
+ ]
934
+ }
935
+ }
936
+ },
937
+ "samples": {
938
+ "type": "object",
939
+ "additionalProperties": {
940
+ "type": [
941
+ "string",
942
+ "number"
943
+ ]
944
+ },
945
+ "description": "Values for the sample placeholders of the graph's texts (a flow) or the :params of the routes (a navigation graph)."
946
+ },
947
+ "settle": {
948
+ "type": "object",
949
+ "additionalProperties": false,
950
+ "properties": {
951
+ "quiet": {
952
+ "type": "integer",
953
+ "minimum": 0,
954
+ "maximum": 10000,
955
+ "description": "How many milliseconds the page is still before a screen is read (400)."
956
+ },
957
+ "max": {
958
+ "type": "integer",
959
+ "minimum": 0,
960
+ "description": "How many milliseconds a screen waits for that at most: browser.timeout, which it never passes."
961
+ }
962
+ },
963
+ "description": "When a screen is read: once the page has been still for `quiet` ms, waiting at most `max` ms."
964
+ },
965
+ "parallel": {
966
+ "description": "Walks at once: true (as many as the machine holds), a number from 1 to 16, auto, or { walks, serial }, where each serial group names scenarios or accounts (a navigation graph's personas or accounts) whose walks share something fixed and go one after another. false: one at a time.",
967
+ "anyOf": [
968
+ {
969
+ "type": "boolean"
970
+ },
971
+ {
972
+ "$ref": "#/$defs/atOnce"
973
+ },
974
+ {
975
+ "type": "object",
976
+ "additionalProperties": false,
977
+ "properties": {
978
+ "walks": {
979
+ "$ref": "#/$defs/atOnce"
980
+ },
981
+ "serial": {
982
+ "type": "array",
983
+ "items": {
984
+ "anyOf": [
985
+ {
986
+ "type": "string"
987
+ },
988
+ {
989
+ "type": "array",
990
+ "minItems": 1,
991
+ "items": {
992
+ "type": "string"
993
+ }
994
+ }
995
+ ]
996
+ }
997
+ }
998
+ }
999
+ }
1000
+ ]
1001
+ },
1002
+ "session": {
1003
+ "type": "object",
1004
+ "additionalProperties": false,
1005
+ "properties": {
1006
+ "check": {
1007
+ "type": "object",
1008
+ "additionalProperties": false,
1009
+ "properties": {
1010
+ "open": {
1011
+ "type": "string",
1012
+ "description": "An address a signed-in person opens."
1013
+ },
1014
+ "find": {
1015
+ "$ref": "#/$defs/locator",
1016
+ "description": "What only a signed-in page shows."
1017
+ }
1018
+ },
1019
+ "required": [
1020
+ "open",
1021
+ "find"
1022
+ ]
1023
+ },
1024
+ "maxAge": {
1025
+ "description": "How long a saved sign-in lasts: 30m, 12h, 2d, or a number of seconds (12h).",
1026
+ "anyOf": [
1027
+ {
1028
+ "type": "number",
1029
+ "exclusiveMinimum": 0
1030
+ },
1031
+ {
1032
+ "type": "string",
1033
+ "pattern": "^\\s*\\d+\\s*[smhd]\\s*$"
1034
+ }
1035
+ ]
1036
+ },
1037
+ "fresh": {
1038
+ "type": "array",
1039
+ "description": "Scenarios (a navigation graph's personas) or accounts that always sign in anew.",
1040
+ "items": {
1041
+ "type": "string"
1042
+ }
1043
+ }
1044
+ },
1045
+ "required": [
1046
+ "check"
1047
+ ],
1048
+ "description": "A sign-in through signIn is kept and reused across runs once checked."
1049
+ },
1050
+ "nav": {
1051
+ "$ref": "#/$defs/graphId",
1052
+ "description": "The id of the navigation graph it binds."
1053
+ },
1054
+ "setup": {
1055
+ "type": "array",
1056
+ "description": "Commands run once before the first persona, such as signing the people up: run only.",
1057
+ "items": {
1058
+ "$ref": "#/$defs/runOnly"
1059
+ }
1060
+ },
1061
+ "personas": {
1062
+ "type": "object",
1063
+ "description": "Who signs in as each persona. Without it, the account named like the persona.",
1064
+ "additionalProperties": {
1065
+ "type": "object",
1066
+ "additionalProperties": false,
1067
+ "properties": {
1068
+ "as": {
1069
+ "type": "string",
1070
+ "description": "The account."
1071
+ },
1072
+ "setup": {
1073
+ "type": "array",
1074
+ "description": "Commands that give the account the persona's facts, such as its role: run only.",
1075
+ "items": {
1076
+ "$ref": "#/$defs/runOnly"
1077
+ }
1078
+ }
1079
+ },
1080
+ "required": [
1081
+ "as"
1082
+ ]
1083
+ }
1084
+ },
1085
+ "frames": {
1086
+ "type": "object",
1087
+ "description": "By frame: where its chrome, its pages' own entries, the person's menu and the switcher are.",
1088
+ "additionalProperties": {
1089
+ "type": "object",
1090
+ "additionalProperties": false,
1091
+ "properties": {
1092
+ "find": {
1093
+ "$ref": "#/$defs/locator",
1094
+ "description": "The frame's chrome, where its menu entries are."
1095
+ },
1096
+ "page": {
1097
+ "$ref": "#/$defs/locator",
1098
+ "description": "Where a page of the frame draws its own entries."
1099
+ },
1100
+ "user": {
1101
+ "type": "object",
1102
+ "additionalProperties": false,
1103
+ "properties": {
1104
+ "open": {
1105
+ "type": "array",
1106
+ "description": "What opens the menu.",
1107
+ "items": {
1108
+ "$ref": "#/$defs/action"
1109
+ }
1110
+ },
1111
+ "find": {
1112
+ "$ref": "#/$defs/locator",
1113
+ "description": "The open menu, where its entries are found."
1114
+ }
1115
+ },
1116
+ "required": [
1117
+ "find"
1118
+ ],
1119
+ "description": "The person's menu."
1120
+ },
1121
+ "picker": {
1122
+ "type": "object",
1123
+ "additionalProperties": false,
1124
+ "properties": {
1125
+ "open": {
1126
+ "type": "array",
1127
+ "description": "What opens the menu.",
1128
+ "items": {
1129
+ "$ref": "#/$defs/action"
1130
+ }
1131
+ },
1132
+ "find": {
1133
+ "$ref": "#/$defs/locator",
1134
+ "description": "The open menu, where its entries are found."
1135
+ }
1136
+ },
1137
+ "required": [
1138
+ "find"
1139
+ ],
1140
+ "description": "The switcher."
1141
+ }
1142
+ }
1143
+ }
1144
+ },
1145
+ "pages": {
1146
+ "type": "object",
1147
+ "description": "By page.",
1148
+ "additionalProperties": {
1149
+ "type": "object",
1150
+ "additionalProperties": false,
1151
+ "properties": {
1152
+ "shows": {
1153
+ "$ref": "#/$defs/locator",
1154
+ "description": "What proves the page opened; absent when it refuses."
1155
+ },
1156
+ "refusal": {
1157
+ "$ref": "#/$defs/locator",
1158
+ "description": "The words in which the page says no."
1159
+ },
1160
+ "skip": {
1161
+ "type": "string",
1162
+ "description": "Not visited, with the reason."
1163
+ },
1164
+ "samples": {
1165
+ "type": "object",
1166
+ "additionalProperties": {
1167
+ "type": [
1168
+ "string",
1169
+ "number"
1170
+ ]
1171
+ },
1172
+ "description": "The :params of its route for this page, over the binding's own."
1173
+ }
1174
+ }
1175
+ }
1176
+ },
1177
+ "entries": {
1178
+ "type": "object",
1179
+ "description": "By entry, keyed by its ends (`<from>-><to>`, then its how or label key where two share them): a locator for its element, skip, or follow.",
1180
+ "additionalProperties": {
1181
+ "type": "object",
1182
+ "additionalProperties": false,
1183
+ "properties": {
1184
+ "frame": {
1185
+ "type": "string",
1186
+ "description": "The CSS selector of the iframe the element is drawn in, such as a payment provider's hosted form; looked in first."
1187
+ },
1188
+ "role": {
1189
+ "type": "string",
1190
+ "description": "The element's WAI-ARIA role.",
1191
+ "examples": [
1192
+ "button",
1193
+ "textbox",
1194
+ "link"
1195
+ ]
1196
+ },
1197
+ "name": {
1198
+ "type": [
1199
+ "string",
1200
+ "number"
1201
+ ],
1202
+ "description": "With role: its accessible name. A text between slashes is a regular expression."
1203
+ },
1204
+ "text": {
1205
+ "type": [
1206
+ "string",
1207
+ "number"
1208
+ ],
1209
+ "description": "The text it shows. A text between slashes is a regular expression."
1210
+ },
1211
+ "label": {
1212
+ "type": [
1213
+ "string",
1214
+ "number"
1215
+ ],
1216
+ "description": "The label of a form control. A text between slashes is a regular expression."
1217
+ },
1218
+ "testId": {
1219
+ "type": "string",
1220
+ "description": "Its test id (data-testid)."
1221
+ },
1222
+ "css": {
1223
+ "type": "string",
1224
+ "description": "A CSS selector."
1225
+ },
1226
+ "hasText": {
1227
+ "type": [
1228
+ "string",
1229
+ "number"
1230
+ ],
1231
+ "description": "Of what the rest finds, those that hold this text. A text between slashes is a regular expression."
1232
+ },
1233
+ "within": {
1234
+ "$ref": "#/$defs/locator",
1235
+ "description": "Looked for inside what this locator finds."
1236
+ },
1237
+ "nth": {
1238
+ "type": "integer",
1239
+ "minimum": 0,
1240
+ "description": "Of what the rest finds, this one, from 0."
1241
+ },
1242
+ "skip": {
1243
+ "type": "string",
1244
+ "description": "Not checked, with the reason."
1245
+ },
1246
+ "follow": {
1247
+ "type": "boolean",
1248
+ "description": "--follow: false never takes it (it signs out, deletes); true also takes a button."
1249
+ }
1250
+ },
1251
+ "description": "An entry's element, where its label is not its accessible name."
1252
+ }
1253
+ }
1254
+ },
1255
+ "description": "A binding of a navigation graph."
1256
+ },
1257
+ "formatVersion": {
1258
+ "description": "The format and its version.",
1259
+ "const": "delurio-graph/0"
1260
+ },
1261
+ "graphId": {
1262
+ "type": "string",
1263
+ "description": "The id of a graph.",
1264
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
1265
+ },
1266
+ "locale": {
1267
+ "type": "string",
1268
+ "description": "A BCP 47 language tag.",
1269
+ "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$",
1270
+ "examples": [
1271
+ "en",
1272
+ "tr",
1273
+ "pt-BR"
1274
+ ]
1275
+ },
1276
+ "locator": {
1277
+ "type": "object",
1278
+ "additionalProperties": false,
1279
+ "properties": {
1280
+ "frame": {
1281
+ "type": "string",
1282
+ "description": "The CSS selector of the iframe the element is drawn in, such as a payment provider's hosted form; looked in first."
1283
+ },
1284
+ "role": {
1285
+ "type": "string",
1286
+ "description": "The element's WAI-ARIA role.",
1287
+ "examples": [
1288
+ "button",
1289
+ "textbox",
1290
+ "link"
1291
+ ]
1292
+ },
1293
+ "name": {
1294
+ "type": [
1295
+ "string",
1296
+ "number"
1297
+ ],
1298
+ "description": "With role: its accessible name. A text between slashes is a regular expression."
1299
+ },
1300
+ "text": {
1301
+ "type": [
1302
+ "string",
1303
+ "number"
1304
+ ],
1305
+ "description": "The text it shows. A text between slashes is a regular expression."
1306
+ },
1307
+ "label": {
1308
+ "type": [
1309
+ "string",
1310
+ "number"
1311
+ ],
1312
+ "description": "The label of a form control. A text between slashes is a regular expression."
1313
+ },
1314
+ "testId": {
1315
+ "type": "string",
1316
+ "description": "Its test id (data-testid)."
1317
+ },
1318
+ "css": {
1319
+ "type": "string",
1320
+ "description": "A CSS selector."
1321
+ },
1322
+ "hasText": {
1323
+ "type": [
1324
+ "string",
1325
+ "number"
1326
+ ],
1327
+ "description": "Of what the rest finds, those that hold this text. A text between slashes is a regular expression."
1328
+ },
1329
+ "within": {
1330
+ "$ref": "#/$defs/locator",
1331
+ "description": "Looked for inside what this locator finds."
1332
+ },
1333
+ "nth": {
1334
+ "type": "integer",
1335
+ "minimum": 0,
1336
+ "description": "Of what the rest finds, this one, from 0."
1337
+ }
1338
+ },
1339
+ "description": "Where an element is: by role (and name), text, label, testId or css, narrowed by hasText, within, nth and frame.",
1340
+ "anyOf": [
1341
+ {
1342
+ "required": [
1343
+ "role"
1344
+ ]
1345
+ },
1346
+ {
1347
+ "required": [
1348
+ "text"
1349
+ ]
1350
+ },
1351
+ {
1352
+ "required": [
1353
+ "label"
1354
+ ]
1355
+ },
1356
+ {
1357
+ "required": [
1358
+ "testId"
1359
+ ]
1360
+ },
1361
+ {
1362
+ "required": [
1363
+ "css"
1364
+ ]
1365
+ }
1366
+ ],
1367
+ "$comment": "a locator finds by role (and name), text, label, testId or css"
1368
+ },
1369
+ "action": {
1370
+ "type": "object",
1371
+ "additionalProperties": false,
1372
+ "properties": {
1373
+ "goto": {
1374
+ "type": "string",
1375
+ "description": "Opens this address. {placeholders} are filled from the accounts, the data and the scenario.",
1376
+ "examples": [
1377
+ "{app}/login"
1378
+ ]
1379
+ },
1380
+ "reload": {
1381
+ "const": true,
1382
+ "description": "Loads the page again."
1383
+ },
1384
+ "click": {
1385
+ "$ref": "#/$defs/locator",
1386
+ "description": "Presses the element."
1387
+ },
1388
+ "fill": {
1389
+ "type": "object",
1390
+ "additionalProperties": false,
1391
+ "properties": {
1392
+ "frame": {
1393
+ "type": "string",
1394
+ "description": "The CSS selector of the iframe the element is drawn in, such as a payment provider's hosted form; looked in first."
1395
+ },
1396
+ "role": {
1397
+ "type": "string",
1398
+ "description": "The element's WAI-ARIA role.",
1399
+ "examples": [
1400
+ "button",
1401
+ "textbox",
1402
+ "link"
1403
+ ]
1404
+ },
1405
+ "name": {
1406
+ "type": [
1407
+ "string",
1408
+ "number"
1409
+ ],
1410
+ "description": "With role: its accessible name. A text between slashes is a regular expression."
1411
+ },
1412
+ "text": {
1413
+ "type": [
1414
+ "string",
1415
+ "number"
1416
+ ],
1417
+ "description": "The text it shows. A text between slashes is a regular expression."
1418
+ },
1419
+ "label": {
1420
+ "type": [
1421
+ "string",
1422
+ "number"
1423
+ ],
1424
+ "description": "The label of a form control. A text between slashes is a regular expression."
1425
+ },
1426
+ "testId": {
1427
+ "type": "string",
1428
+ "description": "Its test id (data-testid)."
1429
+ },
1430
+ "css": {
1431
+ "type": "string",
1432
+ "description": "A CSS selector."
1433
+ },
1434
+ "hasText": {
1435
+ "type": [
1436
+ "string",
1437
+ "number"
1438
+ ],
1439
+ "description": "Of what the rest finds, those that hold this text. A text between slashes is a regular expression."
1440
+ },
1441
+ "within": {
1442
+ "$ref": "#/$defs/locator",
1443
+ "description": "Looked for inside what this locator finds."
1444
+ },
1445
+ "nth": {
1446
+ "type": "integer",
1447
+ "minimum": 0,
1448
+ "description": "Of what the rest finds, this one, from 0."
1449
+ },
1450
+ "value": {
1451
+ "type": [
1452
+ "string",
1453
+ "number"
1454
+ ],
1455
+ "description": "What is typed, or the option chosen."
1456
+ }
1457
+ },
1458
+ "required": [
1459
+ "value"
1460
+ ],
1461
+ "description": "Types `value` into the field. A native <select> gets the option whose visible text is the value.",
1462
+ "anyOf": [
1463
+ {
1464
+ "required": [
1465
+ "role"
1466
+ ]
1467
+ },
1468
+ {
1469
+ "required": [
1470
+ "text"
1471
+ ]
1472
+ },
1473
+ {
1474
+ "required": [
1475
+ "label"
1476
+ ]
1477
+ },
1478
+ {
1479
+ "required": [
1480
+ "testId"
1481
+ ]
1482
+ },
1483
+ {
1484
+ "required": [
1485
+ "css"
1486
+ ]
1487
+ }
1488
+ ],
1489
+ "$comment": "a locator finds by role (and name), text, label, testId or css"
1490
+ },
1491
+ "attach": {
1492
+ "type": "object",
1493
+ "additionalProperties": false,
1494
+ "properties": {
1495
+ "frame": {
1496
+ "type": "string",
1497
+ "description": "The CSS selector of the iframe the element is drawn in, such as a payment provider's hosted form; looked in first."
1498
+ },
1499
+ "role": {
1500
+ "type": "string",
1501
+ "description": "The element's WAI-ARIA role.",
1502
+ "examples": [
1503
+ "button",
1504
+ "textbox",
1505
+ "link"
1506
+ ]
1507
+ },
1508
+ "name": {
1509
+ "type": [
1510
+ "string",
1511
+ "number"
1512
+ ],
1513
+ "description": "With role: its accessible name. A text between slashes is a regular expression."
1514
+ },
1515
+ "text": {
1516
+ "type": [
1517
+ "string",
1518
+ "number"
1519
+ ],
1520
+ "description": "The text it shows. A text between slashes is a regular expression."
1521
+ },
1522
+ "label": {
1523
+ "type": [
1524
+ "string",
1525
+ "number"
1526
+ ],
1527
+ "description": "The label of a form control. A text between slashes is a regular expression."
1528
+ },
1529
+ "testId": {
1530
+ "type": "string",
1531
+ "description": "Its test id (data-testid)."
1532
+ },
1533
+ "css": {
1534
+ "type": "string",
1535
+ "description": "A CSS selector."
1536
+ },
1537
+ "hasText": {
1538
+ "type": [
1539
+ "string",
1540
+ "number"
1541
+ ],
1542
+ "description": "Of what the rest finds, those that hold this text. A text between slashes is a regular expression."
1543
+ },
1544
+ "within": {
1545
+ "$ref": "#/$defs/locator",
1546
+ "description": "Looked for inside what this locator finds."
1547
+ },
1548
+ "nth": {
1549
+ "type": "integer",
1550
+ "minimum": 0,
1551
+ "description": "Of what the rest finds, this one, from 0."
1552
+ },
1553
+ "file": {
1554
+ "description": "A fixture, or a list of them, each relative to the binding's file and inside its folder.",
1555
+ "anyOf": [
1556
+ {
1557
+ "type": "string",
1558
+ "minLength": 1
1559
+ },
1560
+ {
1561
+ "type": "array",
1562
+ "minItems": 1,
1563
+ "items": {
1564
+ "type": "string",
1565
+ "minLength": 1
1566
+ }
1567
+ }
1568
+ ]
1569
+ },
1570
+ "run": {
1571
+ "$ref": "#/$defs/command",
1572
+ "description": "A helper and its arguments, run with no shell: its output is the file."
1573
+ },
1574
+ "fileName": {
1575
+ "type": "string",
1576
+ "description": "With run: the name of the file its output becomes.",
1577
+ "pattern": "^[^/\\\\]+$"
1578
+ },
1579
+ "mimeType": {
1580
+ "type": "string",
1581
+ "description": "The file's media type; else it follows from the name's extension.",
1582
+ "examples": [
1583
+ "text/csv"
1584
+ ]
1585
+ }
1586
+ },
1587
+ "description": "Gives a file input its files: fixtures (`file`), or what a helper writes to its standard output (`run`, as `fileName`). Where it finds something else, it is pressed and the files go to the file chooser it opens.",
1588
+ "anyOf": [
1589
+ {
1590
+ "required": [
1591
+ "role"
1592
+ ]
1593
+ },
1594
+ {
1595
+ "required": [
1596
+ "text"
1597
+ ]
1598
+ },
1599
+ {
1600
+ "required": [
1601
+ "label"
1602
+ ]
1603
+ },
1604
+ {
1605
+ "required": [
1606
+ "testId"
1607
+ ]
1608
+ },
1609
+ {
1610
+ "required": [
1611
+ "css"
1612
+ ]
1613
+ }
1614
+ ],
1615
+ "$comment": "attach takes file (fixtures) or run (a helper), one of them",
1616
+ "oneOf": [
1617
+ {
1618
+ "required": [
1619
+ "file"
1620
+ ]
1621
+ },
1622
+ {
1623
+ "required": [
1624
+ "run"
1625
+ ]
1626
+ }
1627
+ ],
1628
+ "allOf": [
1629
+ {
1630
+ "$comment": "run gives a file of the name fileName",
1631
+ "if": {
1632
+ "required": [
1633
+ "run"
1634
+ ]
1635
+ },
1636
+ "then": {
1637
+ "required": [
1638
+ "fileName"
1639
+ ]
1640
+ }
1641
+ }
1642
+ ]
1643
+ },
1644
+ "key": {
1645
+ "type": "string",
1646
+ "description": "Presses a key on the focused element.",
1647
+ "examples": [
1648
+ "Enter",
1649
+ "Escape"
1650
+ ]
1651
+ },
1652
+ "waitUrl": {
1653
+ "type": "string",
1654
+ "description": "Waits until the address matches this glob."
1655
+ },
1656
+ "waitText": {
1657
+ "type": "string",
1658
+ "description": "Waits until this text is shown."
1659
+ },
1660
+ "waitResponse": {
1661
+ "description": "Waits for a response from an address that matches this glob, of this status when it says.",
1662
+ "anyOf": [
1663
+ {
1664
+ "type": "string"
1665
+ },
1666
+ {
1667
+ "type": "object",
1668
+ "additionalProperties": false,
1669
+ "properties": {
1670
+ "url": {
1671
+ "type": "string"
1672
+ },
1673
+ "status": {
1674
+ "type": "integer",
1675
+ "minimum": 100,
1676
+ "maximum": 599
1677
+ }
1678
+ },
1679
+ "required": [
1680
+ "url"
1681
+ ]
1682
+ }
1683
+ ]
1684
+ },
1685
+ "download": {
1686
+ "description": "The download the last step started, waited for, saved and checked: what the file holds. `true` checks only that one came.",
1687
+ "anyOf": [
1688
+ {
1689
+ "const": true
1690
+ },
1691
+ {
1692
+ "type": "null"
1693
+ },
1694
+ {
1695
+ "type": "object",
1696
+ "additionalProperties": false,
1697
+ "properties": {
1698
+ "name": {
1699
+ "type": "string",
1700
+ "description": "A glob of the file's name.",
1701
+ "pattern": "^[^/\\\\]+$",
1702
+ "examples": [
1703
+ "grades-*.csv"
1704
+ ]
1705
+ },
1706
+ "size": {
1707
+ "description": "Its size in bytes, or { min, max }.",
1708
+ "anyOf": [
1709
+ {
1710
+ "type": "integer",
1711
+ "minimum": 0
1712
+ },
1713
+ {
1714
+ "type": "object",
1715
+ "additionalProperties": false,
1716
+ "properties": {
1717
+ "min": {
1718
+ "type": "integer",
1719
+ "minimum": 0
1720
+ },
1721
+ "max": {
1722
+ "type": "integer",
1723
+ "minimum": 0
1724
+ }
1725
+ },
1726
+ "minProperties": 1
1727
+ }
1728
+ ]
1729
+ },
1730
+ "type": {
1731
+ "enum": [
1732
+ "csv",
1733
+ "tsv",
1734
+ "txt",
1735
+ "json",
1736
+ "xlsx",
1737
+ "zip",
1738
+ "pdf",
1739
+ "png",
1740
+ "jpeg",
1741
+ "jpg",
1742
+ "gif"
1743
+ ],
1744
+ "description": "What kind of file it is, by its content."
1745
+ },
1746
+ "text": {
1747
+ "type": "string",
1748
+ "description": "A text the file holds. A text between slashes is a regular expression.",
1749
+ "minLength": 1
1750
+ },
1751
+ "sheet": {
1752
+ "type": "string",
1753
+ "description": "Of an xlsx workbook, the sheet the table is read from.",
1754
+ "minLength": 1
1755
+ },
1756
+ "rows": {
1757
+ "type": "integer",
1758
+ "minimum": 0,
1759
+ "description": "How many rows the table has after its header."
1760
+ },
1761
+ "columns": {
1762
+ "description": "The header, as a list, or how many columns there are.",
1763
+ "anyOf": [
1764
+ {
1765
+ "type": "integer",
1766
+ "minimum": 1
1767
+ },
1768
+ {
1769
+ "type": "array",
1770
+ "minItems": 1,
1771
+ "items": {
1772
+ "type": [
1773
+ "string",
1774
+ "number"
1775
+ ]
1776
+ }
1777
+ }
1778
+ ]
1779
+ },
1780
+ "cells": {
1781
+ "type": "array",
1782
+ "minItems": 1,
1783
+ "description": "Cells and what each holds: { row, column, equals } or { cell, equals }.",
1784
+ "items": {
1785
+ "anyOf": [
1786
+ {
1787
+ "type": "object",
1788
+ "additionalProperties": false,
1789
+ "properties": {
1790
+ "row": {
1791
+ "type": "integer",
1792
+ "minimum": 1,
1793
+ "description": "The row after the header, from 1."
1794
+ },
1795
+ "column": {
1796
+ "description": "The header's text, or the column's number from 1.",
1797
+ "anyOf": [
1798
+ {
1799
+ "type": "string"
1800
+ },
1801
+ {
1802
+ "type": "integer",
1803
+ "minimum": 1
1804
+ }
1805
+ ]
1806
+ },
1807
+ "equals": {
1808
+ "type": [
1809
+ "string",
1810
+ "number",
1811
+ "boolean"
1812
+ ],
1813
+ "description": "The cell's text."
1814
+ }
1815
+ },
1816
+ "required": [
1817
+ "row",
1818
+ "column",
1819
+ "equals"
1820
+ ]
1821
+ },
1822
+ {
1823
+ "type": "object",
1824
+ "additionalProperties": false,
1825
+ "properties": {
1826
+ "cell": {
1827
+ "type": "string",
1828
+ "description": "An A1 reference.",
1829
+ "pattern": "^[A-Z]+[1-9][0-9]*$",
1830
+ "examples": [
1831
+ "B2"
1832
+ ]
1833
+ },
1834
+ "equals": {
1835
+ "type": [
1836
+ "string",
1837
+ "number",
1838
+ "boolean"
1839
+ ],
1840
+ "description": "The cell's text."
1841
+ }
1842
+ },
1843
+ "required": [
1844
+ "cell",
1845
+ "equals"
1846
+ ]
1847
+ }
1848
+ ]
1849
+ }
1850
+ }
1851
+ }
1852
+ }
1853
+ ]
1854
+ },
1855
+ "resize": {
1856
+ "$ref": "#/$defs/viewport",
1857
+ "description": "The window of the person acting, from here on: a phone turned, a window made narrow."
1858
+ },
1859
+ "run": {
1860
+ "$ref": "#/$defs/command",
1861
+ "description": "A command and its arguments, as a list, run with no shell."
1862
+ },
1863
+ "expect": {
1864
+ "type": [
1865
+ "string",
1866
+ "number"
1867
+ ],
1868
+ "description": "With run: what the command's output must contain."
1869
+ },
1870
+ "as": {
1871
+ "type": "string",
1872
+ "description": "Done in this account's own browser context, opened and signed in on first use: a step another person takes."
1873
+ }
1874
+ },
1875
+ "description": "One thing the replay does: one of goto, reload, click, fill, attach, key, waitUrl, waitText, waitResponse, download, resize and run, which may carry `as`.",
1876
+ "anyOf": [
1877
+ {
1878
+ "required": [
1879
+ "goto"
1880
+ ]
1881
+ },
1882
+ {
1883
+ "required": [
1884
+ "reload"
1885
+ ]
1886
+ },
1887
+ {
1888
+ "required": [
1889
+ "click"
1890
+ ]
1891
+ },
1892
+ {
1893
+ "required": [
1894
+ "fill"
1895
+ ]
1896
+ },
1897
+ {
1898
+ "required": [
1899
+ "attach"
1900
+ ]
1901
+ },
1902
+ {
1903
+ "required": [
1904
+ "key"
1905
+ ]
1906
+ },
1907
+ {
1908
+ "required": [
1909
+ "waitUrl"
1910
+ ]
1911
+ },
1912
+ {
1913
+ "required": [
1914
+ "waitText"
1915
+ ]
1916
+ },
1917
+ {
1918
+ "required": [
1919
+ "waitResponse"
1920
+ ]
1921
+ },
1922
+ {
1923
+ "required": [
1924
+ "download"
1925
+ ]
1926
+ },
1927
+ {
1928
+ "required": [
1929
+ "resize"
1930
+ ]
1931
+ },
1932
+ {
1933
+ "required": [
1934
+ "run"
1935
+ ]
1936
+ }
1937
+ ],
1938
+ "$comment": "an action is one of goto, reload, click, fill, attach, key, waitUrl, waitText, waitResponse, download, resize, run",
1939
+ "allOf": [
1940
+ {
1941
+ "$comment": "an action does one thing: give each its own item",
1942
+ "if": {
1943
+ "required": [
1944
+ "goto"
1945
+ ]
1946
+ },
1947
+ "then": {
1948
+ "properties": {
1949
+ "reload": false,
1950
+ "click": false,
1951
+ "fill": false,
1952
+ "attach": false,
1953
+ "key": false,
1954
+ "waitUrl": false,
1955
+ "waitText": false,
1956
+ "waitResponse": false,
1957
+ "download": false,
1958
+ "resize": false,
1959
+ "run": false
1960
+ }
1961
+ }
1962
+ },
1963
+ {
1964
+ "$comment": "an action does one thing: give each its own item",
1965
+ "if": {
1966
+ "required": [
1967
+ "reload"
1968
+ ]
1969
+ },
1970
+ "then": {
1971
+ "properties": {
1972
+ "click": false,
1973
+ "fill": false,
1974
+ "attach": false,
1975
+ "key": false,
1976
+ "waitUrl": false,
1977
+ "waitText": false,
1978
+ "waitResponse": false,
1979
+ "download": false,
1980
+ "resize": false,
1981
+ "run": false
1982
+ }
1983
+ }
1984
+ },
1985
+ {
1986
+ "$comment": "an action does one thing: give each its own item",
1987
+ "if": {
1988
+ "required": [
1989
+ "click"
1990
+ ]
1991
+ },
1992
+ "then": {
1993
+ "properties": {
1994
+ "fill": false,
1995
+ "attach": false,
1996
+ "key": false,
1997
+ "waitUrl": false,
1998
+ "waitText": false,
1999
+ "waitResponse": false,
2000
+ "download": false,
2001
+ "resize": false,
2002
+ "run": false
2003
+ }
2004
+ }
2005
+ },
2006
+ {
2007
+ "$comment": "an action does one thing: give each its own item",
2008
+ "if": {
2009
+ "required": [
2010
+ "fill"
2011
+ ]
2012
+ },
2013
+ "then": {
2014
+ "properties": {
2015
+ "attach": false,
2016
+ "key": false,
2017
+ "waitUrl": false,
2018
+ "waitText": false,
2019
+ "waitResponse": false,
2020
+ "download": false,
2021
+ "resize": false,
2022
+ "run": false
2023
+ }
2024
+ }
2025
+ },
2026
+ {
2027
+ "$comment": "an action does one thing: give each its own item",
2028
+ "if": {
2029
+ "required": [
2030
+ "attach"
2031
+ ]
2032
+ },
2033
+ "then": {
2034
+ "properties": {
2035
+ "key": false,
2036
+ "waitUrl": false,
2037
+ "waitText": false,
2038
+ "waitResponse": false,
2039
+ "download": false,
2040
+ "resize": false,
2041
+ "run": false
2042
+ }
2043
+ }
2044
+ },
2045
+ {
2046
+ "$comment": "an action does one thing: give each its own item",
2047
+ "if": {
2048
+ "required": [
2049
+ "key"
2050
+ ]
2051
+ },
2052
+ "then": {
2053
+ "properties": {
2054
+ "waitUrl": false,
2055
+ "waitText": false,
2056
+ "waitResponse": false,
2057
+ "download": false,
2058
+ "resize": false,
2059
+ "run": false
2060
+ }
2061
+ }
2062
+ },
2063
+ {
2064
+ "$comment": "an action does one thing: give each its own item",
2065
+ "if": {
2066
+ "required": [
2067
+ "waitUrl"
2068
+ ]
2069
+ },
2070
+ "then": {
2071
+ "properties": {
2072
+ "waitText": false,
2073
+ "waitResponse": false,
2074
+ "download": false,
2075
+ "resize": false,
2076
+ "run": false
2077
+ }
2078
+ }
2079
+ },
2080
+ {
2081
+ "$comment": "an action does one thing: give each its own item",
2082
+ "if": {
2083
+ "required": [
2084
+ "waitText"
2085
+ ]
2086
+ },
2087
+ "then": {
2088
+ "properties": {
2089
+ "waitResponse": false,
2090
+ "download": false,
2091
+ "resize": false,
2092
+ "run": false
2093
+ }
2094
+ }
2095
+ },
2096
+ {
2097
+ "$comment": "an action does one thing: give each its own item",
2098
+ "if": {
2099
+ "required": [
2100
+ "waitResponse"
2101
+ ]
2102
+ },
2103
+ "then": {
2104
+ "properties": {
2105
+ "download": false,
2106
+ "resize": false,
2107
+ "run": false
2108
+ }
2109
+ }
2110
+ },
2111
+ {
2112
+ "$comment": "an action does one thing: give each its own item",
2113
+ "if": {
2114
+ "required": [
2115
+ "download"
2116
+ ]
2117
+ },
2118
+ "then": {
2119
+ "properties": {
2120
+ "resize": false,
2121
+ "run": false
2122
+ }
2123
+ }
2124
+ },
2125
+ {
2126
+ "$comment": "an action does one thing: give each its own item",
2127
+ "if": {
2128
+ "required": [
2129
+ "resize"
2130
+ ]
2131
+ },
2132
+ "then": {
2133
+ "properties": {
2134
+ "run": false
2135
+ }
2136
+ }
2137
+ },
2138
+ {
2139
+ "$comment": "expect goes with run",
2140
+ "if": {
2141
+ "required": [
2142
+ "expect"
2143
+ ]
2144
+ },
2145
+ "then": {
2146
+ "required": [
2147
+ "run"
2148
+ ]
2149
+ }
2150
+ }
2151
+ ]
2152
+ },
2153
+ "runOnly": {
2154
+ "$ref": "#/$defs/action",
2155
+ "required": [
2156
+ "run"
2157
+ ],
2158
+ "$comment": "only commands run here: there is no page"
2159
+ },
2160
+ "command": {
2161
+ "type": "array",
2162
+ "minItems": 1,
2163
+ "items": {
2164
+ "type": [
2165
+ "string",
2166
+ "number"
2167
+ ]
2168
+ }
2169
+ },
2170
+ "viewport": {
2171
+ "type": "object",
2172
+ "additionalProperties": false,
2173
+ "properties": {
2174
+ "width": {
2175
+ "type": "integer",
2176
+ "minimum": 1,
2177
+ "maximum": 10000,
2178
+ "description": "CSS pixels."
2179
+ },
2180
+ "height": {
2181
+ "type": "integer",
2182
+ "minimum": 1,
2183
+ "maximum": 10000,
2184
+ "description": "CSS pixels."
2185
+ }
2186
+ },
2187
+ "required": [
2188
+ "width",
2189
+ "height"
2190
+ ],
2191
+ "description": "A window's size, { width, height }, in whole CSS pixels from 1 to 10000."
2192
+ },
2193
+ "atOnce": {
2194
+ "description": "A number of walks at once from 1 to 16, or auto (as many as the machine holds).",
2195
+ "anyOf": [
2196
+ {
2197
+ "const": "auto"
2198
+ },
2199
+ {
2200
+ "type": "integer",
2201
+ "minimum": 1,
2202
+ "maximum": 16
2203
+ },
2204
+ {
2205
+ "type": "string",
2206
+ "pattern": "^(?:[1-9]|1[0-6])$"
2207
+ }
2208
+ ]
2209
+ }
2210
+ }
2211
+ }