doc-detective-common 3.0.2 → 3.0.4-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.
- package/package.json +6 -5
- package/src/resolvePaths.js +90 -21
- package/src/schemas/dereferenceSchemas.js +1 -0
- package/src/schemas/output_schemas/config_v3.schema.json +79 -0
- package/src/schemas/output_schemas/report_v3.schema.json +4186 -7
- package/src/schemas/output_schemas/resolvedTests_v3.schema.json +19740 -0
- package/src/schemas/output_schemas/spec_v3.schema.json +4186 -7
- package/src/schemas/output_schemas/test_v3.schema.json +4177 -2
- package/src/schemas/schemas.json +51198 -18846
- package/src/schemas/src_schemas/config_v3.schema.json +46 -0
- package/src/schemas/src_schemas/resolvedTests_v3.schema.json +184 -0
- package/src/schemas/src_schemas/spec_v3.schema.json +4 -0
- package/src/schemas/src_schemas/test_v3.schema.json +26 -1
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
"description": "Identifier for the configuration.",
|
|
13
13
|
"type": "string"
|
|
14
14
|
},
|
|
15
|
+
"configPath": {
|
|
16
|
+
"description": "Path to the configuration file.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"readOnly": true
|
|
19
|
+
},
|
|
15
20
|
"input": {
|
|
16
21
|
"description": "Path(s) to test specifications and documentation source files. May be paths to specific files or to directories to scan for files.",
|
|
17
22
|
"default": ".",
|
|
@@ -202,10 +207,45 @@
|
|
|
202
207
|
"default": {
|
|
203
208
|
"send": true
|
|
204
209
|
}
|
|
210
|
+
},
|
|
211
|
+
"environment": {
|
|
212
|
+
"$ref": "#/components/schemas/environment"
|
|
205
213
|
}
|
|
206
214
|
},
|
|
207
215
|
"components": {
|
|
208
216
|
"schemas": {
|
|
217
|
+
"environment": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"description": "Environment information for the system running Doc Detective.",
|
|
220
|
+
"readmeOnly": true,
|
|
221
|
+
"additionalProperties": false,
|
|
222
|
+
"required": ["platform"],
|
|
223
|
+
"properties": {
|
|
224
|
+
"workingDirectory": {
|
|
225
|
+
"description": "The current working directory of the process running Doc Detective.",
|
|
226
|
+
"type": "string"
|
|
227
|
+
},
|
|
228
|
+
"platform": {
|
|
229
|
+
"description": "The operating system type running Doc Detective.",
|
|
230
|
+
"type": "string",
|
|
231
|
+
"enum": [
|
|
232
|
+
"linux",
|
|
233
|
+
"mac",
|
|
234
|
+
"windows"
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
"arch": {
|
|
238
|
+
"description": "The processor architecture of the system running Doc Detective.",
|
|
239
|
+
"type": "string",
|
|
240
|
+
"enum": [
|
|
241
|
+
"arm32",
|
|
242
|
+
"arm64",
|
|
243
|
+
"x32",
|
|
244
|
+
"x64"
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
209
249
|
"markupDefinition": {
|
|
210
250
|
"type": "object",
|
|
211
251
|
"properties": {
|
|
@@ -390,6 +430,12 @@
|
|
|
390
430
|
}
|
|
391
431
|
}
|
|
392
432
|
]
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"environment": {
|
|
436
|
+
"platform": "windows",
|
|
437
|
+
"arch": "x64"
|
|
438
|
+
}
|
|
393
439
|
}
|
|
394
440
|
]
|
|
395
441
|
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "resolvedTests",
|
|
4
|
+
"description": "A collection of resolved tests ready to be performed.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"dynamicDefaults": {
|
|
7
|
+
"reportId": "uuid"
|
|
8
|
+
},
|
|
9
|
+
"properties": {
|
|
10
|
+
"resolvedTestsId": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"description": "Unique identifier for the resolved tests."
|
|
13
|
+
},
|
|
14
|
+
"config": {
|
|
15
|
+
"$ref": "config_v3.schema.json#"
|
|
16
|
+
},
|
|
17
|
+
"specs": {
|
|
18
|
+
"description": "Test specifications that were performed.",
|
|
19
|
+
"type": "array",
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"items": {
|
|
22
|
+
"anyOf": [{ "$ref": "spec_v3.schema.json#" }]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"required": ["specs"],
|
|
27
|
+
"examples": [
|
|
28
|
+
{
|
|
29
|
+
"config": {
|
|
30
|
+
"input": [
|
|
31
|
+
"/home/hawkeyexl/Workspaces/resolver/dev/doc-content-yaml.md"
|
|
32
|
+
],
|
|
33
|
+
"logLevel": "debug",
|
|
34
|
+
"output": ".",
|
|
35
|
+
"recursive": true,
|
|
36
|
+
"relativePathBase": "file",
|
|
37
|
+
"detectSteps": true,
|
|
38
|
+
"fileTypes": [
|
|
39
|
+
{
|
|
40
|
+
"name": "markdown",
|
|
41
|
+
"extensions": ["md", "markdown", "mdx"],
|
|
42
|
+
"inlineStatements": {
|
|
43
|
+
"testStart": [
|
|
44
|
+
"{\\/\\*\\s*test\\s+?([\\s\\S]*?)\\s*\\*\\/}",
|
|
45
|
+
"<!--\\s*test\\s*([\\s\\S]*?)\\s*-->",
|
|
46
|
+
"\\[comment\\]:\\s+#\\s+\\(test\\s*(.*?)\\s*\\)",
|
|
47
|
+
"\\[comment\\]:\\s+#\\s+\\(test start\\s*(.*?)\\s*\\)"
|
|
48
|
+
],
|
|
49
|
+
"testEnd": [
|
|
50
|
+
"{\\/\\*\\s*test end\\s*\\*\\/}",
|
|
51
|
+
"<!--\\s*test end\\s*([\\s\\S]*?)\\s*-->",
|
|
52
|
+
"\\[comment\\]:\\s+#\\s+\\(test end\\)"
|
|
53
|
+
],
|
|
54
|
+
"ignoreStart": [
|
|
55
|
+
"{\\/\\*\\s*test ignore start\\s*\\*\\/}",
|
|
56
|
+
"<!--\\s*test ignore start\\s*-->"
|
|
57
|
+
],
|
|
58
|
+
"ignoreEnd": [
|
|
59
|
+
"{\\/\\*\\s*test ignore end\\s*\\*\\/}",
|
|
60
|
+
"<!--\\s*test ignore end\\s*-->"
|
|
61
|
+
],
|
|
62
|
+
"step": [
|
|
63
|
+
"{\\/\\*\\s*step\\s+?([\\s\\S]*?)\\s*\\*\\/}",
|
|
64
|
+
"<!--\\s*step\\s*([\\s\\S]*?)\\s*-->",
|
|
65
|
+
"\\[comment\\]:\\s+#\\s+\\(step\\s*(.*?)\\s*\\)"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"markup": [
|
|
69
|
+
{
|
|
70
|
+
"name": "checkHyperlink",
|
|
71
|
+
"regex": [
|
|
72
|
+
"(?<!\\!)\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
|
|
73
|
+
],
|
|
74
|
+
"actions": ["checkLink"]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "clickOnscreenText",
|
|
78
|
+
"regex": [
|
|
79
|
+
"\\b(?:[Cc]lick|[Tt]ap|[Ll]eft-click|[Cc]hoose|[Ss]elect|[Cc]heck)\\b\\s+\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
|
|
80
|
+
],
|
|
81
|
+
"actions": ["click"]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "findOnscreenText",
|
|
85
|
+
"regex": ["\\*\\*((?:(?!\\*\\*).)+)\\*\\*"],
|
|
86
|
+
"actions": ["find"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "goToUrl",
|
|
90
|
+
"regex": [
|
|
91
|
+
"\\b(?:[Gg]o\\s+to|[Oo]pen|[Nn]avigate\\s+to|[Vv]isit|[Aa]ccess|[Pp]roceed\\s+to|[Ll]aunch)\\b\\s+\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
|
|
92
|
+
],
|
|
93
|
+
"actions": ["goTo"]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "screenshotImage",
|
|
97
|
+
"regex": [
|
|
98
|
+
"!\\[[^\\]]*\\]\\(\\s*([^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)\\s*\\{(?=[^}]*\\.screenshot)[^}]*\\}"
|
|
99
|
+
],
|
|
100
|
+
"actions": ["screenshot"]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "typeText",
|
|
104
|
+
"regex": ["\\b(?:press|enter|type)\\b\\s+\"([^\"]+)\""],
|
|
105
|
+
"actions": ["type"]
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "asciidoc",
|
|
111
|
+
"extensions": ["adoc", "asciidoc", "asc"],
|
|
112
|
+
"inlineStatements": {
|
|
113
|
+
"testStart": ["\\/\\/\\s+\\(\\s*test\\s+([\\s\\S]*?)\\s*\\)"],
|
|
114
|
+
"testEnd": ["\\/\\/\\s+\\(\\s*test end\\s*\\)"],
|
|
115
|
+
"ignoreStart": ["\\/\\/\\s+\\(\\s*test ignore start\\s*\\)"],
|
|
116
|
+
"ignoreEnd": ["\\/\\/\\s+\\(\\s*test ignore end\\s*\\)"],
|
|
117
|
+
"step": ["\\/\\/\\s+\\(\\s*step\\s+([\\s\\S]*?)\\s*\\)"]
|
|
118
|
+
},
|
|
119
|
+
"markup": []
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "html",
|
|
123
|
+
"extensions": ["html", "htm"],
|
|
124
|
+
"inlineStatements": {
|
|
125
|
+
"testStart": ["<!--\\s*test\\s+?([\\s\\S]*?)\\s*-->"],
|
|
126
|
+
"testEnd": ["<!--\\s*test end\\s*([\\s\\S]*?)\\s*-->"],
|
|
127
|
+
"ignoreStart": ["<!--\\s*test ignore start\\s*-->"],
|
|
128
|
+
"ignoreEnd": ["<!--\\s*test ignore end\\s*-->"],
|
|
129
|
+
"step": ["<!--\\s*step\\s+?([\\s\\S]*?)\\s*-->"]
|
|
130
|
+
},
|
|
131
|
+
"markup": []
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"telemetry": {
|
|
135
|
+
"send": true
|
|
136
|
+
},
|
|
137
|
+
"configId": "3e467e5d-27cb-41f3-800f-aeb3c20dcb4c",
|
|
138
|
+
"environment": {
|
|
139
|
+
"arch": "x64",
|
|
140
|
+
"platform": "linux",
|
|
141
|
+
"workingDirectory": "/home/hawkeyexl/Workspaces/resolver"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"specs": [
|
|
145
|
+
{
|
|
146
|
+
"specId": "cc656bba-132f-4f0f-b093-2cfbdd784f69",
|
|
147
|
+
"contentPath": "/home/hawkeyexl/Workspaces/resolver/dev/doc-content-yaml.md",
|
|
148
|
+
"tests": [
|
|
149
|
+
{
|
|
150
|
+
"testId": "doc-detective-docs",
|
|
151
|
+
"detectSteps": false,
|
|
152
|
+
"runOn": [],
|
|
153
|
+
"openApi": [],
|
|
154
|
+
"contexts": [
|
|
155
|
+
{
|
|
156
|
+
"steps": [
|
|
157
|
+
{
|
|
158
|
+
"checkLink": "https://doc-detective.com"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"checkLink": "https://doc-detective.com/docs/get-started/intro"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"goTo": "https://doc-detective.com/docs/get-started/actions/type"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"find": "Special keys"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"screenshot": "reference.png"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"contextId": "eec1d123-7dfd-4362-b41a-942f36e0da5a"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"runOn": [],
|
|
179
|
+
"openApi": []
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"type": "string",
|
|
15
15
|
"description": "Description of the test specification."
|
|
16
16
|
},
|
|
17
|
+
"specPath": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Path to the test specification."
|
|
20
|
+
},
|
|
17
21
|
"contentPath": {
|
|
18
22
|
"type": "string",
|
|
19
23
|
"description": "Path to the content that the specification is associated with."
|
|
@@ -64,12 +64,37 @@
|
|
|
64
64
|
"items": {
|
|
65
65
|
"$ref": "step_v3.schema.json#"
|
|
66
66
|
}
|
|
67
|
+
},
|
|
68
|
+
"contexts": {
|
|
69
|
+
"array": "array",
|
|
70
|
+
"readOnly": true,
|
|
71
|
+
"description": "Resolved contexts to run the test in. This is a resolved version of the `runOn` property. It is not user-defined and should not be used in test specifications.",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"properties": {
|
|
75
|
+
"platform": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Platform to run the test on. This is a resolved version of the `platforms` property."
|
|
78
|
+
},
|
|
79
|
+
"browser": {
|
|
80
|
+
"$ref": "context_v3.schema.json#/components/schemas/browser"
|
|
81
|
+
},
|
|
82
|
+
"steps": {
|
|
83
|
+
"description": "Steps to perform as part of the test. Performed in the sequence defined. If one or more actions fail, the test fails. By default, if a step fails, the test stops and the remaining steps are not executed.",
|
|
84
|
+
"type": "array",
|
|
85
|
+
"minItems": 1,
|
|
86
|
+
"items": {
|
|
87
|
+
"$ref": "step_v3.schema.json#"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
67
92
|
}
|
|
68
93
|
},
|
|
69
94
|
"dynamicDefaults": {
|
|
70
95
|
"testId": "uuid"
|
|
71
96
|
},
|
|
72
|
-
"required": ["steps"],
|
|
97
|
+
"anyOf": [{ "required": ["steps"] }, { "required": ["contexts"] }],
|
|
73
98
|
"additionalProperties": false,
|
|
74
99
|
"examples": [
|
|
75
100
|
{
|