doc-detective-common 1.9.0-record.0 → 1.10.0-dev.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.
@@ -18,7 +18,6 @@ jobs:
18
18
  - windows-latest
19
19
  - macos-latest
20
20
  node:
21
- - 16
22
21
  - 18
23
22
  - 20
24
23
 
@@ -18,7 +18,6 @@ jobs:
18
18
  - windows-latest
19
19
  - macos-latest
20
20
  node:
21
- - 16
22
21
  - 18
23
22
  - 20
24
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-detective-common",
3
- "version": "1.9.0-record.0",
3
+ "version": "1.10.0-dev.0",
4
4
  "description": "Shared components for Doc Detective projects. ",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -27,8 +27,6 @@ async function dereferenceSchemas() {
27
27
  "runShell_v2.schema.json",
28
28
  "saveScreenshot_v2.schema.json",
29
29
  "setVariables_v2.schema.json",
30
- "startRecording_v2.schema.json",
31
- "stopRecording_v2.schema.json",
32
30
  "spec_v2.schema.json",
33
31
  "test_v2.schema.json",
34
32
  "typeKeys_v2.schema.json",
@@ -63,6 +61,17 @@ async function dereferenceSchemas() {
63
61
  // Write to file
64
62
  fs.writeFileSync(`${outputDir}/${file}`, JSON.stringify(schema, null, 2));
65
63
  }
64
+ // Build final schemas.json file
65
+ const schemas = {};
66
+ files.forEach(async (file) => {
67
+ const key = file.replace(".schema.json", "");
68
+ // Load schema from file
69
+ let schema = require(`${outputDir}/${file}`);
70
+ // Load into `schema` object
71
+ schemas[key] = schema;
72
+ });
73
+ fs.writeFileSync(`${__dirname}/schemas.json`, JSON.stringify(schemas,null,2));
74
+
66
75
  // Clean up build dir
67
76
  // fs.rm(buildDir, { recursive: true }, (err) => {
68
77
  // if (err) throw err;
@@ -1,34 +1,6 @@
1
- // Load schemas from file
2
- const schemas = {};
3
- // Read files from schema directory
4
- path = `${__dirname}/output_schemas`;
5
- var files = [
6
- "checkLink_v2.schema.json",
7
- "config_v2.schema.json",
8
- "context_v2.schema.json",
9
- "find_v2.schema.json",
10
- "goTo_v2.schema.json",
11
- "httpRequest_v2.schema.json",
12
- "runShell_v2.schema.json",
13
- "saveScreenshot_v2.schema.json",
14
- "setVariables_v2.schema.json",
15
- "startRecording_v2.schema.json",
16
- "stopRecording_v2.schema.json",
17
- "spec_v2.schema.json",
18
- "test_v2.schema.json",
19
- "typeKeys_v2.schema.json",
20
- "wait_v2.schema.json",
21
- ];
22
- // Loop through all schema files
23
- files.forEach(async (file) => {
24
- const key = file.replace(".schema.json", "");
25
- // Load schema from file
26
- let schema = require(`${path}/${file}`);
27
- // Load into `schema` object
28
- schemas[key] = schema;
29
- });
1
+ const schemas = require("./schemas.json");
30
2
 
31
3
  // Exports
32
4
  exports.schemas = schemas;
33
5
 
34
- // console.log(schemas);
6
+ console.log(schemas);
@@ -130,10 +130,6 @@
130
130
  "type": "object",
131
131
  "description": "An application and supported platforms.\n\nIf no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it. For browsers, context priority is Firefox > Chrome > Chromium.",
132
132
  "properties": {
133
- "id": {
134
- "type": "string",
135
- "description": "Unique identifier for the context."
136
- },
137
133
  "app": {
138
134
  "type": "object",
139
135
  "description": "The application to run.",
@@ -192,9 +188,6 @@
192
188
  "app",
193
189
  "platforms"
194
190
  ],
195
- "dynamicDefaults": {
196
- "id": "uuid"
197
- },
198
191
  "additionalProperties": false,
199
192
  "examples": [
200
193
  {
@@ -3,10 +3,6 @@
3
3
  "type": "object",
4
4
  "description": "An application and supported platforms.\n\nIf no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it. For browsers, context priority is Firefox > Chrome > Chromium.",
5
5
  "properties": {
6
- "id": {
7
- "type": "string",
8
- "description": "Unique identifier for the context."
9
- },
10
6
  "app": {
11
7
  "type": "object",
12
8
  "description": "The application to run.",
@@ -65,9 +61,6 @@
65
61
  "app",
66
62
  "platforms"
67
63
  ],
68
- "dynamicDefaults": {
69
- "id": "uuid"
70
- },
71
64
  "additionalProperties": false,
72
65
  "examples": [
73
66
  {
@@ -24,10 +24,6 @@
24
24
  "type": "object",
25
25
  "description": "An application and supported platforms.\n\nIf no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it. For browsers, context priority is Firefox > Chrome > Chromium.",
26
26
  "properties": {
27
- "id": {
28
- "type": "string",
29
- "description": "Unique identifier for the context."
30
- },
31
27
  "app": {
32
28
  "type": "object",
33
29
  "description": "The application to run.",
@@ -86,9 +82,6 @@
86
82
  "app",
87
83
  "platforms"
88
84
  ],
89
- "dynamicDefaults": {
90
- "id": "uuid"
91
- },
92
85
  "additionalProperties": false,
93
86
  "examples": [
94
87
  {
@@ -175,10 +168,6 @@
175
168
  "type": "object",
176
169
  "description": "An application and supported platforms.\n\nIf no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it. For browsers, context priority is Firefox > Chrome > Chromium.",
177
170
  "properties": {
178
- "id": {
179
- "type": "string",
180
- "description": "Unique identifier for the context."
181
- },
182
171
  "app": {
183
172
  "type": "object",
184
173
  "description": "The application to run.",
@@ -237,9 +226,6 @@
237
226
  "app",
238
227
  "platforms"
239
228
  ],
240
- "dynamicDefaults": {
241
- "id": "uuid"
242
- },
243
229
  "additionalProperties": false,
244
230
  "examples": [
245
231
  {
@@ -808,89 +794,6 @@
808
794
  }
809
795
  ]
810
796
  },
811
- {
812
- "title": "startRecording",
813
- "type": "object",
814
- "description": "Start recording the current browser viewport. Must be followed by a `stopeRecording` action. Supported extensions: [ '.mp4', '.webm', '.gif' ]",
815
- "properties": {
816
- "id": {
817
- "type": "string",
818
- "description": "ID of the step."
819
- },
820
- "description": {
821
- "type": "string",
822
- "description": "Description of the step."
823
- },
824
- "action": {
825
- "type": "string",
826
- "const": "startRecording",
827
- "description": "The action to perform."
828
- },
829
- "path": {
830
- "type": "string",
831
- "description": "File path of the recording relative to `directory`. Supports the `.mp4`, `.webm`, and `.gif` extensions. If not specified, the file name is the ID of the step, and the extension is `.mp4`.",
832
- "pattern": "([A-Za-z0-9_-]*\\.(mp4|MP4|webm|WEBM|gif|GIF)$|\\$[A-Za-z0-9_]+)"
833
- },
834
- "directory": {
835
- "type": "string",
836
- "description": "Directory of the recording. Attempts to create the directory if it doesn't exist. If not specified, the directory is your media directory."
837
- },
838
- "overwrite": {
839
- "type": "boolean",
840
- "description": "If `true`, overwrites the existing file at `path` if it exists.",
841
- "default": false
842
- },
843
- "fps": {
844
- "type": "integer",
845
- "description": "Target frames-per-second for the recording.",
846
- "default": 30
847
- }
848
- },
849
- "dynamicDefaults": {
850
- "id": "uuid"
851
- },
852
- "required": [
853
- "action"
854
- ],
855
- "additionalProperties": false,
856
- "examples": [
857
- {
858
- "action": "startRecording"
859
- },
860
- {
861
- "action": "startRecording",
862
- "path": "results.mp4",
863
- "fps": 30
864
- },
865
- {
866
- "action": "startRecording",
867
- "path": "results.mp4",
868
- "directory": "media",
869
- "overwrite": true,
870
- "fps": 30
871
- }
872
- ]
873
- },
874
- {
875
- "title": "stopRecording",
876
- "type": "object",
877
- "description": "Stop the recording for the current test and context.",
878
- "properties": {
879
- "action": {
880
- "type": "string",
881
- "const": "stopRecording"
882
- }
883
- },
884
- "additionalProperties": false,
885
- "required": [
886
- "action"
887
- ],
888
- "examples": [
889
- {
890
- "action": "stopRecording"
891
- }
892
- ]
893
- },
894
797
  {
895
798
  "title": "typeKeys",
896
799
  "type": "object",
@@ -928,6 +831,9 @@
928
831
  ]
929
832
  }
930
833
  },
834
+ "dynamicDefaults": {
835
+ "id": "uuid"
836
+ },
931
837
  "required": [
932
838
  "action",
933
839
  "keys"
@@ -1171,9 +1077,6 @@
1171
1077
  201
1172
1078
  ]
1173
1079
  },
1174
- {
1175
- "action": "startRecording"
1176
- },
1177
1080
  {
1178
1081
  "action": "goTo",
1179
1082
  "url": "https://www.duckduckgo.com"
@@ -1197,13 +1100,6 @@
1197
1100
  "$ENTER$"
1198
1101
  ]
1199
1102
  },
1200
- {
1201
- "action": "wait",
1202
- "duration": 10000
1203
- },
1204
- {
1205
- "action": "stopRecording"
1206
- },
1207
1103
  {
1208
1104
  "action": "saveScreenshot"
1209
1105
  }
@@ -1,63 +1,47 @@
1
- {
2
- "title": "startRecording",
3
- "type": "object",
4
- "description": "Start recording the current browser viewport. Must be followed by a `stopeRecording` action. Supported extensions: [ '.mp4', '.webm', '.gif' ]",
5
- "properties": {
6
- "id": {
7
- "type": "string",
8
- "description": "ID of the step."
9
- },
10
- "description": {
11
- "type": "string",
12
- "description": "Description of the step."
13
- },
14
- "action": {
15
- "type": "string",
16
- "const": "startRecording",
17
- "description": "The action to perform."
18
- },
19
- "path": {
20
- "type": "string",
21
- "description": "File path of the recording relative to `directory`. Supports the `.mp4`, `.webm`, and `.gif` extensions. If not specified, the file name is the ID of the step, and the extension is `.mp4`.",
22
- "pattern": "([A-Za-z0-9_-]*\\.(mp4|MP4|webm|WEBM|gif|GIF)$|\\$[A-Za-z0-9_]+)"
23
- },
24
- "directory": {
25
- "type": "string",
26
- "description": "Directory of the recording. Attempts to create the directory if it doesn't exist. If not specified, the directory is your media directory."
27
- },
28
- "overwrite": {
29
- "type": "boolean",
30
- "description": "If `true`, overwrites the existing file at `path` if it exists.",
31
- "default": false
32
- },
33
- "fps": {
34
- "type": "integer",
35
- "description": "Target frames-per-second for the recording.",
36
- "default": 30
37
- }
38
- },
39
- "dynamicDefaults": {
40
- "id": "uuid"
41
- },
42
- "required": [
43
- "action"
44
- ],
45
- "additionalProperties": false,
46
- "examples": [
47
- {
48
- "action": "startRecording"
49
- },
50
- {
51
- "action": "startRecording",
52
- "path": "results.mp4",
53
- "fps": 30
54
- },
55
- {
56
- "action": "startRecording",
57
- "path": "results.mp4",
58
- "directory": "media",
59
- "overwrite": true,
60
- "fps": 30
61
- }
62
- ]
1
+ {
2
+ "title": "startRecording",
3
+ "type": "object",
4
+ "description": "Start recording the current browser viewport. Must be followed by a `stopeRecording` action. Supported extensions: [ '.mp4', '.webm', '.gif' ]",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "description": "ID of the step."
9
+ },
10
+ "description": {
11
+ "type": "string",
12
+ "description": "Description of the step."
13
+ },
14
+ "action": {
15
+ "type": "string",
16
+ "const": "startRecording",
17
+ "description": "The action to perform."
18
+ },
19
+ "path": {
20
+ "type": "string",
21
+ "description": "File path of the recording. Supports the `.mp4`, `.webm`, and `.gif` extensions. If not specified, the file path is your media directory, the file name is the ID of the step, and the extension is `.mp4`.",
22
+ "pattern": "([A-Za-z0-9_-]*\\.(mp4|MP4|webm|WEBM|gif|GIF)$|\\$[A-Za-z0-9_]+)"
23
+ },
24
+ "fps": {
25
+ "type": "integer",
26
+ "description": "Target frames-per-second for the recording.",
27
+ "default": 30
28
+ }
29
+ },
30
+ "dynamicDefaults": {
31
+ "id": "uuid"
32
+ },
33
+ "required": [
34
+ "action"
35
+ ],
36
+ "additionalProperties": false,
37
+ "examples": [
38
+ {
39
+ "action": "startRecording"
40
+ },
41
+ {
42
+ "action": "startRecording",
43
+ "path": "results.mp4",
44
+ "fps": 30
45
+ }
46
+ ]
63
47
  }
@@ -29,10 +29,6 @@
29
29
  "type": "object",
30
30
  "description": "An application and supported platforms.\n\nIf no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it. For browsers, context priority is Firefox > Chrome > Chromium.",
31
31
  "properties": {
32
- "id": {
33
- "type": "string",
34
- "description": "Unique identifier for the context."
35
- },
36
32
  "app": {
37
33
  "type": "object",
38
34
  "description": "The application to run.",
@@ -91,9 +87,6 @@
91
87
  "app",
92
88
  "platforms"
93
89
  ],
94
- "dynamicDefaults": {
95
- "id": "uuid"
96
- },
97
90
  "additionalProperties": false,
98
91
  "examples": [
99
92
  {
@@ -662,89 +655,6 @@
662
655
  }
663
656
  ]
664
657
  },
665
- {
666
- "title": "startRecording",
667
- "type": "object",
668
- "description": "Start recording the current browser viewport. Must be followed by a `stopeRecording` action. Supported extensions: [ '.mp4', '.webm', '.gif' ]",
669
- "properties": {
670
- "id": {
671
- "type": "string",
672
- "description": "ID of the step."
673
- },
674
- "description": {
675
- "type": "string",
676
- "description": "Description of the step."
677
- },
678
- "action": {
679
- "type": "string",
680
- "const": "startRecording",
681
- "description": "The action to perform."
682
- },
683
- "path": {
684
- "type": "string",
685
- "description": "File path of the recording relative to `directory`. Supports the `.mp4`, `.webm`, and `.gif` extensions. If not specified, the file name is the ID of the step, and the extension is `.mp4`.",
686
- "pattern": "([A-Za-z0-9_-]*\\.(mp4|MP4|webm|WEBM|gif|GIF)$|\\$[A-Za-z0-9_]+)"
687
- },
688
- "directory": {
689
- "type": "string",
690
- "description": "Directory of the recording. Attempts to create the directory if it doesn't exist. If not specified, the directory is your media directory."
691
- },
692
- "overwrite": {
693
- "type": "boolean",
694
- "description": "If `true`, overwrites the existing file at `path` if it exists.",
695
- "default": false
696
- },
697
- "fps": {
698
- "type": "integer",
699
- "description": "Target frames-per-second for the recording.",
700
- "default": 30
701
- }
702
- },
703
- "dynamicDefaults": {
704
- "id": "uuid"
705
- },
706
- "required": [
707
- "action"
708
- ],
709
- "additionalProperties": false,
710
- "examples": [
711
- {
712
- "action": "startRecording"
713
- },
714
- {
715
- "action": "startRecording",
716
- "path": "results.mp4",
717
- "fps": 30
718
- },
719
- {
720
- "action": "startRecording",
721
- "path": "results.mp4",
722
- "directory": "media",
723
- "overwrite": true,
724
- "fps": 30
725
- }
726
- ]
727
- },
728
- {
729
- "title": "stopRecording",
730
- "type": "object",
731
- "description": "Stop the recording for the current test and context.",
732
- "properties": {
733
- "action": {
734
- "type": "string",
735
- "const": "stopRecording"
736
- }
737
- },
738
- "additionalProperties": false,
739
- "required": [
740
- "action"
741
- ],
742
- "examples": [
743
- {
744
- "action": "stopRecording"
745
- }
746
- ]
747
- },
748
658
  {
749
659
  "title": "typeKeys",
750
660
  "type": "object",
@@ -782,6 +692,9 @@
782
692
  ]
783
693
  }
784
694
  },
695
+ "dynamicDefaults": {
696
+ "id": "uuid"
697
+ },
785
698
  "required": [
786
699
  "action",
787
700
  "keys"
@@ -1025,9 +938,6 @@
1025
938
  201
1026
939
  ]
1027
940
  },
1028
- {
1029
- "action": "startRecording"
1030
- },
1031
941
  {
1032
942
  "action": "goTo",
1033
943
  "url": "https://www.duckduckgo.com"
@@ -1051,13 +961,6 @@
1051
961
  "$ENTER$"
1052
962
  ]
1053
963
  },
1054
- {
1055
- "action": "wait",
1056
- "duration": 10000
1057
- },
1058
- {
1059
- "action": "stopRecording"
1060
- },
1061
964
  {
1062
965
  "action": "saveScreenshot"
1063
966
  }
@@ -35,6 +35,9 @@
35
35
  ]
36
36
  }
37
37
  },
38
+ "dynamicDefaults": {
39
+ "id": "uuid"
40
+ },
38
41
  "required": [
39
42
  "action",
40
43
  "keys"