Skip to content

Commit f558e23

Browse files
committed
Tweaks
1 parent 52cefc1 commit f558e23

File tree

6 files changed

+53
-48
lines changed

6 files changed

+53
-48
lines changed

docs/get-started/inputs/dita.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ Doc Detective recognizes specific action verbs in `<cmd>` elements to determine
112112

113113
When these verbs appear with DITA semantic elements, Doc Detective automatically extracts the complete action. For example, `<cmd>Click the <uicontrol>Save</uicontrol> button</cmd>` generates `{ "click": "Save" }`.
114114

115+
## Best practices
116+
117+
- Use semantic DITA elements (`<uicontrol>`, `<userinput>`, etc.) for accurate test detection
118+
- Structure procedures as DITA task topics with `<steps>` and `<cmd>` elements
119+
- Use `scope="external"` on `<xref>` elements for external links
120+
- Add `outputclass` attributes to `<codeblock>` elements to specify language
121+
- Combine inline processing instructions with detected tests for comprehensive coverage
122+
- Use action verbs consistently (click, type, navigate, verify, etc.)
123+
115124
## Default DITA patterns
116125

117126
### Key patterns
@@ -256,15 +265,6 @@ For a complete list of patterns, see the [configuration reference](/docs/referen
256265
}
257266
```
258267

259-
## Best practices
260-
261-
- Use semantic DITA elements (`<uicontrol>`, `<userinput>`, etc.) for accurate test detection
262-
- Structure procedures as DITA task topics with `<steps>` and `<cmd>` elements
263-
- Use `scope="external"` on `<xref>` elements for external links
264-
- Add `outputclass` attributes to `<codeblock>` elements to specify language
265-
- Combine inline processing instructions with detected tests for comprehensive coverage
266-
- Use action verbs consistently (click, type, navigate, verify, etc.)
267-
268268
## Next steps
269269

270270
- Learn about [inline tests](/docs/get-started/tests/inline) for manual test definition

docs/get-started/inputs/markdown.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ Markdown files support multiple comment styles for inline tests:
4343

4444
All three styles work identically. Choose the style that fits your documentation workflow.
4545

46+
## Best practices
47+
48+
- Use **bold text** for UI elements you want to interact with (buttons, menu items, etc.)
49+
- Use explicit navigation verbs (go to, navigate to, etc.) before links you want to open
50+
- Add the `.screenshot` class to images you want to capture as screenshots
51+
- Combine inline and detected tests for comprehensive coverage
52+
- Use `testIgnore` in code blocks that should not be executed as tests
53+
4654
## Detected test patterns
4755

4856
Doc Detective includes default markup patterns for Markdown files that automatically detect tests from your documentation content.
@@ -280,14 +288,6 @@ In this example:
280288
- Specific form field typing is defined inline for precise control
281289
- `detectSteps: true` enables detection within the test block
282290

283-
## Best practices
284-
285-
- Use **bold text** for UI elements you want to interact with (buttons, menu items, etc.)
286-
- Use explicit navigation verbs (go to, navigate to, etc.) before links you want to open
287-
- Add the `.screenshot` class to images you want to capture as screenshots
288-
- Combine inline and detected tests for comprehensive coverage
289-
- Use `testIgnore` in code blocks that should not be executed as tests
290-
291291
## Next steps
292292

293293
- Learn about [inline tests](/docs/get-started/tests/inline) for manual test definition

docs/get-started/tests/detected.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ Detected tests are useful for keeping your tests in sync with your documentation
1212

1313
> You can mix detected tests with [inline tests](inline) to declare steps that might not be covered in your content, such starting or stopping a recording.
1414
15+
## Benefits of detected tests
16+
17+
Detected tests provide several advantages:
18+
19+
- **Automatic synchronization**: Tests update automatically when documentation changes
20+
- **Reduced maintenance**: No need to manually update test specifications
21+
- **Consistent coverage**: Ensures all documented procedures are tested
22+
- **Time savings**: Eliminates the need to write many test specifications manually
23+
24+
Combine detected tests with [inline tests](inline) for comprehensive test coverage with minimal manual effort.
25+
1526
## Default markup patterns
1627

1728
Doc Detective includes default markup patterns for Markdown and DITA files. For comprehensive information about each input format and their patterns, see [Input formats](/docs/get-started/inputs/overview).
@@ -243,14 +254,3 @@ Load a browser cookie by name from a default location.
243254
```json
244255
{ "loadCookie": "$1" }
245256
```
246-
247-
## Benefits of detected tests
248-
249-
Detected tests provide several advantages:
250-
251-
- **Automatic synchronization**: Tests update automatically when documentation changes
252-
- **Reduced maintenance**: No need to manually update test specifications
253-
- **Consistent coverage**: Ensures all documented procedures are tested
254-
- **Time savings**: Eliminates the need to write many test specifications manually
255-
256-
Combine detected tests with [inline tests](inline) for comprehensive test coverage with minimal manual effort.

docs/get-started/tests/inline.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ When you declare a step, you can specify any of the properties of the action you
2626

2727
If you declare a step without declaring a test, Doc Detective automatically creates a test to contain the step.
2828

29+
## Benefits of inline tests
30+
31+
Inline tests offer several advantages:
32+
33+
- **Proximity to content**: Tests are defined right next to the instructions they validate, making it easier to keep them in sync.
34+
- **Easy maintenance**: When you update documentation, the associated tests are immediately visible and can be updated at the same time.
35+
- **Documentation as code**: Tests become part of the documentation source, ensuring that documentation and testing evolve together.
36+
- **Quick validation**: Small, focused tests can be quickly added to validate specific instructions or procedures.
37+
38+
Inline tests can be combined with [detected tests](detected) to create comprehensive test coverage with minimal manual test definition.
39+
2940
## Comment patterns by file type
3041

3142
Doc Detective supports different comment patterns depending on your file type. For more information about input formats, see [Input formats](/docs/get-started/inputs/overview).
@@ -167,14 +178,3 @@ Click the *Start* button:
167178

168179
// (test end)
169180
```
170-
171-
## Benefits of inline tests
172-
173-
Inline tests offer several advantages:
174-
175-
- **Proximity to content**: Tests are defined right next to the instructions they validate, making it easier to keep them in sync.
176-
- **Easy maintenance**: When you update documentation, the associated tests are immediately visible and can be updated at the same time.
177-
- **Documentation as code**: Tests become part of the documentation source, ensuring that documentation and testing evolve together.
178-
- **Quick validation**: Small, focused tests can be quickly added to validate specific instructions or procedures.
179-
180-
Inline tests can be combined with [detected tests](detected) to create comprehensive test coverage with minimal manual test definition.

docs/get-started/tests/standalone.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ import JsonYamlTabs from "@site/src/components/JsonYamlTabs";
88

99
# Standalone tests
1010

11+
Standalone JSON or YAML files help you see the entirety of the spec and keep it in a separate, machine-readable format. They're useful for:
12+
13+
- Complex test suites that need version control
14+
- Automated test generation and processing
15+
- Integration with CI/CD pipelines
16+
- Sharing tests across projects
17+
18+
However, they make it harder to maintain strict parallelism with documentation, so consider your use case carefully.
19+
1120
Test specs in standalone JSON or YAML files use the following basic structure:
1221

1322
<JsonYamlTabs object={{
@@ -59,10 +68,3 @@ Here's an example test for performing a Google search and saving a screenshot of
5968
}
6069
]
6170
}}></JsonYamlTabs>
62-
63-
Standalone JSON or YAML files help you see the entirety of the spec and keep it in a separate, machine-readable format. They're useful for:
64-
65-
- Complex test suites that need version control
66-
- Automated test generation and processing
67-
- Integration with CI/CD pipelines
68-
- Sharing tests across projects

docusaurus.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ const config: Config = {
2323
deploymentBranch: "gh-pages",
2424

2525
onBrokenLinks: "throw",
26-
onBrokenMarkdownLinks: "warn",
27-
26+
markdown: {
27+
hooks: {
28+
onBrokenMarkdownLinks: "warn",
29+
},
30+
},
2831
// Even if you don't use internationalization, you can use this field to set
2932
// useful metadata like html lang. For example, if your site is Chinese, you
3033
// may want to replace "en" with "zh-Hans".

0 commit comments

Comments
 (0)