Markdown input format
Markdown is the most commonly used format for documentation sites. Doc Detective supports standard Markdown, MDX, and various Markdown flavors including GitHub Flavored Markdown.
File extensions
Doc Detective processes Markdown files with the following extensions:
.md.markdown.mdx
Inline test syntax
Markdown files support multiple comment styles for inline tests:
JSX-style comments (recommended for MDX):
HTML comments:
Markdown link comments:
All three styles work identically. Choose the style that fits your documentation workflow.
Best practices
- Use bold text for UI elements you want to interact with (buttons, menu items, etc.)
- Use explicit navigation verbs (go to, navigate to, etc.) before links you want to open
- Add the
.screenshotclass to images you want to capture as screenshots - Combine inline and detected tests for comprehensive coverage
- Use
testIgnorein code blocks that should not be executed as tests
Detected test patterns
Doc Detective includes default markup patterns for Markdown files that automatically detect tests from your documentation content.
Default Markdown patterns
Pattern descriptions
checkHyperlink
Detects standard Markdown links (excluding images) and checks that they return a valid HTTP status code.
- Pattern:
[link text](https://example.com) - Action: Performs a GET request to verify the link is accessible
clickOnscreenText
Detects action verbs followed by bold text and clicks on that element.
- Pattern:
Click **Button Name**,Tap **Menu Item**,Select **Option** - Action: Clicks on the specified element using its text content
- Recognized verbs: click, tap, left-click, choose, select, check
findOnscreenText
Detects any bold text and verifies it exists on the page.
- Pattern:
**Any Bold Text** - Action: Searches for the text on the current page
goToUrl
Detects navigation instructions with links and opens the URL.
- Pattern:
Go to [Page Name](https://example.com),Navigate to [Site](https://example.com) - Action: Opens the specified URL in the browser
- Recognized verbs: go to, open, navigate to, visit, access, proceed to, launch
screenshotImage
Detects images with a .screenshot class or attribute and takes a screenshot.
- Pattern:
{.screenshot} - Action: Saves a screenshot to the specified path
typeText
Detects typing instructions with quoted text and types the content.
- Pattern:
Type "Hello World",Enter "username",Press "Submit" - Action: Types the specified text into the active element
- Recognized verbs: press, enter, type
httpRequestFormat
Detects HTTP request code blocks and executes the request.
- Pattern: HTTP request in code blocks with method, URL, headers, and body
- Example:
- Action: Executes the HTTP request with the specified parameters
runCode
Detects code blocks in supported languages and executes the code.
- Pattern: Code blocks with
bash,python,py,javascript, orjslanguage tags - Example:
- Action: Executes the code in the specified language (marked as unsafe)
- Note: Add
testIgnoreto the code block info string to skip execution (for example,```bash testIgnore)
Example with detected tests
Markdown input:
Detected tests:
Combining inline and detected tests
You can mix inline test statements with detected tests for maximum flexibility:
In this example:
- The navigation and button clicks are detected automatically
- Specific form field typing is defined inline for precise control
detectSteps: trueenables detection within the test block
Next steps
- Learn about inline tests for manual test definition
- Learn about detected tests for automatic test generation
- See custom inputs to extend Markdown patterns