@beryl-so/cli 0.1.0 → 0.5.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,1269 @@
1
+ // GENERATED by `poetry run python scripts/gen_plan_schema.py` in api/ — do not edit by hand.
2
+ export const ACTION_PLAN_SCHEMA = {
3
+ "$defs": {
4
+ "ActionType": {
5
+ "enum": [
6
+ "goto",
7
+ "fill",
8
+ "click",
9
+ "press",
10
+ "check",
11
+ "uncheck",
12
+ "select",
13
+ "hover",
14
+ "scroll",
15
+ "wait_for",
16
+ "expect",
17
+ "capture_count",
18
+ "await_email",
19
+ "upload",
20
+ "dialog",
21
+ "switch_tab",
22
+ "close_tab",
23
+ "drag"
24
+ ],
25
+ "title": "ActionType",
26
+ "type": "string"
27
+ },
28
+ "DialogChoice": {
29
+ "enum": [
30
+ "accept",
31
+ "dismiss"
32
+ ],
33
+ "title": "DialogChoice",
34
+ "type": "string"
35
+ },
36
+ "EmailExtract": {
37
+ "enum": [
38
+ "code",
39
+ "link",
40
+ "pattern"
41
+ ],
42
+ "title": "EmailExtract",
43
+ "type": "string"
44
+ },
45
+ "ExpectKind": {
46
+ "enum": [
47
+ "visible",
48
+ "attached",
49
+ "hidden",
50
+ "checked",
51
+ "enabled",
52
+ "disabled",
53
+ "have_text",
54
+ "have_value",
55
+ "have_url",
56
+ "have_title",
57
+ "have_count",
58
+ "persisted",
59
+ "gone",
60
+ "count_delta"
61
+ ],
62
+ "title": "ExpectKind",
63
+ "type": "string"
64
+ },
65
+ "PlanStep": {
66
+ "allOf": [
67
+ {
68
+ "if": {
69
+ "properties": {
70
+ "action": {
71
+ "const": "goto"
72
+ }
73
+ },
74
+ "required": [
75
+ "action"
76
+ ]
77
+ },
78
+ "then": {
79
+ "properties": {
80
+ "url": {
81
+ "minLength": 1,
82
+ "type": "string"
83
+ }
84
+ },
85
+ "required": [
86
+ "url"
87
+ ]
88
+ }
89
+ },
90
+ {
91
+ "if": {
92
+ "properties": {
93
+ "action": {
94
+ "const": "fill"
95
+ }
96
+ },
97
+ "required": [
98
+ "action"
99
+ ]
100
+ },
101
+ "then": {
102
+ "properties": {
103
+ "selector": {
104
+ "minLength": 1,
105
+ "type": "string"
106
+ },
107
+ "value": {
108
+ "not": {
109
+ "type": "null"
110
+ }
111
+ }
112
+ },
113
+ "required": [
114
+ "selector",
115
+ "value"
116
+ ]
117
+ }
118
+ },
119
+ {
120
+ "if": {
121
+ "properties": {
122
+ "action": {
123
+ "const": "click"
124
+ }
125
+ },
126
+ "required": [
127
+ "action"
128
+ ]
129
+ },
130
+ "then": {
131
+ "properties": {
132
+ "selector": {
133
+ "minLength": 1,
134
+ "type": "string"
135
+ }
136
+ },
137
+ "required": [
138
+ "selector"
139
+ ]
140
+ }
141
+ },
142
+ {
143
+ "if": {
144
+ "properties": {
145
+ "action": {
146
+ "const": "press"
147
+ }
148
+ },
149
+ "required": [
150
+ "action"
151
+ ]
152
+ },
153
+ "then": {
154
+ "properties": {
155
+ "key": {
156
+ "minLength": 1,
157
+ "type": "string"
158
+ },
159
+ "selector": {
160
+ "minLength": 1,
161
+ "type": "string"
162
+ }
163
+ },
164
+ "required": [
165
+ "key",
166
+ "selector"
167
+ ]
168
+ }
169
+ },
170
+ {
171
+ "if": {
172
+ "properties": {
173
+ "action": {
174
+ "const": "check"
175
+ }
176
+ },
177
+ "required": [
178
+ "action"
179
+ ]
180
+ },
181
+ "then": {
182
+ "properties": {
183
+ "selector": {
184
+ "minLength": 1,
185
+ "type": "string"
186
+ }
187
+ },
188
+ "required": [
189
+ "selector"
190
+ ]
191
+ }
192
+ },
193
+ {
194
+ "if": {
195
+ "properties": {
196
+ "action": {
197
+ "const": "uncheck"
198
+ }
199
+ },
200
+ "required": [
201
+ "action"
202
+ ]
203
+ },
204
+ "then": {
205
+ "properties": {
206
+ "selector": {
207
+ "minLength": 1,
208
+ "type": "string"
209
+ }
210
+ },
211
+ "required": [
212
+ "selector"
213
+ ]
214
+ }
215
+ },
216
+ {
217
+ "if": {
218
+ "properties": {
219
+ "action": {
220
+ "const": "select"
221
+ }
222
+ },
223
+ "required": [
224
+ "action"
225
+ ]
226
+ },
227
+ "then": {
228
+ "properties": {
229
+ "option": {
230
+ "not": {
231
+ "type": "null"
232
+ }
233
+ },
234
+ "selector": {
235
+ "minLength": 1,
236
+ "type": "string"
237
+ }
238
+ },
239
+ "required": [
240
+ "option",
241
+ "selector"
242
+ ]
243
+ }
244
+ },
245
+ {
246
+ "if": {
247
+ "properties": {
248
+ "action": {
249
+ "const": "hover"
250
+ }
251
+ },
252
+ "required": [
253
+ "action"
254
+ ]
255
+ },
256
+ "then": {
257
+ "properties": {
258
+ "selector": {
259
+ "minLength": 1,
260
+ "type": "string"
261
+ }
262
+ },
263
+ "required": [
264
+ "selector"
265
+ ]
266
+ }
267
+ },
268
+ {
269
+ "if": {
270
+ "properties": {
271
+ "action": {
272
+ "const": "wait_for"
273
+ }
274
+ },
275
+ "required": [
276
+ "action"
277
+ ]
278
+ },
279
+ "then": {
280
+ "properties": {
281
+ "selector": {
282
+ "minLength": 1,
283
+ "type": "string"
284
+ }
285
+ },
286
+ "required": [
287
+ "selector"
288
+ ]
289
+ }
290
+ },
291
+ {
292
+ "if": {
293
+ "properties": {
294
+ "action": {
295
+ "const": "capture_count"
296
+ }
297
+ },
298
+ "required": [
299
+ "action"
300
+ ]
301
+ },
302
+ "then": {
303
+ "properties": {
304
+ "capture_as": {
305
+ "minLength": 1,
306
+ "type": "string"
307
+ },
308
+ "selector": {
309
+ "minLength": 1,
310
+ "type": "string"
311
+ }
312
+ },
313
+ "required": [
314
+ "capture_as",
315
+ "selector"
316
+ ]
317
+ }
318
+ },
319
+ {
320
+ "if": {
321
+ "properties": {
322
+ "action": {
323
+ "const": "expect"
324
+ }
325
+ },
326
+ "required": [
327
+ "action"
328
+ ]
329
+ },
330
+ "then": {
331
+ "properties": {
332
+ "expect_kind": {
333
+ "not": {
334
+ "type": "null"
335
+ }
336
+ }
337
+ },
338
+ "required": [
339
+ "expect_kind"
340
+ ]
341
+ }
342
+ },
343
+ {
344
+ "if": {
345
+ "properties": {
346
+ "action": {
347
+ "const": "await_email"
348
+ }
349
+ },
350
+ "required": [
351
+ "action"
352
+ ]
353
+ },
354
+ "then": {
355
+ "properties": {
356
+ "capture_as": {
357
+ "minLength": 1,
358
+ "type": "string"
359
+ },
360
+ "extract": {
361
+ "not": {
362
+ "type": "null"
363
+ }
364
+ }
365
+ },
366
+ "required": [
367
+ "capture_as",
368
+ "extract"
369
+ ]
370
+ }
371
+ },
372
+ {
373
+ "if": {
374
+ "properties": {
375
+ "action": {
376
+ "const": "upload"
377
+ }
378
+ },
379
+ "required": [
380
+ "action"
381
+ ]
382
+ },
383
+ "then": {
384
+ "properties": {
385
+ "selector": {
386
+ "minLength": 1,
387
+ "type": "string"
388
+ },
389
+ "value": {
390
+ "minLength": 1,
391
+ "type": "string"
392
+ }
393
+ },
394
+ "required": [
395
+ "selector",
396
+ "value"
397
+ ]
398
+ }
399
+ },
400
+ {
401
+ "if": {
402
+ "properties": {
403
+ "action": {
404
+ "const": "dialog"
405
+ }
406
+ },
407
+ "required": [
408
+ "action"
409
+ ]
410
+ },
411
+ "then": {
412
+ "properties": {
413
+ "dialog": {
414
+ "not": {
415
+ "type": "null"
416
+ }
417
+ }
418
+ },
419
+ "required": [
420
+ "dialog"
421
+ ]
422
+ }
423
+ },
424
+ {
425
+ "if": {
426
+ "properties": {
427
+ "action": {
428
+ "const": "switch_tab"
429
+ }
430
+ },
431
+ "required": [
432
+ "action"
433
+ ]
434
+ },
435
+ "then": {
436
+ "properties": {
437
+ "value": {
438
+ "minLength": 1,
439
+ "type": "string"
440
+ }
441
+ },
442
+ "required": [
443
+ "value"
444
+ ]
445
+ }
446
+ },
447
+ {
448
+ "if": {
449
+ "properties": {
450
+ "action": {
451
+ "const": "drag"
452
+ }
453
+ },
454
+ "required": [
455
+ "action"
456
+ ]
457
+ },
458
+ "then": {
459
+ "properties": {
460
+ "selector": {
461
+ "minLength": 1,
462
+ "type": "string"
463
+ },
464
+ "value": {
465
+ "minLength": 1,
466
+ "type": "string"
467
+ }
468
+ },
469
+ "required": [
470
+ "selector",
471
+ "value"
472
+ ]
473
+ }
474
+ },
475
+ {
476
+ "if": {
477
+ "properties": {
478
+ "expect_kind": {
479
+ "const": "have_text"
480
+ }
481
+ },
482
+ "required": [
483
+ "expect_kind"
484
+ ]
485
+ },
486
+ "then": {
487
+ "properties": {
488
+ "expect_text": {
489
+ "not": {
490
+ "type": "null"
491
+ }
492
+ },
493
+ "selector": {
494
+ "minLength": 1,
495
+ "type": "string"
496
+ }
497
+ },
498
+ "required": [
499
+ "expect_text",
500
+ "selector"
501
+ ]
502
+ }
503
+ },
504
+ {
505
+ "if": {
506
+ "properties": {
507
+ "expect_kind": {
508
+ "const": "have_value"
509
+ }
510
+ },
511
+ "required": [
512
+ "expect_kind"
513
+ ]
514
+ },
515
+ "then": {
516
+ "properties": {
517
+ "expect_text": {
518
+ "not": {
519
+ "type": "null"
520
+ }
521
+ },
522
+ "selector": {
523
+ "minLength": 1,
524
+ "type": "string"
525
+ }
526
+ },
527
+ "required": [
528
+ "expect_text",
529
+ "selector"
530
+ ]
531
+ }
532
+ },
533
+ {
534
+ "if": {
535
+ "properties": {
536
+ "expect_kind": {
537
+ "const": "have_url"
538
+ }
539
+ },
540
+ "required": [
541
+ "expect_kind"
542
+ ]
543
+ },
544
+ "then": {
545
+ "properties": {
546
+ "expect_text": {
547
+ "not": {
548
+ "type": "null"
549
+ }
550
+ }
551
+ },
552
+ "required": [
553
+ "expect_text"
554
+ ]
555
+ }
556
+ },
557
+ {
558
+ "if": {
559
+ "properties": {
560
+ "expect_kind": {
561
+ "const": "have_title"
562
+ }
563
+ },
564
+ "required": [
565
+ "expect_kind"
566
+ ]
567
+ },
568
+ "then": {
569
+ "properties": {
570
+ "expect_text": {
571
+ "not": {
572
+ "type": "null"
573
+ }
574
+ }
575
+ },
576
+ "required": [
577
+ "expect_text"
578
+ ]
579
+ }
580
+ },
581
+ {
582
+ "if": {
583
+ "properties": {
584
+ "expect_kind": {
585
+ "const": "have_count"
586
+ }
587
+ },
588
+ "required": [
589
+ "expect_kind"
590
+ ]
591
+ },
592
+ "then": {
593
+ "properties": {
594
+ "expect_count": {
595
+ "not": {
596
+ "type": "null"
597
+ }
598
+ },
599
+ "selector": {
600
+ "minLength": 1,
601
+ "type": "string"
602
+ }
603
+ },
604
+ "required": [
605
+ "expect_count",
606
+ "selector"
607
+ ]
608
+ }
609
+ },
610
+ {
611
+ "if": {
612
+ "properties": {
613
+ "expect_kind": {
614
+ "const": "count_delta"
615
+ }
616
+ },
617
+ "required": [
618
+ "expect_kind"
619
+ ]
620
+ },
621
+ "then": {
622
+ "properties": {
623
+ "capture_ref": {
624
+ "minLength": 1,
625
+ "type": "string"
626
+ },
627
+ "expect_delta": {
628
+ "not": {
629
+ "type": "null"
630
+ }
631
+ },
632
+ "selector": {
633
+ "minLength": 1,
634
+ "type": "string"
635
+ }
636
+ },
637
+ "required": [
638
+ "capture_ref",
639
+ "expect_delta",
640
+ "selector"
641
+ ]
642
+ }
643
+ },
644
+ {
645
+ "if": {
646
+ "properties": {
647
+ "expect_kind": {
648
+ "const": "visible"
649
+ }
650
+ },
651
+ "required": [
652
+ "expect_kind"
653
+ ]
654
+ },
655
+ "then": {
656
+ "properties": {
657
+ "selector": {
658
+ "minLength": 1,
659
+ "type": "string"
660
+ }
661
+ },
662
+ "required": [
663
+ "selector"
664
+ ]
665
+ }
666
+ },
667
+ {
668
+ "if": {
669
+ "properties": {
670
+ "expect_kind": {
671
+ "const": "attached"
672
+ }
673
+ },
674
+ "required": [
675
+ "expect_kind"
676
+ ]
677
+ },
678
+ "then": {
679
+ "properties": {
680
+ "selector": {
681
+ "minLength": 1,
682
+ "type": "string"
683
+ }
684
+ },
685
+ "required": [
686
+ "selector"
687
+ ]
688
+ }
689
+ },
690
+ {
691
+ "if": {
692
+ "properties": {
693
+ "expect_kind": {
694
+ "const": "hidden"
695
+ }
696
+ },
697
+ "required": [
698
+ "expect_kind"
699
+ ]
700
+ },
701
+ "then": {
702
+ "properties": {
703
+ "selector": {
704
+ "minLength": 1,
705
+ "type": "string"
706
+ }
707
+ },
708
+ "required": [
709
+ "selector"
710
+ ]
711
+ }
712
+ },
713
+ {
714
+ "if": {
715
+ "properties": {
716
+ "expect_kind": {
717
+ "const": "checked"
718
+ }
719
+ },
720
+ "required": [
721
+ "expect_kind"
722
+ ]
723
+ },
724
+ "then": {
725
+ "properties": {
726
+ "selector": {
727
+ "minLength": 1,
728
+ "type": "string"
729
+ }
730
+ },
731
+ "required": [
732
+ "selector"
733
+ ]
734
+ }
735
+ },
736
+ {
737
+ "if": {
738
+ "properties": {
739
+ "expect_kind": {
740
+ "const": "enabled"
741
+ }
742
+ },
743
+ "required": [
744
+ "expect_kind"
745
+ ]
746
+ },
747
+ "then": {
748
+ "properties": {
749
+ "selector": {
750
+ "minLength": 1,
751
+ "type": "string"
752
+ }
753
+ },
754
+ "required": [
755
+ "selector"
756
+ ]
757
+ }
758
+ },
759
+ {
760
+ "if": {
761
+ "properties": {
762
+ "expect_kind": {
763
+ "const": "disabled"
764
+ }
765
+ },
766
+ "required": [
767
+ "expect_kind"
768
+ ]
769
+ },
770
+ "then": {
771
+ "properties": {
772
+ "selector": {
773
+ "minLength": 1,
774
+ "type": "string"
775
+ }
776
+ },
777
+ "required": [
778
+ "selector"
779
+ ]
780
+ }
781
+ },
782
+ {
783
+ "if": {
784
+ "properties": {
785
+ "expect_kind": {
786
+ "const": "persisted"
787
+ }
788
+ },
789
+ "required": [
790
+ "expect_kind"
791
+ ]
792
+ },
793
+ "then": {
794
+ "properties": {
795
+ "selector": {
796
+ "minLength": 1,
797
+ "type": "string"
798
+ }
799
+ },
800
+ "required": [
801
+ "selector"
802
+ ]
803
+ }
804
+ },
805
+ {
806
+ "if": {
807
+ "properties": {
808
+ "expect_kind": {
809
+ "const": "gone"
810
+ }
811
+ },
812
+ "required": [
813
+ "expect_kind"
814
+ ]
815
+ },
816
+ "then": {
817
+ "properties": {
818
+ "selector": {
819
+ "minLength": 1,
820
+ "type": "string"
821
+ }
822
+ },
823
+ "required": [
824
+ "selector"
825
+ ]
826
+ }
827
+ },
828
+ {
829
+ "if": {
830
+ "properties": {
831
+ "action": {
832
+ "const": "await_email"
833
+ },
834
+ "extract": {
835
+ "const": "pattern"
836
+ }
837
+ },
838
+ "required": [
839
+ "action",
840
+ "extract"
841
+ ]
842
+ },
843
+ "then": {
844
+ "properties": {
845
+ "extract_pattern": {
846
+ "minLength": 1,
847
+ "type": "string"
848
+ }
849
+ },
850
+ "required": [
851
+ "extract_pattern"
852
+ ]
853
+ }
854
+ }
855
+ ],
856
+ "properties": {
857
+ "action": {
858
+ "$ref": "#/$defs/ActionType"
859
+ },
860
+ "capture_as": {
861
+ "anyOf": [
862
+ {
863
+ "not": {
864
+ "enum": [
865
+ "inbox_address",
866
+ "timestamp",
867
+ "unique",
868
+ "uuid"
869
+ ]
870
+ },
871
+ "pattern": "^[A-Za-z0-9_]+(?![\\s\\S])",
872
+ "type": "string"
873
+ },
874
+ {
875
+ "type": "null"
876
+ }
877
+ ],
878
+ "default": null,
879
+ "title": "Capture As"
880
+ },
881
+ "capture_ref": {
882
+ "anyOf": [
883
+ {
884
+ "type": "string"
885
+ },
886
+ {
887
+ "type": "null"
888
+ }
889
+ ],
890
+ "default": null,
891
+ "title": "Capture Ref"
892
+ },
893
+ "dialog": {
894
+ "anyOf": [
895
+ {
896
+ "$ref": "#/$defs/DialogChoice"
897
+ },
898
+ {
899
+ "type": "null"
900
+ }
901
+ ],
902
+ "default": null
903
+ },
904
+ "dialog_expect_text": {
905
+ "anyOf": [
906
+ {
907
+ "type": "string"
908
+ },
909
+ {
910
+ "type": "null"
911
+ }
912
+ ],
913
+ "default": null,
914
+ "title": "Dialog Expect Text"
915
+ },
916
+ "expect_count": {
917
+ "anyOf": [
918
+ {
919
+ "minimum": 0,
920
+ "type": "integer"
921
+ },
922
+ {
923
+ "type": "null"
924
+ }
925
+ ],
926
+ "default": null,
927
+ "title": "Expect Count"
928
+ },
929
+ "expect_delta": {
930
+ "anyOf": [
931
+ {
932
+ "type": "integer"
933
+ },
934
+ {
935
+ "type": "null"
936
+ }
937
+ ],
938
+ "default": null,
939
+ "title": "Expect Delta"
940
+ },
941
+ "expect_kind": {
942
+ "anyOf": [
943
+ {
944
+ "$ref": "#/$defs/ExpectKind"
945
+ },
946
+ {
947
+ "type": "null"
948
+ }
949
+ ],
950
+ "default": null
951
+ },
952
+ "expect_text": {
953
+ "anyOf": [
954
+ {
955
+ "not": {
956
+ "pattern": "\\{\\{\\s*(?!(?:timestamp|unique|uuid)\\s*\\}\\})[A-Za-z0-9_]+\\s*\\}\\}"
957
+ },
958
+ "type": "string"
959
+ },
960
+ {
961
+ "type": "null"
962
+ }
963
+ ],
964
+ "default": null,
965
+ "title": "Expect Text"
966
+ },
967
+ "extract": {
968
+ "anyOf": [
969
+ {
970
+ "$ref": "#/$defs/EmailExtract"
971
+ },
972
+ {
973
+ "type": "null"
974
+ }
975
+ ],
976
+ "default": null
977
+ },
978
+ "extract_pattern": {
979
+ "anyOf": [
980
+ {
981
+ "type": "string"
982
+ },
983
+ {
984
+ "type": "null"
985
+ }
986
+ ],
987
+ "default": null,
988
+ "title": "Extract Pattern"
989
+ },
990
+ "from_contains": {
991
+ "anyOf": [
992
+ {
993
+ "type": "string"
994
+ },
995
+ {
996
+ "type": "null"
997
+ }
998
+ ],
999
+ "default": null,
1000
+ "title": "From Contains"
1001
+ },
1002
+ "iframe": {
1003
+ "anyOf": [
1004
+ {
1005
+ "type": "string"
1006
+ },
1007
+ {
1008
+ "type": "null"
1009
+ }
1010
+ ],
1011
+ "default": null,
1012
+ "title": "Iframe"
1013
+ },
1014
+ "key": {
1015
+ "anyOf": [
1016
+ {
1017
+ "type": "string"
1018
+ },
1019
+ {
1020
+ "type": "null"
1021
+ }
1022
+ ],
1023
+ "default": null,
1024
+ "title": "Key"
1025
+ },
1026
+ "option": {
1027
+ "anyOf": [
1028
+ {
1029
+ "not": {
1030
+ "pattern": "\\{\\{\\s*(?!(?:timestamp|unique|uuid)\\s*\\}\\})[A-Za-z0-9_]+\\s*\\}\\}"
1031
+ },
1032
+ "type": "string"
1033
+ },
1034
+ {
1035
+ "type": "null"
1036
+ }
1037
+ ],
1038
+ "default": null,
1039
+ "title": "Option"
1040
+ },
1041
+ "selector": {
1042
+ "anyOf": [
1043
+ {
1044
+ "not": {
1045
+ "pattern": "\\{\\{\\s*(?!(?:timestamp|unique|uuid)\\s*\\}\\})[A-Za-z0-9_]+\\s*\\}\\}"
1046
+ },
1047
+ "type": "string"
1048
+ },
1049
+ {
1050
+ "type": "null"
1051
+ }
1052
+ ],
1053
+ "default": null,
1054
+ "title": "Selector"
1055
+ },
1056
+ "subject_contains": {
1057
+ "anyOf": [
1058
+ {
1059
+ "type": "string"
1060
+ },
1061
+ {
1062
+ "type": "null"
1063
+ }
1064
+ ],
1065
+ "default": null,
1066
+ "title": "Subject Contains"
1067
+ },
1068
+ "timeout_ms": {
1069
+ "anyOf": [
1070
+ {
1071
+ "maximum": 30000,
1072
+ "minimum": 100,
1073
+ "type": "integer"
1074
+ },
1075
+ {
1076
+ "type": "null"
1077
+ }
1078
+ ],
1079
+ "default": null,
1080
+ "title": "Timeout Ms"
1081
+ },
1082
+ "url": {
1083
+ "anyOf": [
1084
+ {
1085
+ "type": "string"
1086
+ },
1087
+ {
1088
+ "type": "null"
1089
+ }
1090
+ ],
1091
+ "default": null,
1092
+ "title": "Url"
1093
+ },
1094
+ "value": {
1095
+ "anyOf": [
1096
+ {
1097
+ "type": "string"
1098
+ },
1099
+ {
1100
+ "type": "null"
1101
+ }
1102
+ ],
1103
+ "default": null,
1104
+ "title": "Value"
1105
+ },
1106
+ "wait_s": {
1107
+ "anyOf": [
1108
+ {
1109
+ "maximum": 50,
1110
+ "minimum": 1,
1111
+ "type": "integer"
1112
+ },
1113
+ {
1114
+ "type": "null"
1115
+ }
1116
+ ],
1117
+ "default": null,
1118
+ "title": "Wait S"
1119
+ }
1120
+ },
1121
+ "required": [
1122
+ "action"
1123
+ ],
1124
+ "title": "PlanStep",
1125
+ "type": "object"
1126
+ }
1127
+ },
1128
+ "$id": "https://api.beryl.so/api/v1/schemas/action-plan.schema.json",
1129
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1130
+ "allOf": [
1131
+ {
1132
+ "$comment": "The first executed step must be a goto, so the test loads a page before acting (that is before[0] when there is a setup section, else steps[0]).",
1133
+ "else": {
1134
+ "properties": {
1135
+ "steps": {
1136
+ "prefixItems": [
1137
+ {
1138
+ "properties": {
1139
+ "action": {
1140
+ "const": "goto"
1141
+ }
1142
+ }
1143
+ }
1144
+ ]
1145
+ }
1146
+ }
1147
+ },
1148
+ "if": {
1149
+ "properties": {
1150
+ "before": {
1151
+ "minItems": 1,
1152
+ "type": "array"
1153
+ }
1154
+ },
1155
+ "required": [
1156
+ "before"
1157
+ ]
1158
+ },
1159
+ "then": {
1160
+ "properties": {
1161
+ "before": {
1162
+ "prefixItems": [
1163
+ {
1164
+ "properties": {
1165
+ "action": {
1166
+ "const": "goto"
1167
+ }
1168
+ }
1169
+ }
1170
+ ]
1171
+ }
1172
+ }
1173
+ }
1174
+ },
1175
+ {
1176
+ "$comment": "At least one step across before + steps must be an expect, or the test asserts nothing (an expect in `after` only checks the cleanup).",
1177
+ "if": {
1178
+ "required": [
1179
+ "steps"
1180
+ ]
1181
+ },
1182
+ "then": {
1183
+ "anyOf": [
1184
+ {
1185
+ "properties": {
1186
+ "steps": {
1187
+ "contains": {
1188
+ "properties": {
1189
+ "action": {
1190
+ "const": "expect"
1191
+ }
1192
+ },
1193
+ "required": [
1194
+ "action"
1195
+ ]
1196
+ }
1197
+ }
1198
+ }
1199
+ },
1200
+ {
1201
+ "properties": {
1202
+ "before": {
1203
+ "contains": {
1204
+ "properties": {
1205
+ "action": {
1206
+ "const": "expect"
1207
+ }
1208
+ },
1209
+ "required": [
1210
+ "action"
1211
+ ]
1212
+ }
1213
+ }
1214
+ },
1215
+ "required": [
1216
+ "before"
1217
+ ]
1218
+ }
1219
+ ]
1220
+ }
1221
+ }
1222
+ ],
1223
+ "properties": {
1224
+ "after": {
1225
+ "items": {
1226
+ "$ref": "#/$defs/PlanStep"
1227
+ },
1228
+ "title": "After",
1229
+ "type": "array"
1230
+ },
1231
+ "auth_label": {
1232
+ "anyOf": [
1233
+ {
1234
+ "type": "string"
1235
+ },
1236
+ {
1237
+ "type": "null"
1238
+ }
1239
+ ],
1240
+ "default": null,
1241
+ "title": "Auth Label"
1242
+ },
1243
+ "before": {
1244
+ "items": {
1245
+ "$ref": "#/$defs/PlanStep"
1246
+ },
1247
+ "title": "Before",
1248
+ "type": "array"
1249
+ },
1250
+ "requires_auth": {
1251
+ "default": false,
1252
+ "title": "Requires Auth",
1253
+ "type": "boolean"
1254
+ },
1255
+ "steps": {
1256
+ "items": {
1257
+ "$ref": "#/$defs/PlanStep"
1258
+ },
1259
+ "minItems": 1,
1260
+ "title": "Steps",
1261
+ "type": "array"
1262
+ }
1263
+ },
1264
+ "required": [
1265
+ "steps"
1266
+ ],
1267
+ "title": "Beryl ActionPlan",
1268
+ "type": "object"
1269
+ };