doc-detective 3.5.0-dev.0 → 3.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.
Files changed (43) hide show
  1. package/.github/FUNDING.yml +14 -14
  2. package/.github/dependabot.yml +11 -11
  3. package/.github/workflows/auto-dev-release.yml +173 -173
  4. package/.github/workflows/npm-test.yaml +95 -96
  5. package/.github/workflows/update-core.yaml +131 -131
  6. package/CONTRIBUTIONS.md +27 -27
  7. package/LICENSE +661 -661
  8. package/README.md +110 -110
  9. package/dev/dev.config.json +3 -8
  10. package/dev/dev.spec.json +30 -30
  11. package/dev/index.js +5 -5
  12. package/package.json +47 -47
  13. package/samples/.doc-detective.json +94 -94
  14. package/samples/doc-content-detect.md +10 -10
  15. package/samples/doc-content-inline-tests.md +23 -23
  16. package/samples/docker-hello.spec.json +15 -15
  17. package/samples/env +2 -2
  18. package/samples/http.spec.yaml +37 -37
  19. package/samples/kitten-search-detect.md +7 -7
  20. package/samples/kitten-search-inline.md +15 -15
  21. package/samples/kitten-search.spec.json +28 -28
  22. package/samples/local-gui.md +5 -5
  23. package/samples/tests.spec.json +70 -70
  24. package/samples/variables.env +4 -4
  25. package/scripts/bump-sync-version-core.js +108 -110
  26. package/src/checkDependencies.js +84 -84
  27. package/src/index.js +72 -72
  28. package/src/utils.js +1023 -1023
  29. package/test/artifacts/cleanup.spec.json +18 -18
  30. package/test/artifacts/config.json +6 -6
  31. package/test/artifacts/doc-content.md +23 -23
  32. package/test/artifacts/env +2 -2
  33. package/test/artifacts/httpRequest.spec.yaml +37 -37
  34. package/test/artifacts/runShell.spec.json +29 -29
  35. package/test/artifacts/setup.spec.json +18 -18
  36. package/test/artifacts/test.spec.json +46 -46
  37. package/test/resolvedTests.test.js +193 -193
  38. package/test/runTests.test.js +53 -53
  39. package/test/server/index.js +185 -185
  40. package/test/server/public/index.html +174 -174
  41. package/test/test-config.json +12 -12
  42. package/test/test-results.json +124 -124
  43. package/test/utils.test.js +298 -298
package/README.md CHANGED
@@ -1,110 +1,110 @@
1
- # <img src="https://github.com/doc-detective/doc-detective/blob/main/icon.png" width=50 style="vertical-align:middle;margin-bottom:7px"/> Doc Detective: The Documentation Testing Framework
2
-
3
- ![Current version](https://img.shields.io/github/package-json/v/doc-detective/doc-detective?color=orange)
4
- [![NPM Shield](https://img.shields.io/npm/v/doc-detective)](https://www.npmjs.com/package/doc-detective)
5
- [![Discord Shield](https://img.shields.io/badge/chat-on%20discord-purple)](https://discord.gg/2M7wXEThfF)
6
- [![Docs Shield](https://img.shields.io/badge/docs-doc--detective.com-blue)](https://doc-detective.com)
7
-
8
- Doc Detective is doc content testing framework that makes it easy to keep your docs accurate and up-to-date. You write tests, and Doc Detective runs them directly against your product to make sure your docs match your user experience. Whether it’s a UI-based process or a series of API calls, Doc Detective can help you find doc bugs before your users do.
9
-
10
- Doc Detective ingests test specifications and text files, parses them for testable actions, then executes those actions in a browser. The results (PASS/FAIL and context) are output as a JSON object so that other pieces of infrastructure can parse and manipulate them as needed.
11
-
12
- This project handles test parsing and web-based UI testing---it doesn't support results reporting or notifications. This framework is a part of testing infrastructures and needs to be complemented by other components.
13
-
14
- ## Components
15
-
16
- Doc Detective has multiple components to integrate with your workflows as you need it to:
17
-
18
- - Doc Detective (this repo): A standalone tool that enables testing without a separate Node project.
19
- - [Doc Detective Core](https://github.com/doc-detective/doc-detective-core): An NPM package that provides the testing functionality.
20
- - [Doc Detective Docs](https://github.com/doc-detective/doc-detective.github.io): Source files for [doc-detective.com](https://doc-detective.com).
21
-
22
- ## Install
23
-
24
- 1. Install prerequisites:
25
-
26
- - [Node.js](https://nodejs.org/) (tested on v20 and v22)
27
-
28
- 1. In a terminal, install Doc Detective globally:
29
-
30
- ```bash
31
- npm i -g doc-detective
32
- ```
33
-
34
- If you don't install Doc Detective globally, you'll be prompted to install the first time you run an `npx` command.
35
-
36
- **Note:** If you're working in a cloned `doc-detective` repository, run `npm i` to install local dependencies or the `npx` command in the next step will fail.
37
-
38
- ## Run tests
39
-
40
- To run your tests, use the following command:
41
-
42
- ```bash
43
- npx doc-detective
44
- ```
45
-
46
- By default, Doc Detective scans the current directory for valid tests, but you can specify your test file with the `--input` argument. For example, to run tests in a file named `doc-content-inline-tests.md`, run the following command:
47
-
48
- ```bash
49
- npx doc-detective --input doc-content-inline-tests.md
50
- ```
51
-
52
- To customize your test, file type, and directory options, create a `.doc-detective.json` [config](https://doc-detective.com/docs/references/schemas/config.html) file. If a `.doc-detective.json` file exists in the directory when you run the comment, Doc Detective loads the config. Otherwise, you can specify a config path with the `--config` argument.
53
-
54
- ```bash
55
- npx doc-detective --config .doc-detective.json
56
- ```
57
-
58
- **Note**: All paths are relative to the current working directory, regardless where the config file is located.
59
-
60
- You can override config options with command-line arguments. For example, to run tests in a file named `tests.spec.json`, even if that isn't included in your config, run the following command:
61
-
62
- ```bash
63
- npx doc-detective --config .doc-detective.json --input tests.spec.json
64
- ```
65
-
66
- ### Check out some samples
67
-
68
- You can find test and config samples in the [samples](https://github.com/doc-detective/doc-detective/tree/main/samples) directory.
69
-
70
- ## Concepts
71
-
72
- - **Test specification**: A group of tests to run in one or more contexts. Conceptually parallel to a document.
73
- - [**Test**](https://doc-detective.com/docs/get-started/tests): A sequence of steps to perform. Conceptually parallel to a procedure.
74
- - **Step**: A portion of a test that includes a single action. Conceptually parallel to a step in a procedure.
75
- - **Action**: The task a performed in a step. Doc Detective supports a variety of actions:
76
- - [**checkLink**](https://doc-detective.com/docs/get-started/actions/checkLink): Check if a URL returns an acceptable status code from a GET request.
77
- - [**click**](https://doc-detective.com/docs/get-started/actions/click): Click an element with the specified text or selector.
78
- - [**find**](https://doc-detective.com/docs/get-started/actions/find): Check if an element exists with the specified text or selector and optionally interact with it.
79
- - [**goTo**](https://doc-detective.com/docs/get-started/actions/goTo): Navigate to a specified URL.
80
- - [**httpRequest**](https://doc-detective.com/docs/get-started/actions/httpRequest): Perform a generic HTTP request, for example to an API.
81
- - [**runCode**](https://doc-detective.com/docs/get-started/actions/runCode): Execute code, such as how it appears in a code block.
82
- - [**runShell**](https://doc-detective.com/docs/get-started/actions/runShell): Perform a native shell command.
83
- - [**screenshot**](https://doc-detective.com/docs/get-started/actions/screenshot): Take a screenshot in PNG format.
84
- - [**loadVariables**](https://doc-detective.com/docs/get-started/actions/loadVariables): Load environment variables from a `.env` file.
85
- - [**record**](https://doc-detective.com/docs/get-started/actions/record) and [**stopRecord**](https://doc-detective.com/docs/get-started/actions/stopRecord): Capture a video of test execution.
86
- - [**type**](https://doc-detective.com/docs/get-started/actions/type): Type keys. To type special keys, begin and end the string with `$` and use the special key’s enum. For example, to type the Escape key, enter `$ESCAPE$`.
87
- - [**wait**](https://doc-detective.com/docs/get-started/actions/wait): Pause before performing the next action.
88
- - [**Context**](https://doc-detective.com/docs/get-started/config/contexts): A combination of platform and application to run tests on.
89
-
90
- ## Develop
91
-
92
- To develop Doc Detective, clone the repo and install dependencies:
93
-
94
- ```bash
95
- git clone https://github.com/doc-detective/doc-detective.git
96
- cd doc-detective
97
- npm i
98
- ```
99
-
100
- To run commands, use the same `npx` commands as above.
101
-
102
- Make sure you review the [contributions guide](CONTRIBUTIONS.md) before submitting a pull request.
103
-
104
- ## Contributions
105
-
106
- Looking to help out? See our [contributions guide](CONTRIBUTIONS.md) for more info. If you can't contribute code, you can still help by reporting issues, suggesting new features, improving the documentation, or sponsoring the project.
107
-
108
- ## License
109
-
110
- This project uses the [AGPL-3.0 license](https://github.com/doc-detective/doc-detective/blob/master/LICENSE).
1
+ # <img src="https://github.com/doc-detective/doc-detective/blob/main/icon.png" width=50 style="vertical-align:middle;margin-bottom:7px"/> Doc Detective: The Documentation Testing Framework
2
+
3
+ ![Current version](https://img.shields.io/github/package-json/v/doc-detective/doc-detective?color=orange)
4
+ [![NPM Shield](https://img.shields.io/npm/v/doc-detective)](https://www.npmjs.com/package/doc-detective)
5
+ [![Discord Shield](https://img.shields.io/badge/chat-on%20discord-purple)](https://discord.gg/2M7wXEThfF)
6
+ [![Docs Shield](https://img.shields.io/badge/docs-doc--detective.com-blue)](https://doc-detective.com)
7
+
8
+ Doc Detective is doc content testing framework that makes it easy to keep your docs accurate and up-to-date. You write tests, and Doc Detective runs them directly against your product to make sure your docs match your user experience. Whether it’s a UI-based process or a series of API calls, Doc Detective can help you find doc bugs before your users do.
9
+
10
+ Doc Detective ingests test specifications and text files, parses them for testable actions, then executes those actions in a browser. The results (PASS/FAIL and context) are output as a JSON object so that other pieces of infrastructure can parse and manipulate them as needed.
11
+
12
+ This project handles test parsing and web-based UI testing---it doesn't support results reporting or notifications. This framework is a part of testing infrastructures and needs to be complemented by other components.
13
+
14
+ ## Components
15
+
16
+ Doc Detective has multiple components to integrate with your workflows as you need it to:
17
+
18
+ - Doc Detective (this repo): A standalone tool that enables testing without a separate Node project.
19
+ - [Doc Detective Core](https://github.com/doc-detective/doc-detective-core): An NPM package that provides the testing functionality.
20
+ - [Doc Detective Docs](https://github.com/doc-detective/doc-detective.github.io): Source files for [doc-detective.com](https://doc-detective.com).
21
+
22
+ ## Install
23
+
24
+ 1. Install prerequisites:
25
+
26
+ - [Node.js](https://nodejs.org/) (tested on v20 and v22)
27
+
28
+ 1. In a terminal, install Doc Detective globally:
29
+
30
+ ```bash
31
+ npm i -g doc-detective
32
+ ```
33
+
34
+ If you don't install Doc Detective globally, you'll be prompted to install the first time you run an `npx` command.
35
+
36
+ **Note:** If you're working in a cloned `doc-detective` repository, run `npm i` to install local dependencies or the `npx` command in the next step will fail.
37
+
38
+ ## Run tests
39
+
40
+ To run your tests, use the following command:
41
+
42
+ ```bash
43
+ npx doc-detective
44
+ ```
45
+
46
+ By default, Doc Detective scans the current directory for valid tests, but you can specify your test file with the `--input` argument. For example, to run tests in a file named `doc-content-inline-tests.md`, run the following command:
47
+
48
+ ```bash
49
+ npx doc-detective --input doc-content-inline-tests.md
50
+ ```
51
+
52
+ To customize your test, file type, and directory options, create a `.doc-detective.json` [config](https://doc-detective.com/docs/references/schemas/config.html) file. If a `.doc-detective.json` file exists in the directory when you run the comment, Doc Detective loads the config. Otherwise, you can specify a config path with the `--config` argument.
53
+
54
+ ```bash
55
+ npx doc-detective --config .doc-detective.json
56
+ ```
57
+
58
+ **Note**: All paths are relative to the current working directory, regardless where the config file is located.
59
+
60
+ You can override config options with command-line arguments. For example, to run tests in a file named `tests.spec.json`, even if that isn't included in your config, run the following command:
61
+
62
+ ```bash
63
+ npx doc-detective --config .doc-detective.json --input tests.spec.json
64
+ ```
65
+
66
+ ### Check out some samples
67
+
68
+ You can find test and config samples in the [samples](https://github.com/doc-detective/doc-detective/tree/main/samples) directory.
69
+
70
+ ## Concepts
71
+
72
+ - **Test specification**: A group of tests to run in one or more contexts. Conceptually parallel to a document.
73
+ - [**Test**](https://doc-detective.com/docs/get-started/tests): A sequence of steps to perform. Conceptually parallel to a procedure.
74
+ - **Step**: A portion of a test that includes a single action. Conceptually parallel to a step in a procedure.
75
+ - **Action**: The task a performed in a step. Doc Detective supports a variety of actions:
76
+ - [**checkLink**](https://doc-detective.com/docs/get-started/actions/checkLink): Check if a URL returns an acceptable status code from a GET request.
77
+ - [**click**](https://doc-detective.com/docs/get-started/actions/click): Click an element with the specified text or selector.
78
+ - [**find**](https://doc-detective.com/docs/get-started/actions/find): Check if an element exists with the specified text or selector and optionally interact with it.
79
+ - [**goTo**](https://doc-detective.com/docs/get-started/actions/goTo): Navigate to a specified URL.
80
+ - [**httpRequest**](https://doc-detective.com/docs/get-started/actions/httpRequest): Perform a generic HTTP request, for example to an API.
81
+ - [**runCode**](https://doc-detective.com/docs/get-started/actions/runCode): Execute code, such as how it appears in a code block.
82
+ - [**runShell**](https://doc-detective.com/docs/get-started/actions/runShell): Perform a native shell command.
83
+ - [**screenshot**](https://doc-detective.com/docs/get-started/actions/screenshot): Take a screenshot in PNG format.
84
+ - [**loadVariables**](https://doc-detective.com/docs/get-started/actions/loadVariables): Load environment variables from a `.env` file.
85
+ - [**record**](https://doc-detective.com/docs/get-started/actions/record) and [**stopRecord**](https://doc-detective.com/docs/get-started/actions/stopRecord): Capture a video of test execution.
86
+ - [**type**](https://doc-detective.com/docs/get-started/actions/type): Type keys. To type special keys, begin and end the string with `$` and use the special key’s enum. For example, to type the Escape key, enter `$ESCAPE$`.
87
+ - [**wait**](https://doc-detective.com/docs/get-started/actions/wait): Pause before performing the next action.
88
+ - [**Context**](https://doc-detective.com/docs/get-started/config/contexts): A combination of platform and application to run tests on.
89
+
90
+ ## Develop
91
+
92
+ To develop Doc Detective, clone the repo and install dependencies:
93
+
94
+ ```bash
95
+ git clone https://github.com/doc-detective/doc-detective.git
96
+ cd doc-detective
97
+ npm i
98
+ ```
99
+
100
+ To run commands, use the same `npx` commands as above.
101
+
102
+ Make sure you review the [contributions guide](CONTRIBUTIONS.md) before submitting a pull request.
103
+
104
+ ## Contributions
105
+
106
+ Looking to help out? See our [contributions guide](CONTRIBUTIONS.md) for more info. If you can't contribute code, you can still help by reporting issues, suggesting new features, improving the documentation, or sponsoring the project.
107
+
108
+ ## License
109
+
110
+ This project uses the [AGPL-3.0 license](https://github.com/doc-detective/doc-detective/blob/master/LICENSE).
@@ -1,9 +1,4 @@
1
- {
2
- "input": "dev.spec.json",
3
- "logLevel": "debug",
4
- "integrations": {
5
- "docDetectiveApi": {
6
- "apiKey": "cd6f10bf0a47db1436cb3294b54e4f3e1599ca64be0313039fb0fc474ec8d116"
7
- }
8
- }
1
+ {
2
+ "input": "dev.spec.json",
3
+ "logLevel": "debug"
9
4
  }
package/dev/dev.spec.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "tests": [
3
- {
4
- "steps": [
5
- {
6
- "action": "runShell",
7
- "command": "echo Hello, World!"
8
- },
9
- {
10
- "action": "checkLink",
11
- "url": "https://www.duckduckgo.com"
12
- },
13
- {
14
- "action": "goTo",
15
- "url": "https://www.google.com"
16
- },
17
- {
18
- "action": "find",
19
- "selector": "[title=Search]",
20
- "timeout": 10000,
21
- "moveTo": true,
22
- "click": true,
23
- "typeKeys": {
24
- "keys": ["shorthair cat", "$ENTER$"]
25
- }
26
- }
27
- ]
28
- }
29
- ]
30
- }
1
+ {
2
+ "tests": [
3
+ {
4
+ "steps": [
5
+ {
6
+ "action": "runShell",
7
+ "command": "echo Hello, World!"
8
+ },
9
+ {
10
+ "action": "checkLink",
11
+ "url": "https://www.duckduckgo.com"
12
+ },
13
+ {
14
+ "action": "goTo",
15
+ "url": "https://www.google.com"
16
+ },
17
+ {
18
+ "action": "find",
19
+ "selector": "[title=Search]",
20
+ "timeout": 10000,
21
+ "moveTo": true,
22
+ "click": true,
23
+ "typeKeys": {
24
+ "keys": ["shorthair cat", "$ENTER$"]
25
+ }
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ }
package/dev/index.js CHANGED
@@ -1,6 +1,6 @@
1
- const { setArgs, setConfig } = require("../src/utils");
2
-
3
- // Test that arguments are parsed correctly
4
- json = {
5
- }
1
+ const { setArgs, setConfig } = require("../src/utils");
2
+
3
+ // Test that arguments are parsed correctly
4
+ json = {
5
+ }
6
6
  console.log(setConfig(json,setArgs(process.argv)))
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
- {
2
- "name": "doc-detective",
3
- "version": "3.5.0-dev.0",
4
- "description": "Treat doc content as testable assertions to validate doc accuracy and product UX.",
5
- "bin": {
6
- "doc-detective": "src/index.js"
7
- },
8
- "main": "./src/index.js",
9
- "scripts": {
10
- "mocha": "mocha",
11
- "test": "mocha test/*.test.js",
12
- "prerunTests": "node ./src/checkDependencies.js",
13
- "runTests": "node ./src/index.js runTests",
14
- "start": "node ./src/index.js",
15
- "dev": "node ./dev"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/hawkeyexl/doc-detective.git"
20
- },
21
- "keywords": [
22
- "documentation",
23
- "unit",
24
- "test",
25
- "doc",
26
- "docs"
27
- ],
28
- "author": "Manny Silva",
29
- "license": "AGPL-3.0-only",
30
- "bugs": {
31
- "url": "https://github.com/doc-detective/doc-detective/issues"
32
- },
33
- "homepage": "https://github.com/doc-detective/doc-detective#readme",
34
- "dependencies": {
35
- "@ffmpeg-installer/ffmpeg": "^1.1.0",
36
- "axios": "^1.13.2",
37
- "doc-detective-common": "3.5.0",
38
- "doc-detective-core": "^3.5.0-dev.0",
39
- "yargs": "^17.7.2"
40
- },
41
- "devDependencies": {
42
- "body-parser": "^2.2.0",
43
- "chai": "^6.2.1",
44
- "express": "^5.1.0",
45
- "mocha": "^11.7.5"
46
- }
47
- }
1
+ {
2
+ "name": "doc-detective",
3
+ "version": "3.5.0",
4
+ "description": "Treat doc content as testable assertions to validate doc accuracy and product UX.",
5
+ "bin": {
6
+ "doc-detective": "src/index.js"
7
+ },
8
+ "main": "./src/index.js",
9
+ "scripts": {
10
+ "mocha": "mocha",
11
+ "test": "mocha test/*.test.js",
12
+ "prerunTests": "node ./src/checkDependencies.js",
13
+ "runTests": "node ./src/index.js runTests",
14
+ "start": "node ./src/index.js",
15
+ "dev": "node ./dev"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/hawkeyexl/doc-detective.git"
20
+ },
21
+ "keywords": [
22
+ "documentation",
23
+ "unit",
24
+ "test",
25
+ "doc",
26
+ "docs"
27
+ ],
28
+ "author": "Manny Silva",
29
+ "license": "AGPL-3.0-only",
30
+ "bugs": {
31
+ "url": "https://github.com/doc-detective/doc-detective/issues"
32
+ },
33
+ "homepage": "https://github.com/doc-detective/doc-detective#readme",
34
+ "dependencies": {
35
+ "@ffmpeg-installer/ffmpeg": "^1.1.0",
36
+ "axios": "^1.12.2",
37
+ "doc-detective-common": "^3.5.0",
38
+ "doc-detective-core": "^3.5.0",
39
+ "yargs": "^17.7.2"
40
+ },
41
+ "devDependencies": {
42
+ "body-parser": "^2.2.0",
43
+ "chai": "^6.2.0",
44
+ "express": "^5.1.0",
45
+ "mocha": "^11.7.4"
46
+ }
47
+ }
@@ -1,94 +1,94 @@
1
- {
2
- "runOn": [
3
- {
4
- "platforms": ["windows", "mac", "linux"],
5
- "browsers": [
6
- {
7
- "name": "firefox",
8
- "headless": false
9
- }
10
- ]
11
- }
12
- ],
13
- "fileTypes": [
14
- {
15
- "name": "markdown",
16
- "extensions": ["md", "markdown", "mdx"],
17
- "inlineStatements": {
18
- "testStart": [
19
- "{\\/\\*\\s*test\\s+?([\\s\\S]*?)\\s*\\*\\/}",
20
- "<!--\\s*test\\s*([\\s\\S]*?)\\s*-->",
21
- "\\[comment\\]:\\s+#\\s+\\(test\\s*(.*?)\\s*\\)",
22
- "\\[comment\\]:\\s+#\\s+\\(test start\\s*(.*?)\\s*\\)"
23
- ],
24
- "testEnd": [
25
- "{\\/\\*\\s*test end\\s*\\*\\/}",
26
- "<!--\\s*test end\\s*([\\s\\S]*?)\\s*-->",
27
- "\\[comment\\]:\\s+#\\s+\\(test end\\)"
28
- ],
29
- "ignoreStart": [
30
- "{\\/\\*\\s*test ignore start\\s*\\*\\/}",
31
- "<!--\\s*test ignore start\\s*-->"
32
- ],
33
- "ignoreEnd": [
34
- "{\\/\\*\\s*test ignore end\\s*\\*\\/}",
35
- "<!--\\s*test ignore end\\s*-->"
36
- ],
37
- "step": [
38
- "{\\/\\*\\s*step\\s+?([\\s\\S]*?)\\s*\\*\\/}",
39
- "<!--\\s*step\\s*([\\s\\S]*?)\\s*-->",
40
- "\\[comment\\]:\\s+#\\s+\\(step\\s*(.*?)\\s*\\)"
41
- ]
42
- },
43
- "markup": [
44
- {
45
- "name": "checkHyperlink",
46
- "regex": [
47
- "(?<!\\!)\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
48
- ],
49
- "actions": ["checkLink"]
50
- },
51
- {
52
- "name": "pressEnter",
53
- "regex": ["\\bpress Enter"],
54
- "actions": [
55
- {
56
- "type": "$ENTER$"
57
- }
58
- ]
59
- },
60
- {
61
- "name": "clickOnscreenText",
62
- "regex": [
63
- "\\b(?:[Cc]lick|[Tt]ap|[Ll]eft-click|[Cc]hoose|[Ss]elect|[Cc]heck)\\b\\s+\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
64
- ],
65
- "actions": ["click"]
66
- },
67
- {
68
- "name": "findOnscreenText",
69
- "regex": ["\\*\\*((?:(?!\\*\\*).)+)\\*\\*"],
70
- "actions": ["find"]
71
- },
72
- {
73
- "name": "goToUrl",
74
- "regex": [
75
- "\\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*\\)"
76
- ],
77
- "actions": ["goTo"]
78
- },
79
- {
80
- "name": "screenshotImage",
81
- "regex": [
82
- "!\\[[^\\]]*\\]\\(\\s*([^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)\\s*\\{(?=[^}]*\\.screenshot)[^}]*\\}"
83
- ],
84
- "actions": ["screenshot"]
85
- },
86
- {
87
- "name": "typeText",
88
- "regex": ["\\b(?:press|enter|type)\\b\\s+\"([^\"]+)\""],
89
- "actions": ["type"]
90
- }
91
- ]
92
- }
93
- ]
94
- }
1
+ {
2
+ "runOn": [
3
+ {
4
+ "platforms": ["windows", "mac", "linux"],
5
+ "browsers": [
6
+ {
7
+ "name": "firefox",
8
+ "headless": false
9
+ }
10
+ ]
11
+ }
12
+ ],
13
+ "fileTypes": [
14
+ {
15
+ "name": "markdown",
16
+ "extensions": ["md", "markdown", "mdx"],
17
+ "inlineStatements": {
18
+ "testStart": [
19
+ "{\\/\\*\\s*test\\s+?([\\s\\S]*?)\\s*\\*\\/}",
20
+ "<!--\\s*test\\s*([\\s\\S]*?)\\s*-->",
21
+ "\\[comment\\]:\\s+#\\s+\\(test\\s*(.*?)\\s*\\)",
22
+ "\\[comment\\]:\\s+#\\s+\\(test start\\s*(.*?)\\s*\\)"
23
+ ],
24
+ "testEnd": [
25
+ "{\\/\\*\\s*test end\\s*\\*\\/}",
26
+ "<!--\\s*test end\\s*([\\s\\S]*?)\\s*-->",
27
+ "\\[comment\\]:\\s+#\\s+\\(test end\\)"
28
+ ],
29
+ "ignoreStart": [
30
+ "{\\/\\*\\s*test ignore start\\s*\\*\\/}",
31
+ "<!--\\s*test ignore start\\s*-->"
32
+ ],
33
+ "ignoreEnd": [
34
+ "{\\/\\*\\s*test ignore end\\s*\\*\\/}",
35
+ "<!--\\s*test ignore end\\s*-->"
36
+ ],
37
+ "step": [
38
+ "{\\/\\*\\s*step\\s+?([\\s\\S]*?)\\s*\\*\\/}",
39
+ "<!--\\s*step\\s*([\\s\\S]*?)\\s*-->",
40
+ "\\[comment\\]:\\s+#\\s+\\(step\\s*(.*?)\\s*\\)"
41
+ ]
42
+ },
43
+ "markup": [
44
+ {
45
+ "name": "checkHyperlink",
46
+ "regex": [
47
+ "(?<!\\!)\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
48
+ ],
49
+ "actions": ["checkLink"]
50
+ },
51
+ {
52
+ "name": "pressEnter",
53
+ "regex": ["\\bpress Enter"],
54
+ "actions": [
55
+ {
56
+ "type": "$ENTER$"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "name": "clickOnscreenText",
62
+ "regex": [
63
+ "\\b(?:[Cc]lick|[Tt]ap|[Ll]eft-click|[Cc]hoose|[Ss]elect|[Cc]heck)\\b\\s+\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
64
+ ],
65
+ "actions": ["click"]
66
+ },
67
+ {
68
+ "name": "findOnscreenText",
69
+ "regex": ["\\*\\*((?:(?!\\*\\*).)+)\\*\\*"],
70
+ "actions": ["find"]
71
+ },
72
+ {
73
+ "name": "goToUrl",
74
+ "regex": [
75
+ "\\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*\\)"
76
+ ],
77
+ "actions": ["goTo"]
78
+ },
79
+ {
80
+ "name": "screenshotImage",
81
+ "regex": [
82
+ "!\\[[^\\]]*\\]\\(\\s*([^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)\\s*\\{(?=[^}]*\\.screenshot)[^}]*\\}"
83
+ ],
84
+ "actions": ["screenshot"]
85
+ },
86
+ {
87
+ "name": "typeText",
88
+ "regex": ["\\b(?:press|enter|type)\\b\\s+\"([^\"]+)\""],
89
+ "actions": ["type"]
90
+ }
91
+ ]
92
+ }
93
+ ]
94
+ }
@@ -1,10 +1,10 @@
1
- # Doc Detective documentation overview
2
-
3
- [Doc Detective documentation](https://doc-detective.com) is split into a few key sections:
4
-
5
- - The landing page discusses what Doc Detective is, what it does, and who might find it useful.
6
- - [Get started](https://doc-detective.com/docs/get-started/intro) covers how to quickly get up and running with Doc Detective.
7
-
8
- Some pages also have unique headings. If you open [type](https://doc-detective.com/docs/get-started/actions/type), it has a **Special keys** heading.
9
-
10
- ![Search results.](reference.png){ .screenshot }
1
+ # Doc Detective documentation overview
2
+
3
+ [Doc Detective documentation](https://doc-detective.com) is split into a few key sections:
4
+
5
+ - The landing page discusses what Doc Detective is, what it does, and who might find it useful.
6
+ - [Get started](https://doc-detective.com/docs/get-started/intro) covers how to quickly get up and running with Doc Detective.
7
+
8
+ Some pages also have unique headings. If you open [type](https://doc-detective.com/docs/get-started/actions/type), it has a **Special keys** heading.
9
+
10
+ ![Search results.](reference.png){ .screenshot }