> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# Screenshots and recordings, written as tests

> Procedures that take, crop, and annotate screenshots, draw annotations on a live page, and record video, shown as plain prose, detected tests, inline tests, and standalone specs in every supported format.

Each example shows one procedure as prose, as detected tests, as inline tests, and as a standalone spec. For what each tab holds, see [Navigation and interaction](/reference/docs-as-tests/navigation-interaction).

In a detected variant, a `step` statement holds each step that default detection can't produce, such as a cropped screenshot or a `record` step. Each of those statements also works on its own, because a run with detection off reads only the statements. That's why each detected variant also opens its page with a `goTo` statement.

The examples write their images and videos to a `.dd-output` folder next to the example files, and Git ignores that folder.

## Take screenshots of a sign-in form

This procedure uses [`screenshot`](/docs/actions/screenshot) as a path and as an object with `path`, `directory`, `maxVariation`, `overwrite`, [`crop`](/reference/schemas/crop-by-element-detailed), and [`annotations`](/reference/schemas/annotation). The test sets [`annotationDefaults`](/reference/schemas/annotation-defaults) and `autoScreenshot`.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Take screenshots of a sign-in form

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The form opens.
   ![The sample form](.dd-output/capture-form.png){.screenshot}
3. Find the **Submit by ID** button at the top of the form.
4. Fill in the sign-in fields in the order the numbers show.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Take screenshots of a sign-in form

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The form opens.
   <img src=".dd-output/capture-form.png" alt="The sample form" className="screenshot" />
3. Find the **Submit by ID** button at the top of the form.
4. Fill in the sign-in fields in the order the numbers show.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Take screenshots of a sign-in form

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
. The form opens.
+
image:.dd-output/capture-form.png[The sample form,role=screenshot]
. Find the *Submit by ID* button at the top of the form.
. Fill in the sign-in fields in the order the numbers show.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Take screenshots of a sign-in form</title></head>
<body>
<h1>Take screenshots of a sign-in form</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.</li>
  <li>The form opens.
    <img src=".dd-output/capture-form.png" alt="The sample form" class="screenshot"></li>
  <li>Find the <strong>Submit by ID</strong> button at the top of the form.</li>
  <li>Fill in the sign-in fields in the order the numbers show.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Take screenshots of a sign-in form
==================================

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

#. The form opens.

   .. image:: .dd-output/capture-form.png
      :alt: The sample form
      :class: screenshot

#. Find the **Submit by ID** button at the top of the form.

#. Fill in the sign-in fields in the order the numbers show.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshots">
  <title>Take screenshots of a sign-in form</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd></step>
      <step><cmd>The form opens.</cmd>
        <info><image href=".dd-output/capture-form.png" outputclass="screenshot"><alt>The sample form</alt></image></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button at the top of the form.</cmd></step>
      <step><cmd>Fill in the sign-in fields in the order the numbers show.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshots","detectSteps":true,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}} -->

# Take screenshots of a sign-in form

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The form opens.
   ![The sample form](.dd-output/capture-form.png){.screenshot}
3. Find the **Submit by ID** button at the top of the form.
   <!-- step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} -->
4. Fill in the sign-in fields in the order the numbers show.
   <!-- step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshots","detectSteps":true,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}} */}

# Take screenshots of a sign-in form

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The form opens.
   <img src=".dd-output/capture-form.png" alt="The sample form" className="screenshot" />
3. Find the **Submit by ID** button at the top of the form.
   {/* step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} */}
4. Fill in the sign-in fields in the order the numbers show.
   {/* step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Take screenshots of a sign-in form

// (test {"testId":"capture-screenshots","detectSteps":true,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The form opens.
+
image:.dd-output/capture-form.png[The sample form,role=screenshot]
. Find the *Submit by ID* button at the top of the form.
+
// (step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}})
. Fill in the sign-in fields in the order the numbers show.
+
// (step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Take screenshots of a sign-in form</title></head>
<body>
<!-- test {"testId":"capture-screenshots","detectSteps":true,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}} -->
<h1>Take screenshots of a sign-in form</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The form opens.
    <img src=".dd-output/capture-form.png" alt="The sample form" class="screenshot"></li>
  <li>Find the <strong>Submit by ID</strong> button at the top of the form.
    <!-- step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} --></li>
  <li>Fill in the sign-in fields in the order the numbers show.
    <!-- step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Take screenshots of a sign-in form
==================================

.. test {"testId":"capture-screenshots","detectSteps":true,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The form opens.

   .. image:: .dd-output/capture-form.png
      :alt: The sample form
      :class: screenshot

#. Find the **Submit by ID** button at the top of the form.

   .. step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}

#. Fill in the sign-in fields in the order the numbers show.

   .. step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshots">
  <title>Take screenshots of a sign-in form</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshots","detectSteps":true,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The form opens.</cmd>
        <info><image href=".dd-output/capture-form.png" outputclass="screenshot"><alt>The sample form</alt></image></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}'/></info></step>
      <step><cmd>Fill in the sign-in fields in the order the numbers show.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshots","detectSteps":false,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}} -->

# Take screenshots of a sign-in form

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The form opens.
   ![The sample form](.dd-output/capture-form.png){.screenshot}
   <!-- step {"screenshot":".dd-output/capture-form.png"} -->
3. Find the **Submit by ID** button at the top of the form.
   <!-- step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} -->
4. Fill in the sign-in fields in the order the numbers show.
   <!-- step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshots","detectSteps":false,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}} */}

# Take screenshots of a sign-in form

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The form opens.
   <img src=".dd-output/capture-form.png" alt="The sample form" className="screenshot" />
   {/* step {"screenshot":".dd-output/capture-form.png"} */}
3. Find the **Submit by ID** button at the top of the form.
   {/* step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} */}
4. Fill in the sign-in fields in the order the numbers show.
   {/* step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Take screenshots of a sign-in form

// (test {"testId":"capture-screenshots","detectSteps":false,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The form opens.
+
image:.dd-output/capture-form.png[The sample form,role=screenshot]
+
// (step {"screenshot":".dd-output/capture-form.png"})
. Find the *Submit by ID* button at the top of the form.
+
// (step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}})
. Fill in the sign-in fields in the order the numbers show.
+
// (step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Take screenshots of a sign-in form</title></head>
<body>
<!-- test {"testId":"capture-screenshots","detectSteps":false,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}} -->
<h1>Take screenshots of a sign-in form</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The form opens.
    <img src=".dd-output/capture-form.png" alt="The sample form" class="screenshot">
    <!-- step {"screenshot":".dd-output/capture-form.png"} --></li>
  <li>Find the <strong>Submit by ID</strong> button at the top of the form.
    <!-- step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} --></li>
  <li>Fill in the sign-in fields in the order the numbers show.
    <!-- step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Take screenshots of a sign-in form
==================================

.. test {"testId":"capture-screenshots","detectSteps":false,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The form opens.

   .. image:: .dd-output/capture-form.png
      :alt: The sample form
      :class: screenshot

   .. step {"screenshot":".dd-output/capture-form.png"}

#. Find the **Submit by ID** button at the top of the form.

   .. step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}

#. Fill in the sign-in fields in the order the numbers show.

   .. step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshots">
  <title>Take screenshots of a sign-in form</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshots","detectSteps":false,"autoScreenshot":true,"annotationDefaults":{"color":"#E11D48","strokeWidth":3,"badge":{"background":"#E11D48","color":"#FFFFFF"}}}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The form opens.</cmd>
        <info><image href=".dd-output/capture-form.png" outputclass="screenshot"><alt>The sample form</alt></image>
          <data name="doc-detective" value='step {"screenshot":".dd-output/capture-form.png"}'/></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-submit.png","directory":".dd-output","maxVariation":0.2,"overwrite":"aboveVariation","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}'/></info></step>
      <step><cmd>Fill in the sign-in fields in the order the numbers show.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-sign-in.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#inputs-section","padding":10},"annotations":[{"badge":"#username-input","label":"1","position":{"offset":{"x":-6,"y":0}}},{"badge":{"elementTestId":"password-field","timeout":10000},"label":"2"},{"callout":"#username-input","label":"Your account name","position":"right","style":{"maxWidth":200,"fontSize":14,"background":"#0F172A","padding":6}},{"outline":{"elementAttribute":{"data-validation":"email-validator"}},"style":{"color":"#7C3AED","radius":4,"opacity":0.8}},{"outline":"#inputs-section h2"},{"blur":"[data-testid=password-field]","style":{"intensity":12}},{"arrow":"#inputs-section h2","position":{"x":420,"y":30}},{"arrow":{"position":{"x":40,"y":20}}},{"text":"#username-input","label":"Required","position":"bottom"},{"text":{"position":"bottom-right"},"label":"Sample data"}]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "autoScreenshot": true,
  "tests": [
    {
      "testId": "capture-screenshots",
      "annotationDefaults": {
        "color": "#E11D48",
        "strokeWidth": 3,
        "badge": {
          "background": "#E11D48",
          "color": "#FFFFFF"
        }
      },
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "screenshot": ".dd-output/capture-form.png"
        },
        {
          "screenshot": {
            "path": "capture-submit.png",
            "directory": ".dd-output",
            "maxVariation": 0.2,
            "overwrite": "aboveVariation",
            "crop": {
              "elementText": "Submit by ID",
              "padding": {
                "top": 8,
                "right": 16,
                "bottom": 8,
                "left": 16
              }
            }
          }
        },
        {
          "screenshot": {
            "path": "capture-sign-in.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "crop": {
              "selector": "#inputs-section",
              "padding": 10
            },
            "annotations": [
              {
                "badge": "#username-input",
                "label": "1",
                "position": {
                  "offset": {
                    "x": -6,
                    "y": 0
                  }
                }
              },
              {
                "badge": {
                  "elementTestId": "password-field",
                  "timeout": 10000
                },
                "label": "2"
              },
              {
                "callout": "#username-input",
                "label": "Your account name",
                "position": "right",
                "style": {
                  "maxWidth": 200,
                  "fontSize": 14,
                  "background": "#0F172A",
                  "padding": 6
                }
              },
              {
                "outline": {
                  "elementAttribute": {
                    "data-validation": "email-validator"
                  }
                },
                "style": {
                  "color": "#7C3AED",
                  "radius": 4,
                  "opacity": 0.8
                }
              },
              {
                "outline": "#inputs-section h2"
              },
              {
                "blur": "[data-testid=password-field]",
                "style": {
                  "intensity": 12
                }
              },
              {
                "arrow": "#inputs-section h2",
                "position": {
                  "x": 420,
                  "y": 30
                }
              },
              {
                "arrow": {
                  "position": {
                    "x": 40,
                    "y": 20
                  }
                }
              },
              {
                "text": "#username-input",
                "label": "Required",
                "position": "bottom"
              },
              {
                "text": {
                  "position": "bottom-right"
                },
                "label": "Sample data"
              }
            ]
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
autoScreenshot: true
tests:
  - testId: capture-screenshots
    annotationDefaults:
      color: "#E11D48"
      strokeWidth: 3
      badge:
        background: "#E11D48"
        color: "#FFFFFF"
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - screenshot: .dd-output/capture-form.png
      - screenshot:
          path: capture-submit.png
          directory: .dd-output
          maxVariation: 0.2
          overwrite: aboveVariation
          crop:
            elementText: Submit by ID
            padding:
              top: 8
              right: 16
              bottom: 8
              left: 16
      - screenshot:
          path: capture-sign-in.png
          directory: .dd-output
          overwrite: "true"
          crop:
            selector: "#inputs-section"
            padding: 10
          annotations:
            - badge: "#username-input"
              label: "1"
              position:
                offset:
                  x: -6
                  y: 0
            - badge:
                elementTestId: password-field
                timeout: 10000
              label: "2"
            - callout: "#username-input"
              label: Your account name
              position: right
              style:
                maxWidth: 200
                fontSize: 14
                background: "#0F172A"
                padding: 6
            - outline:
                elementAttribute:
                  data-validation: email-validator
              style:
                color: "#7C3AED"
                radius: 4
                opacity: 0.8
            - outline: "#inputs-section h2"
            - blur: "[data-testid=password-field]"
              style:
                intensity: 12
            - arrow: "#inputs-section h2"
              position:
                x: 420
                y: 30
            - arrow:
                position:
                  x: 40
                  y: 20
            - text: "#username-input"
              label: Required
              position: bottom
            - text:
                position: bottom-right
              label: Sample data
```

### What detection finds

An image with the `screenshot` class becomes a `screenshot` step that saves to the image's path. Each format marks the class its own way:

| Format           | Image with the `screenshot` class                                     |
| ---------------- | --------------------------------------------------------------------- |
| Markdown         | `![The sample form](path.png){.screenshot}`                           |
| MDX              | `<img src="path.png" alt="The sample form" className="screenshot" />` |
| AsciiDoc         | `image:path.png[The sample form,role=screenshot]`                     |
| HTML             | `<img src="path.png" alt="The sample form" class="screenshot">`       |
| reStructuredText | `.. image:: path.png` with `:class: screenshot`                       |
| DITA             | `<image href="path.png" outputclass="screenshot">`                    |

The link also becomes a `checkLink` step, and the bold **Submit by ID** becomes a `find` step. The cropped and annotated screenshots are `step` statements, because detection only produces a screenshot of the whole viewport.

In AsciiDoc, the image inside a list item uses the inline `image:` macro. Detection doesn't read a block `image::` macro that follows a list continuation.

### Screenshot forms in this example

| Step                                             | What it does                                                                                                                                                                  |
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `"screenshot": ".dd-output/capture-form.png"`    | Saves the viewport to the path. If a file is already there, compares against it with the default `maxVariation` of `0.05`.                                                    |
| `crop` with `elementText` and per-side `padding` | Saves only the **Submit by ID** button. `maxVariation` of `0.2` with `overwrite` set to `aboveVariation` replaces the reference only when more than 20% of the pixels change. |
| `crop` with `selector` and a single `padding`    | Saves the inputs section, then draws `annotations` on the image. `overwrite` set to `true` replaces the image on every run.                                                   |

The annotations cover every annotation type, and each type's target as a selector string:

| Annotation | Target and placement                                                                                                                    |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `badge`    | A selector string, nudged left with a `position` `offset`, and an `elementTestId` object with its own `timeout`.                        |
| `callout`  | A selector string, placed to the `right` with a named `position`. Its `style` sets `maxWidth`, `fontSize`, `background`, and `padding`. |
| `outline`  | A selector string, and an `elementAttribute` object whose `style` sets `color`, `radius`, and `opacity`.                                |
| `blur`     | A selector string. Its `style` sets the blur `intensity`.                                                                               |
| `arrow`    | A selector string with a `position` point (`x` and `y`), and a target that's only a point in the image.                                 |
| `text`     | A selector string with the named `position` `bottom`, and a target that's only a named region.                                          |

`annotationDefaults` on the test sets the color for every annotation type and the badge colors, and an annotation's own `style` wins over it. The example's detected run also sets `annotationDefaults` and `overwriteScreenshots` in its [config](/reference/schemas/config), in `docs/docs-as-tests/examples/capture-screenshots/doc-detective.json`. A test's theme wins over the config's, and `overwriteScreenshots` replaces every step's `overwrite`.

The test sets `autoScreenshot` to `true`, so Doc Detective also saves a screenshot after every step to the run folder. The standalone specs set it on the [spec](/reference/schemas/specification), where it applies to every test in the file. A test's own `autoScreenshot` overrides the spec's.

## Point out the controls on a toolbar

This procedure uses [`annotate`](/docs/actions/annotate) to `add`, `update`, and `clear` annotations that stay on the page across steps, and a [`screenshot`](/docs/actions/screenshot) that shows them.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Point out the controls on a toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Find the save button, marked 1, and the green check icon, outlined.
3. The status line at the top is hidden, because it changes on every visit.
4. Compare your toolbar with the screenshot.
5. Next, find the check icon, now marked 2.
6. That's every control on the toolbar.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Point out the controls on a toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Find the save button, marked 1, and the green check icon, outlined.
3. The status line at the top is hidden, because it changes on every visit.
4. Compare your toolbar with the screenshot.
5. Next, find the check icon, now marked 2.
6. That's every control on the toolbar.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Point out the controls on a toolbar

. Go to http://localhost:8092/find-image.html[the toolbar page].
. Find the save button, marked 1, and the green check icon, outlined.
. The status line at the top is hidden, because it changes on every visit.
. Compare your toolbar with the screenshot.
. Next, find the check icon, now marked 2.
. That's every control on the toolbar.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Point out the controls on a toolbar</title></head>
<body>
<h1>Point out the controls on a toolbar</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.</li>
  <li>Find the save button, marked 1, and the green check icon, outlined.</li>
  <li>The status line at the top is hidden, because it changes on every visit.</li>
  <li>Compare your toolbar with the screenshot.</li>
  <li>Next, find the check icon, now marked 2.</li>
  <li>That's every control on the toolbar.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Point out the controls on a toolbar
===================================

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

#. Find the save button, marked 1, and the green check icon, outlined.

#. The status line at the top is hidden, because it changes on every visit.

#. Compare your toolbar with the screenshot.

#. Next, find the check icon, now marked 2.

#. That's every control on the toolbar.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-annotate">
  <title>Point out the controls on a toolbar</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd></step>
      <step><cmd>Find the save button, marked 1, and the green check icon, outlined.</cmd></step>
      <step><cmd>The status line at the top is hidden, because it changes on every visit.</cmd></step>
      <step><cmd>Compare your toolbar with the screenshot.</cmd></step>
      <step><cmd>Next, find the check icon, now marked 2.</cmd></step>
      <step><cmd>That's every control on the toolbar.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-annotate","detectSteps":true,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}} -->

# Point out the controls on a toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Find the save button, marked 1, and the green check icon, outlined.
   <!-- step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}} -->
3. The status line at the top is hidden, because it changes on every visit.
   <!-- step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}} -->
4. Compare your toolbar with the screenshot.
   <!-- step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}} -->
5. Next, find the check icon, now marked 2.
   <!-- step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}} -->
   <!-- step {"annotate":{"clear":["hint"]}} -->
6. That's every control on the toolbar.
   <!-- step {"annotate":{"clear":true}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-annotate","detectSteps":true,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}} */}

# Point out the controls on a toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Find the save button, marked 1, and the green check icon, outlined.
   {/* step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}} */}
3. The status line at the top is hidden, because it changes on every visit.
   {/* step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}} */}
4. Compare your toolbar with the screenshot.
   {/* step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}} */}
5. Next, find the check icon, now marked 2.
   {/* step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}} */}
   {/* step {"annotate":{"clear":["hint"]}} */}
6. That's every control on the toolbar.
   {/* step {"annotate":{"clear":true}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Point out the controls on a toolbar

// (test {"testId":"capture-annotate","detectSteps":true,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Find the save button, marked 1, and the green check icon, outlined.
+
// (step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}})
. The status line at the top is hidden, because it changes on every visit.
+
// (step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}})
. Compare your toolbar with the screenshot.
+
// (step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}})
. Next, find the check icon, now marked 2.
+
// (step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}})
+
// (step {"annotate":{"clear":["hint"]}})
. That's every control on the toolbar.
+
// (step {"annotate":{"clear":true}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Point out the controls on a toolbar</title></head>
<body>
<!-- test {"testId":"capture-annotate","detectSteps":true,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}} -->
<h1>Point out the controls on a toolbar</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Find the save button, marked 1, and the green check icon, outlined.
    <!-- step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}} --></li>
  <li>The status line at the top is hidden, because it changes on every visit.
    <!-- step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}} --></li>
  <li>Compare your toolbar with the screenshot.
    <!-- step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}} --></li>
  <li>Next, find the check icon, now marked 2.
    <!-- step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}} -->
    <!-- step {"annotate":{"clear":["hint"]}} --></li>
  <li>That's every control on the toolbar.
    <!-- step {"annotate":{"clear":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Point out the controls on a toolbar
===================================

.. test {"testId":"capture-annotate","detectSteps":true,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Find the save button, marked 1, and the green check icon, outlined.

   .. step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}}

#. The status line at the top is hidden, because it changes on every visit.

   .. step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}}

#. Compare your toolbar with the screenshot.

   .. step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}}

#. Next, find the check icon, now marked 2.

   .. step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}}

   .. step {"annotate":{"clear":["hint"]}}

#. That's every control on the toolbar.

   .. step {"annotate":{"clear":true}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-annotate">
  <title>Point out the controls on a toolbar</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-annotate","detectSteps":true,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Find the save button, marked 1, and the green check icon, outlined.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}}'/></info></step>
      <step><cmd>The status line at the top is hidden, because it changes on every visit.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}}'/></info></step>
      <step><cmd>Compare your toolbar with the screenshot.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}}'/></info></step>
      <step><cmd>Next, find the check icon, now marked 2.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}}'/>
          <data name="doc-detective" value='step {"annotate":{"clear":["hint"]}}'/></info></step>
      <step><cmd>That's every control on the toolbar.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"clear":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-annotate","detectSteps":false,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}} -->

# Point out the controls on a toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Find the save button, marked 1, and the green check icon, outlined.
   <!-- step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}} -->
3. The status line at the top is hidden, because it changes on every visit.
   <!-- step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}} -->
4. Compare your toolbar with the screenshot.
   <!-- step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}} -->
5. Next, find the check icon, now marked 2.
   <!-- step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}} -->
   <!-- step {"annotate":{"clear":["hint"]}} -->
6. That's every control on the toolbar.
   <!-- step {"annotate":{"clear":true}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-annotate","detectSteps":false,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}} */}

# Point out the controls on a toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Find the save button, marked 1, and the green check icon, outlined.
   {/* step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}} */}
3. The status line at the top is hidden, because it changes on every visit.
   {/* step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}} */}
4. Compare your toolbar with the screenshot.
   {/* step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}} */}
5. Next, find the check icon, now marked 2.
   {/* step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}} */}
   {/* step {"annotate":{"clear":["hint"]}} */}
6. That's every control on the toolbar.
   {/* step {"annotate":{"clear":true}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Point out the controls on a toolbar

// (test {"testId":"capture-annotate","detectSteps":false,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Find the save button, marked 1, and the green check icon, outlined.
+
// (step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}})
. The status line at the top is hidden, because it changes on every visit.
+
// (step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}})
. Compare your toolbar with the screenshot.
+
// (step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}})
. Next, find the check icon, now marked 2.
+
// (step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}})
+
// (step {"annotate":{"clear":["hint"]}})
. That's every control on the toolbar.
+
// (step {"annotate":{"clear":true}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Point out the controls on a toolbar</title></head>
<body>
<!-- test {"testId":"capture-annotate","detectSteps":false,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}} -->
<h1>Point out the controls on a toolbar</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Find the save button, marked 1, and the green check icon, outlined.
    <!-- step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}} --></li>
  <li>The status line at the top is hidden, because it changes on every visit.
    <!-- step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}} --></li>
  <li>Compare your toolbar with the screenshot.
    <!-- step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}} --></li>
  <li>Next, find the check icon, now marked 2.
    <!-- step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}} -->
    <!-- step {"annotate":{"clear":["hint"]}} --></li>
  <li>That's every control on the toolbar.
    <!-- step {"annotate":{"clear":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Point out the controls on a toolbar
===================================

.. test {"testId":"capture-annotate","detectSteps":false,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Find the save button, marked 1, and the green check icon, outlined.

   .. step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}}

#. The status line at the top is hidden, because it changes on every visit.

   .. step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}}

#. Compare your toolbar with the screenshot.

   .. step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}}

#. Next, find the check icon, now marked 2.

   .. step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}}

   .. step {"annotate":{"clear":["hint"]}}

#. That's every control on the toolbar.

   .. step {"annotate":{"clear":true}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-annotate">
  <title>Point out the controls on a toolbar</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-annotate","detectSteps":false,"autoScreenshot":false,"annotationDefaults":{"fontSize":14,"background":"#1E293B","opacity":0.9,"radius":6,"padding":4,"maxWidth":240,"intensity":16,"callout":{"background":"#0F172A","color":"#FDE047"},"transition":{"enter":"fade","exit":"fade","durationMs":250}}}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Find the save button, marked 1, and the green check icon, outlined.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"add":[{"id":"save-badge","badge":"#save","label":"1"},{"id":"check-outline","outline":{"elementImage":{"path":"check-icon.svg","threshold":0.9},"timeout":10000},"track":true,"transition":{"enter":"draw","durationMs":300}},{"id":"hint","callout":{"elementId":"save"},"label":"Saves your work","position":"bottom","transition":{"enter":"fade","exit":"fade","durationMs":200}},{"id":"banner","text":{"position":"top-right"},"label":"Sample toolbar","duration":3000}]}}'/></info></step>
      <step><cmd>The status line at the top is hidden, because it changes on every visit.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"add":[{"id":"redact","blur":{"selector":"#status span"},"all":true,"transition":{"enter":"none"}}]}}'/></info></step>
      <step><cmd>Compare your toolbar with the screenshot.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-toolbar.png","directory":".dd-output","overwrite":"true"}}'/></info></step>
      <step><cmd>Next, find the check icon, now marked 2.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"update":[{"id":"save-badge","badge":"#check","label":"2"}]}}'/>
          <data name="doc-detective" value='step {"annotate":{"clear":["hint"]}}'/></info></step>
      <step><cmd>That's every control on the toolbar.</cmd>
        <info><data name="doc-detective" value='step {"annotate":{"clear":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "annotationDefaults": {
    "fontSize": 14,
    "background": "#1E293B",
    "opacity": 0.9,
    "radius": 6,
    "padding": 4,
    "maxWidth": 240,
    "intensity": 16,
    "callout": {
      "background": "#0F172A",
      "color": "#FDE047"
    },
    "transition": {
      "enter": "fade",
      "exit": "fade",
      "durationMs": 250
    }
  },
  "tests": [
    {
      "testId": "capture-annotate",
      "autoScreenshot": false,
      "steps": [
        {
          "goTo": "http://localhost:8092/find-image.html"
        },
        {
          "annotate": {
            "add": [
              {
                "id": "save-badge",
                "badge": "#save",
                "label": "1"
              },
              {
                "id": "check-outline",
                "outline": {
                  "elementImage": {
                    "path": "check-icon.svg",
                    "threshold": 0.9
                  },
                  "timeout": 10000
                },
                "track": true,
                "transition": {
                  "enter": "draw",
                  "durationMs": 300
                }
              },
              {
                "id": "hint",
                "callout": {
                  "elementId": "save"
                },
                "label": "Saves your work",
                "position": "bottom",
                "transition": {
                  "enter": "fade",
                  "exit": "fade",
                  "durationMs": 200
                }
              },
              {
                "id": "banner",
                "text": {
                  "position": "top-right"
                },
                "label": "Sample toolbar",
                "duration": 3000
              }
            ]
          }
        },
        {
          "annotate": {
            "add": [
              {
                "id": "redact",
                "blur": {
                  "selector": "#status span"
                },
                "all": true,
                "transition": {
                  "enter": "none"
                }
              }
            ]
          }
        },
        {
          "screenshot": {
            "path": "capture-toolbar.png",
            "directory": ".dd-output",
            "overwrite": "true"
          }
        },
        {
          "annotate": {
            "update": [
              {
                "id": "save-badge",
                "badge": "#check",
                "label": "2"
              }
            ]
          }
        },
        {
          "annotate": {
            "clear": [
              "hint"
            ]
          }
        },
        {
          "annotate": {
            "clear": true
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
annotationDefaults:
  fontSize: 14
  background: "#1E293B"
  opacity: 0.9
  radius: 6
  padding: 4
  maxWidth: 240
  intensity: 16
  callout:
    background: "#0F172A"
    color: "#FDE047"
  transition:
    enter: fade
    exit: fade
    durationMs: 250
tests:
  - testId: capture-annotate
    autoScreenshot: false
    steps:
      - goTo: http://localhost:8092/find-image.html
      - annotate:
          add:
            - id: save-badge
              badge: "#save"
              label: "1"
            - id: check-outline
              outline:
                elementImage:
                  path: check-icon.svg
                  threshold: 0.9
                timeout: 10000
              track: true
              transition:
                enter: draw
                durationMs: 300
            - id: hint
              callout:
                elementId: save
              label: Saves your work
              position: bottom
              transition:
                enter: fade
                exit: fade
                durationMs: 200
            - id: banner
              text:
                position: top-right
              label: Sample toolbar
              duration: 3000
      - annotate:
          add:
            - id: redact
              blur:
                selector: "#status span"
              all: true
              transition:
                enter: none
      - screenshot:
          path: capture-toolbar.png
          directory: .dd-output
          overwrite: "true"
      - annotate:
          update:
            - id: save-badge
              badge: "#check"
              label: "2"
      - annotate:
          clear:
            - hint
      - annotate:
          clear: true
```

### Annotations in this example

| Annotation      | Fields                                                                                                                                                                                                                                                    |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `save-badge`    | A `badge` on a selector string. The `update` step moves it to the check icon and changes its `label`.                                                                                                                                                     |
| `check-outline` | An `outline` on an [`elementImage`](/reference/schemas/image-detailed) target, `check-icon.svg` in the example folder, with a `threshold` and a `timeout`. `track` keeps it on the icon if the page moves, and the `draw` transition sets how it appears. |
| `hint`          | A `callout` on an `elementId` with a `position` and `fade` transitions. `clear` with a list of ids removes it.                                                                                                                                            |
| `banner`        | A `text` box in the top-right region that clears itself after a `duration` of 3000 milliseconds.                                                                                                                                                          |
| `redact`        | A `blur` with `all`, so it hides every match, and the `none` transition, so the hidden text never shows.                                                                                                                                                  |

`clear` set to `true` removes every annotation that's left. The test's `annotationDefaults` sets the font size, a `background`, `opacity`, `radius`, `padding`, `maxWidth`, and blur `intensity` for every type, the `callout` colors, and a default `transition`. The standalone specs set `annotationDefaults` on the spec instead, where it applies to every test in the file. A test's theme wins over the spec's. It sets `autoScreenshot` to `false`, so the run saves only the screenshot the procedure asks for.

`track`, `transition`, and `duration` change how annotations behave in a recording. A screenshot shows each annotation at the moment the screenshot is taken.

### What detection finds

The link becomes a `goTo` step and a `checkLink` step. No default rule produces `annotate` or a screenshot without an image, so those are statements in every detected variant.

## Record a walkthrough

This procedure uses [`record`](/docs/actions/record) as `true`, as a path, and as an object with `path`, `directory`, `name`, `surface`, `engine`, `overwrite`, [`checkpoints`](/reference/schemas/recording-checkpoints-detailed), and [`verify`](/reference/schemas/recording-verify-guards). It stops recordings with [`stopRecord`](/docs/actions/stoprecord) by name, with a `name` object, and with `true`, after a [`wait`](/docs/actions/wait) so each video has something in it.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Record a walkthrough

## Record the browser tab

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording the tab.
3. Click **Type here:**.
4. Type "Hello, Doc Detective".
5. Wait a moment, then stop the recording.
6. Record a few seconds more with the default settings.

## Record the screen

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start a screen recording.
3. Click **Type here:**.
4. Type "Recorded on screen".
5. Wait a moment, then stop the recording.
6. Record only the browser window.
7. Record only the page, and compare each step with the last run.
8. Record the screen again with the default ffmpeg settings.
9. Record a short clip of the result.
10. Wait a second, then stop the clip.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Record a walkthrough

## Record the browser tab

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording the tab.
3. Click **Type here:**.
4. Type "Hello, Doc Detective".
5. Wait a moment, then stop the recording.
6. Record a few seconds more with the default settings.

## Record the screen

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start a screen recording.
3. Click **Type here:**.
4. Type "Recorded on screen".
5. Wait a moment, then stop the recording.
6. Record only the browser window.
7. Record only the page, and compare each step with the last run.
8. Record the screen again with the default ffmpeg settings.
9. Record a short clip of the result.
10. Wait a second, then stop the clip.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Record a walkthrough

== Record the browser tab

. Go to http://localhost:8092/type-echo.html[the type echo page].
. Start recording the tab.
. Click *Type here:*.
. Type "Hello, Doc Detective".
. Wait a moment, then stop the recording.
. Record a few seconds more with the default settings.

== Record the screen

. Go to http://localhost:8092/type-echo.html[the type echo page].
. Start a screen recording.
. Click *Type here:*.
. Type "Recorded on screen".
. Wait a moment, then stop the recording.
. Record only the browser window.
. Record only the page, and compare each step with the last run.
. Record the screen again with the default ffmpeg settings.
. Record a short clip of the result.
. Wait a second, then stop the clip.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Record a walkthrough</title></head>
<body>
<h1>Record a walkthrough</h1>
<h2>Record the browser tab</h2>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</li>
  <li>Start recording the tab.</li>
  <li>Click <strong>Type here:</strong>.</li>
  <li>Type "Hello, Doc Detective".</li>
  <li>Wait a moment, then stop the recording.</li>
  <li>Record a few seconds more with the default settings.</li>
</ol>
<h2>Record the screen</h2>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</li>
  <li>Start a screen recording.</li>
  <li>Click <strong>Type here:</strong>.</li>
  <li>Type "Recorded on screen".</li>
  <li>Wait a moment, then stop the recording.</li>
  <li>Record only the browser window.</li>
  <li>Record only the page, and compare each step with the last run.</li>
  <li>Record the screen again with the default ffmpeg settings.</li>
  <li>Record a short clip of the result.</li>
  <li>Wait a second, then stop the clip.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Record a walkthrough
====================

Record the browser tab
----------------------

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

#. Start recording the tab.

#. Click **Type here:**.

#. Type "Hello, Doc Detective".

#. Wait a moment, then stop the recording.

#. Record a few seconds more with the default settings.

Record the screen
-----------------

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

#. Start a screen recording.

#. Click **Type here:**.

#. Type "Recorded on screen".

#. Wait a moment, then stop the recording.

#. Record only the browser window.

#. Record only the page, and compare each step with the last run.

#. Record the screen again with the default ffmpeg settings.

#. Record a short clip of the result.

#. Wait a second, then stop the clip.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-recording">
  <title>Record a walkthrough</title>
  <taskbody/>
  <task id="capture-record-tab">
    <title>Record the browser tab</title>
    <taskbody>
      <steps>
        <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
        <step><cmd>Start recording the tab.</cmd></step>
        <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd></step>
        <step><cmd>Type "Hello, Doc Detective".</cmd></step>
        <step><cmd>Wait a moment, then stop the recording.</cmd></step>
        <step><cmd>Record a few seconds more with the default settings.</cmd></step>
      </steps>
    </taskbody>
  </task>
  <task id="capture-record-screen">
    <title>Record the screen</title>
    <taskbody>
      <steps>
        <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
        <step><cmd>Start a screen recording.</cmd></step>
        <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd></step>
        <step><cmd>Type "Recorded on screen".</cmd></step>
        <step><cmd>Wait a moment, then stop the recording.</cmd></step>
        <step><cmd>Record only the browser window.</cmd></step>
        <step><cmd>Record only the page, and compare each step with the last run.</cmd></step>
        <step><cmd>Record the screen again with the default ffmpeg settings.</cmd></step>
        <step><cmd>Record a short clip of the result.</cmd></step>
        <step><cmd>Wait a second, then stop the clip.</cmd></step>
      </steps>
    </taskbody>
  </task>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
# Record a walkthrough

<!-- test {"testId":"capture-record-tab","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]} -->

## Record the browser tab

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
2. Start recording the tab.
   <!-- step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}} -->
3. Click **Type here:**.
4. Type "Hello, Doc Detective".
5. Wait a moment, then stop the recording.
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":{"name":"walkthrough"}} -->
6. Record a few seconds more with the default settings.
   <!-- step {"record":true} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->

<!-- test end -->

<!-- test {"testId":"capture-record-screen","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]} -->

## Record the screen

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
2. Start a screen recording.
   <!-- step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}} -->
3. Click **Type here:**.
4. Type "Recorded on screen".
5. Wait a moment, then stop the recording.
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":"screen"} -->
6. Record only the browser window.
   <!-- step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->
7. Record only the page, and compare each step with the last run.
   <!-- step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->
8. Record the screen again with the default ffmpeg settings.
   <!-- step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->
9. Record a short clip of the result.
   <!-- step {"record":".dd-output/capture-quick.gif"} -->
10. Wait a second, then stop the clip.
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
# Record a walkthrough

{/* test {"testId":"capture-record-tab","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]} */}

## Record the browser tab

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
2. Start recording the tab.
   {/* step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}} */}
3. Click **Type here:**.
4. Type "Hello, Doc Detective".
5. Wait a moment, then stop the recording.
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":{"name":"walkthrough"}} */}
6. Record a few seconds more with the default settings.
   {/* step {"record":true} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}

{/* test end */}

{/* test {"testId":"capture-record-screen","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]} */}

## Record the screen

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
2. Start a screen recording.
   {/* step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}} */}
3. Click **Type here:**.
4. Type "Recorded on screen".
5. Wait a moment, then stop the recording.
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":"screen"} */}
6. Record only the browser window.
   {/* step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}
7. Record only the page, and compare each step with the last run.
   {/* step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}
8. Record the screen again with the default ffmpeg settings.
   {/* step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}
9. Record a short clip of the result.
   {/* step {"record":".dd-output/capture-quick.gif"} */}
10. Wait a second, then stop the clip.
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Record a walkthrough

// (test {"testId":"capture-record-tab","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]})

== Record the browser tab

. Go to http://localhost:8092/type-echo.html[the type echo page].
+
// (step {"goTo":"http://localhost:8092/type-echo.html"})
. Start recording the tab.
+
// (step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}})
. Click *Type here:*.
. Type "Hello, Doc Detective".
. Wait a moment, then stop the recording.
+
// (step {"wait":1000})
+
// (step {"stopRecord":{"name":"walkthrough"}})
. Record a few seconds more with the default settings.
+
// (step {"record":true})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})

// (test end)

// (test {"testId":"capture-record-screen","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]})

== Record the screen

. Go to http://localhost:8092/type-echo.html[the type echo page].
+
// (step {"goTo":"http://localhost:8092/type-echo.html"})
. Start a screen recording.
+
// (step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}})
. Click *Type here:*.
. Type "Recorded on screen".
. Wait a moment, then stop the recording.
+
// (step {"wait":1000})
+
// (step {"stopRecord":"screen"})
. Record only the browser window.
+
// (step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})
. Record only the page, and compare each step with the last run.
+
// (step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})
. Record the screen again with the default ffmpeg settings.
+
// (step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})
. Record a short clip of the result.
+
// (step {"record":".dd-output/capture-quick.gif"})
. Wait a second, then stop the clip.
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Record a walkthrough</title></head>
<body>
<h1>Record a walkthrough</h1>
<!-- test {"testId":"capture-record-tab","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]} -->
<h2>Record the browser tab</h2>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Start recording the tab.
    <!-- step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}} --></li>
  <li>Click <strong>Type here:</strong>.</li>
  <li>Type "Hello, Doc Detective".</li>
  <li>Wait a moment, then stop the recording.
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":{"name":"walkthrough"}} --></li>
  <li>Record a few seconds more with the default settings.
    <!-- step {"record":true} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
</ol>
<!-- test end -->
<!-- test {"testId":"capture-record-screen","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]} -->
<h2>Record the screen</h2>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Start a screen recording.
    <!-- step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}} --></li>
  <li>Click <strong>Type here:</strong>.</li>
  <li>Type "Recorded on screen".</li>
  <li>Wait a moment, then stop the recording.
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":"screen"} --></li>
  <li>Record only the browser window.
    <!-- step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
  <li>Record only the page, and compare each step with the last run.
    <!-- step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
  <li>Record the screen again with the default ffmpeg settings.
    <!-- step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
  <li>Record a short clip of the result.
    <!-- step {"record":".dd-output/capture-quick.gif"} --></li>
  <li>Wait a second, then stop the clip.
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Record a walkthrough
====================

.. test {"testId":"capture-record-tab","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]}

Record the browser tab
----------------------

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

   .. step {"goTo":"http://localhost:8092/type-echo.html"}

#. Start recording the tab.

   .. step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}}

#. Click **Type here:**.

#. Type "Hello, Doc Detective".

#. Wait a moment, then stop the recording.

   .. step {"wait":1000}

   .. step {"stopRecord":{"name":"walkthrough"}}

#. Record a few seconds more with the default settings.

   .. step {"record":true}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

.. test end

.. test {"testId":"capture-record-screen","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]}

Record the screen
-----------------

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

   .. step {"goTo":"http://localhost:8092/type-echo.html"}

#. Start a screen recording.

   .. step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}}

#. Click **Type here:**.

#. Type "Recorded on screen".

#. Wait a moment, then stop the recording.

   .. step {"wait":1000}

   .. step {"stopRecord":"screen"}

#. Record only the browser window.

   .. step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

#. Record only the page, and compare each step with the last run.

   .. step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

#. Record the screen again with the default ffmpeg settings.

   .. step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

#. Record a short clip of the result.

   .. step {"record":".dd-output/capture-quick.gif"}

#. Wait a second, then stop the clip.

   .. step {"wait":1000}

   .. step {"stopRecord":true}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-recording">
  <title>Record a walkthrough</title>
  <taskbody/>
  <task id="capture-record-tab">
    <title>Record the browser tab</title>
    <taskbody>
      <data name="doc-detective" value='test {"testId":"capture-record-tab","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]}'/>
      <steps>
        <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
          <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
        <step><cmd>Start recording the tab.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}}'/></info></step>
        <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd></step>
        <step><cmd>Type "Hello, Doc Detective".</cmd></step>
        <step><cmd>Wait a moment, then stop the recording.</cmd>
          <info><data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":{"name":"walkthrough"}}'/></info></step>
        <step><cmd>Record a few seconds more with the default settings.</cmd>
          <info><data name="doc-detective" value='step {"record":true}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
      </steps>
      <data name="doc-detective" value="test end"/>
    </taskbody>
  </task>
  <task id="capture-record-screen">
    <title>Record the screen</title>
    <taskbody>
      <data name="doc-detective" value='test {"testId":"capture-record-screen","detectSteps":true,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]}'/>
      <steps>
        <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
          <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
        <step><cmd>Start a screen recording.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}}'/></info></step>
        <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd></step>
        <step><cmd>Type "Recorded on screen".</cmd></step>
        <step><cmd>Wait a moment, then stop the recording.</cmd>
          <info><data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":"screen"}'/></info></step>
        <step><cmd>Record only the browser window.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
        <step><cmd>Record only the page, and compare each step with the last run.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
        <step><cmd>Record the screen again with the default ffmpeg settings.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
        <step><cmd>Record a short clip of the result.</cmd>
          <info><data name="doc-detective" value='step {"record":".dd-output/capture-quick.gif"}'/></info></step>
        <step><cmd>Wait a second, then stop the clip.</cmd>
          <info><data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
      </steps>
      <data name="doc-detective" value="test end"/>
    </taskbody>
  </task>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
# Record a walkthrough

<!-- test {"testId":"capture-record-tab","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]} -->

## Record the browser tab

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
2. Start recording the tab.
   <!-- step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}} -->
3. Click **Type here:**.
   <!-- step {"click":"Type here:"} -->
4. Type "Hello, Doc Detective".
   <!-- step {"type":"Hello, Doc Detective"} -->
5. Wait a moment, then stop the recording.
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":{"name":"walkthrough"}} -->
6. Record a few seconds more with the default settings.
   <!-- step {"record":true} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->

<!-- test end -->

<!-- test {"testId":"capture-record-screen","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]} -->

## Record the screen

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
2. Start a screen recording.
   <!-- step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}} -->
3. Click **Type here:**.
   <!-- step {"click":"Type here:"} -->
4. Type "Recorded on screen".
   <!-- step {"type":"Recorded on screen"} -->
5. Wait a moment, then stop the recording.
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":"screen"} -->
6. Record only the browser window.
   <!-- step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->
7. Record only the page, and compare each step with the last run.
   <!-- step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->
8. Record the screen again with the default ffmpeg settings.
   <!-- step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}} -->
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->
9. Record a short clip of the result.
   <!-- step {"record":".dd-output/capture-quick.gif"} -->
10. Wait a second, then stop the clip.
   <!-- step {"wait":1000} -->
   <!-- step {"stopRecord":true} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
# Record a walkthrough

{/* test {"testId":"capture-record-tab","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]} */}

## Record the browser tab

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
2. Start recording the tab.
   {/* step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}} */}
3. Click **Type here:**.
   {/* step {"click":"Type here:"} */}
4. Type "Hello, Doc Detective".
   {/* step {"type":"Hello, Doc Detective"} */}
5. Wait a moment, then stop the recording.
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":{"name":"walkthrough"}} */}
6. Record a few seconds more with the default settings.
   {/* step {"record":true} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}

{/* test end */}

{/* test {"testId":"capture-record-screen","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]} */}

## Record the screen

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
2. Start a screen recording.
   {/* step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}} */}
3. Click **Type here:**.
   {/* step {"click":"Type here:"} */}
4. Type "Recorded on screen".
   {/* step {"type":"Recorded on screen"} */}
5. Wait a moment, then stop the recording.
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":"screen"} */}
6. Record only the browser window.
   {/* step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}
7. Record only the page, and compare each step with the last run.
   {/* step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}
8. Record the screen again with the default ffmpeg settings.
   {/* step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}} */}
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}
9. Record a short clip of the result.
   {/* step {"record":".dd-output/capture-quick.gif"} */}
10. Wait a second, then stop the clip.
   {/* step {"wait":1000} */}
   {/* step {"stopRecord":true} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Record a walkthrough

// (test {"testId":"capture-record-tab","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]})

== Record the browser tab

. Go to http://localhost:8092/type-echo.html[the type echo page].
+
// (step {"goTo":"http://localhost:8092/type-echo.html"})
. Start recording the tab.
+
// (step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}})
. Click *Type here:*.
+
// (step {"click":"Type here:"})
. Type "Hello, Doc Detective".
+
// (step {"type":"Hello, Doc Detective"})
. Wait a moment, then stop the recording.
+
// (step {"wait":1000})
+
// (step {"stopRecord":{"name":"walkthrough"}})
. Record a few seconds more with the default settings.
+
// (step {"record":true})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})

// (test end)

// (test {"testId":"capture-record-screen","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]})

== Record the screen

. Go to http://localhost:8092/type-echo.html[the type echo page].
+
// (step {"goTo":"http://localhost:8092/type-echo.html"})
. Start a screen recording.
+
// (step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}})
. Click *Type here:*.
+
// (step {"click":"Type here:"})
. Type "Recorded on screen".
+
// (step {"type":"Recorded on screen"})
. Wait a moment, then stop the recording.
+
// (step {"wait":1000})
+
// (step {"stopRecord":"screen"})
. Record only the browser window.
+
// (step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})
. Record only the page, and compare each step with the last run.
+
// (step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})
. Record the screen again with the default ffmpeg settings.
+
// (step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}})
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})
. Record a short clip of the result.
+
// (step {"record":".dd-output/capture-quick.gif"})
. Wait a second, then stop the clip.
+
// (step {"wait":1000})
+
// (step {"stopRecord":true})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Record a walkthrough</title></head>
<body>
<h1>Record a walkthrough</h1>
<!-- test {"testId":"capture-record-tab","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]} -->
<h2>Record the browser tab</h2>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Start recording the tab.
    <!-- step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}} --></li>
  <li>Click <strong>Type here:</strong>.
    <!-- step {"click":"Type here:"} --></li>
  <li>Type "Hello, Doc Detective".
    <!-- step {"type":"Hello, Doc Detective"} --></li>
  <li>Wait a moment, then stop the recording.
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":{"name":"walkthrough"}} --></li>
  <li>Record a few seconds more with the default settings.
    <!-- step {"record":true} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
</ol>
<!-- test end -->
<!-- test {"testId":"capture-record-screen","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]} -->
<h2>Record the screen</h2>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Start a screen recording.
    <!-- step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}} --></li>
  <li>Click <strong>Type here:</strong>.
    <!-- step {"click":"Type here:"} --></li>
  <li>Type "Recorded on screen".
    <!-- step {"type":"Recorded on screen"} --></li>
  <li>Wait a moment, then stop the recording.
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":"screen"} --></li>
  <li>Record only the browser window.
    <!-- step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
  <li>Record only the page, and compare each step with the last run.
    <!-- step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
  <li>Record the screen again with the default ffmpeg settings.
    <!-- step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}} -->
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
  <li>Record a short clip of the result.
    <!-- step {"record":".dd-output/capture-quick.gif"} --></li>
  <li>Wait a second, then stop the clip.
    <!-- step {"wait":1000} -->
    <!-- step {"stopRecord":true} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Record a walkthrough
====================

.. test {"testId":"capture-record-tab","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]}

Record the browser tab
----------------------

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

   .. step {"goTo":"http://localhost:8092/type-echo.html"}

#. Start recording the tab.

   .. step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}}

#. Click **Type here:**.

   .. step {"click":"Type here:"}

#. Type "Hello, Doc Detective".

   .. step {"type":"Hello, Doc Detective"}

#. Wait a moment, then stop the recording.

   .. step {"wait":1000}

   .. step {"stopRecord":{"name":"walkthrough"}}

#. Record a few seconds more with the default settings.

   .. step {"record":true}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

.. test end

.. test {"testId":"capture-record-screen","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]}

Record the screen
-----------------

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

   .. step {"goTo":"http://localhost:8092/type-echo.html"}

#. Start a screen recording.

   .. step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}}

#. Click **Type here:**.

   .. step {"click":"Type here:"}

#. Type "Recorded on screen".

   .. step {"type":"Recorded on screen"}

#. Wait a moment, then stop the recording.

   .. step {"wait":1000}

   .. step {"stopRecord":"screen"}

#. Record only the browser window.

   .. step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

#. Record only the page, and compare each step with the last run.

   .. step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

#. Record the screen again with the default ffmpeg settings.

   .. step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}}

   .. step {"wait":1000}

   .. step {"stopRecord":true}

#. Record a short clip of the result.

   .. step {"record":".dd-output/capture-quick.gif"}

#. Wait a second, then stop the clip.

   .. step {"wait":1000}

   .. step {"stopRecord":true}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-recording">
  <title>Record a walkthrough</title>
  <taskbody/>
  <task id="capture-record-tab">
    <title>Record the browser tab</title>
    <taskbody>
      <data name="doc-detective" value='test {"testId":"capture-record-tab","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}},{"platforms":["linux"],"browsers":{"name":"chrome","headless":true}}]}'/>
      <steps>
        <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
          <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
        <step><cmd>Start recording the tab.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-walkthrough.webm","directory":".dd-output","name":"walkthrough","engine":"browser","overwrite":"true","checkpoints":{"maxVariation":0.5,"directory":".dd-output/walkthrough-checkpoints"},"surface":{"browser":"chrome"},"verify":{"minDuration":0.5,"maxDuration":120,"notBlack":true,"resolution":true}}}'/></info></step>
        <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd>
          <info><data name="doc-detective" value='step {"click":"Type here:"}'/></info></step>
        <step><cmd>Type "Hello, Doc Detective".</cmd>
          <info><data name="doc-detective" value='step {"type":"Hello, Doc Detective"}'/></info></step>
        <step><cmd>Wait a moment, then stop the recording.</cmd>
          <info><data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":{"name":"walkthrough"}}'/></info></step>
        <step><cmd>Record a few seconds more with the default settings.</cmd>
          <info><data name="doc-detective" value='step {"record":true}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
      </steps>
      <data name="doc-detective" value="test end"/>
    </taskbody>
  </task>
  <task id="capture-record-screen">
    <title>Record the screen</title>
    <taskbody>
      <data name="doc-detective" value='test {"testId":"capture-record-screen","detectSteps":false,"autoRecord":false,"runOn":[{"platforms":["windows","mac"],"browsers":{"name":"chrome","headless":false}}]}'/>
      <steps>
        <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
          <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
        <step><cmd>Start a screen recording.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-screen.mp4","directory":".dd-output","name":"screen","engine":{"name":"ffmpeg","target":"display","fps":15},"overwrite":"true"}}'/></info></step>
        <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd>
          <info><data name="doc-detective" value='step {"click":"Type here:"}'/></info></step>
        <step><cmd>Type "Recorded on screen".</cmd>
          <info><data name="doc-detective" value='step {"type":"Recorded on screen"}'/></info></step>
        <step><cmd>Wait a moment, then stop the recording.</cmd>
          <info><data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":"screen"}'/></info></step>
        <step><cmd>Record only the browser window.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-window.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"window"},"overwrite":"true"}}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
        <step><cmd>Record only the page, and compare each step with the last run.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-viewport.mp4","directory":".dd-output","engine":{"name":"ffmpeg","target":"viewport"},"overwrite":"true","checkpoints":true}}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
        <step><cmd>Record the screen again with the default ffmpeg settings.</cmd>
          <info><data name="doc-detective" value='step {"record":{"path":"capture-ffmpeg.mp4","directory":".dd-output","engine":"ffmpeg","overwrite":"true"}}'/>
            <data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
        <step><cmd>Record a short clip of the result.</cmd>
          <info><data name="doc-detective" value='step {"record":".dd-output/capture-quick.gif"}'/></info></step>
        <step><cmd>Wait a second, then stop the clip.</cmd>
          <info><data name="doc-detective" value='step {"wait":1000}'/>
            <data name="doc-detective" value='step {"stopRecord":true}'/></info></step>
      </steps>
      <data name="doc-detective" value="test end"/>
    </taskbody>
  </task>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "autoRecord": false,
  "tests": [
    {
      "testId": "capture-record-tab",
      "runOn": [
        {
          "platforms": [
            "windows",
            "mac"
          ],
          "browsers": {
            "name": "chrome",
            "headless": false
          }
        },
        {
          "platforms": [
            "linux"
          ],
          "browsers": {
            "name": "chrome",
            "headless": true
          }
        }
      ],
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "record": {
            "path": "capture-walkthrough.webm",
            "directory": ".dd-output",
            "name": "walkthrough",
            "engine": "browser",
            "overwrite": "true",
            "checkpoints": {
              "maxVariation": 0.5,
              "directory": ".dd-output/walkthrough-checkpoints"
            },
            "surface": {
              "browser": "chrome"
            },
            "verify": {
              "minDuration": 0.5,
              "maxDuration": 120,
              "notBlack": true,
              "resolution": true
            }
          }
        },
        {
          "click": "Type here:"
        },
        {
          "type": "Hello, Doc Detective"
        },
        {
          "wait": 1000
        },
        {
          "stopRecord": {
            "name": "walkthrough"
          }
        },
        {
          "record": true
        },
        {
          "wait": 1000
        },
        {
          "stopRecord": true
        }
      ]
    },
    {
      "testId": "capture-record-screen",
      "runOn": [
        {
          "platforms": [
            "windows",
            "mac"
          ],
          "browsers": {
            "name": "chrome",
            "headless": false
          }
        }
      ],
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "record": {
            "path": "capture-screen.mp4",
            "directory": ".dd-output",
            "name": "screen",
            "engine": {
              "name": "ffmpeg",
              "target": "display",
              "fps": 15
            },
            "overwrite": "true"
          }
        },
        {
          "click": "Type here:"
        },
        {
          "type": "Recorded on screen"
        },
        {
          "wait": 1000
        },
        {
          "stopRecord": "screen"
        },
        {
          "record": {
            "path": "capture-window.mp4",
            "directory": ".dd-output",
            "engine": {
              "name": "ffmpeg",
              "target": "window"
            },
            "overwrite": "true"
          }
        },
        {
          "wait": 1000
        },
        {
          "stopRecord": true
        },
        {
          "record": {
            "path": "capture-viewport.mp4",
            "directory": ".dd-output",
            "engine": {
              "name": "ffmpeg",
              "target": "viewport"
            },
            "overwrite": "true",
            "checkpoints": true
          }
        },
        {
          "wait": 1000
        },
        {
          "stopRecord": true
        },
        {
          "record": {
            "path": "capture-ffmpeg.mp4",
            "directory": ".dd-output",
            "engine": "ffmpeg",
            "overwrite": "true"
          }
        },
        {
          "wait": 1000
        },
        {
          "stopRecord": true
        },
        {
          "record": ".dd-output/capture-quick.gif"
        },
        {
          "wait": 1000
        },
        {
          "stopRecord": true
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
autoRecord: false
tests:
  - testId: capture-record-tab
    runOn:
      - platforms:
          - windows
          - mac
        browsers:
          name: chrome
          headless: false
      - platforms:
          - linux
        browsers:
          name: chrome
          headless: true
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - record:
          path: capture-walkthrough.webm
          directory: .dd-output
          name: walkthrough
          engine: browser
          overwrite: "true"
          checkpoints:
            maxVariation: 0.5
            directory: .dd-output/walkthrough-checkpoints
          surface:
            browser: chrome
          verify:
            minDuration: 0.5
            maxDuration: 120
            notBlack: true
            resolution: true
      - click: "Type here:"
      - type: Hello, Doc Detective
      - wait: 1000
      - stopRecord:
          name: walkthrough
      - record: true
      - wait: 1000
      - stopRecord: true
  - testId: capture-record-screen
    runOn:
      - platforms:
          - windows
          - mac
        browsers:
          name: chrome
          headless: false
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - record:
          path: capture-screen.mp4
          directory: .dd-output
          name: screen
          engine:
            name: ffmpeg
            target: display
            fps: 15
          overwrite: "true"
      - click: "Type here:"
      - type: Recorded on screen
      - wait: 1000
      - stopRecord: screen
      - record:
          path: capture-window.mp4
          directory: .dd-output
          engine:
            name: ffmpeg
            target: window
          overwrite: "true"
      - wait: 1000
      - stopRecord: true
      - record:
          path: capture-viewport.mp4
          directory: .dd-output
          engine:
            name: ffmpeg
            target: viewport
          overwrite: "true"
          checkpoints: true
      - wait: 1000
      - stopRecord: true
      - record:
          path: capture-ffmpeg.mp4
          directory: .dd-output
          engine: ffmpeg
          overwrite: "true"
      - wait: 1000
      - stopRecord: true
      - record: .dd-output/capture-quick.gif
      - wait: 1000
      - stopRecord: true
```

### Where each test runs

Recording the screen needs a display, so each test sets `runOn`:

| Test                   | Runs on                                                          | Elsewhere |
| ---------------------- | ---------------------------------------------------------------- | --------- |
| Record the browser tab | Headed Chrome on Windows and macOS, and headless Chrome on Linux | `SKIPPED` |
| Record the screen      | Headed Chrome on Windows and macOS                               | `SKIPPED` |

The `browser` engine records the Chrome tab in a headed or a headless browser. The `ffmpeg` engine records the screen, so it needs a headed browser.

### Recording forms in this example

| Step                                                                             | What it does                                                                                                                                                                                                                                                                                                                              |
| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `record` with `name`, `surface`, `engine` `browser`, `checkpoints`, and `verify` | Records the Chrome tab to `capture-walkthrough.webm`. `checkpoints` saves a screenshot after each step and compares it with the last run's. `verify` fails the stop step if the video is shorter than half a second, longer than two minutes, or black. With `resolution` set to `true`, it also fails if the video isn't the tab's size. |
| `"stopRecord": { "name": "walkthrough" }`                                        | Stops the recording named `walkthrough`.                                                                                                                                                                                                                                                                                                  |
| `"record": true`                                                                 | Records to `<stepId>.mp4` in `outputDir`, with the engine Doc Detective picks for the context.                                                                                                                                                                                                                                            |
| `record` with `name` and an `engine` object, `target` `display`                  | Records the whole screen to `capture-screen.mp4` with `ffmpeg` at 15 frames a second.                                                                                                                                                                                                                                                     |
| `"stopRecord": "screen"`                                                         | Stops the recording named `screen`.                                                                                                                                                                                                                                                                                                       |
| `engine` object with `target` `window`                                           | Records only the active window.                                                                                                                                                                                                                                                                                                           |
| `engine` object with `target` `viewport`, and `"checkpoints": true`              | Records only the browser's content area. It compares a screenshot after each step with the last run's, with the default settings.                                                                                                                                                                                                         |
| `"engine": "ffmpeg"`                                                             | Records with `ffmpeg` and its default `target`, the whole screen.                                                                                                                                                                                                                                                                         |
| `"record": ".dd-output/capture-quick.gif"`                                       | Records a GIF. With no `overwrite`, it skips the recording when the file already exists.                                                                                                                                                                                                                                                  |
| `"stopRecord": true`                                                             | Stops the most recent recording.                                                                                                                                                                                                                                                                                                          |

Every test sets `autoRecord` to `false`, so the run records only what the procedure asks for. The standalone specs set it once on the spec.

The detected, inline, and standalone variants write the same files. The first run of the GIF step writes `capture-quick.gif`, and later runs skip that step, which doesn't fail the test. `"record": true` also skips when its file exists.

### What detection finds

The link becomes a `goTo` step and a `checkLink` step. **Type here:** after "Click" becomes a `click` step and a `find` step, and the quoted text after "Type" becomes a `type` step. No default rule produces `record`, `wait`, or `stopRecord`, so those are statements in every detected variant.

## Check pages for visual changes

This procedure compares new [`screenshot`](/docs/actions/screenshot) images with reference images. It uses `threshold`, `maxDiffPixels`, and `mask` to ignore what changes on every visit, `crop` as a selector string, `surface`, `style`, `stable`, `animations`, and `fullPage`. It also compares against a reference image at a URL, and takes a screenshot with `true`.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Check pages for visual changes

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced. Those times change on every visit.
3. The billing panel sits at the top of the page.
4. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
5. With the cookie banner hidden, the page shows only its content.
6. With the banner showing, it covers the bottom of the page.
7. Go to [the long page](http://localhost:8092/screenshot-tall.html).
8. Scroll to the red box at the bottom of the page.
9. Go to [the toolbar page](http://localhost:8092/find-image.html).
10. Compare the sample chart with the published chart image.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Check pages for visual changes

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced. Those times change on every visit.
3. The billing panel sits at the top of the page.
4. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
5. With the cookie banner hidden, the page shows only its content.
6. With the banner showing, it covers the bottom of the page.
7. Go to [the long page](http://localhost:8092/screenshot-tall.html).
8. Scroll to the red box at the bottom of the page.
9. Go to [the toolbar page](http://localhost:8092/find-image.html).
10. Compare the sample chart with the published chart image.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Check pages for visual changes

. Go to http://localhost:8092/mask.html[the billing page].
. The page shows the next invoice date and when the account last synced. Those times change on every visit.
. The billing panel sits at the top of the page.
. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. With the cookie banner hidden, the page shows only its content.
. With the banner showing, it covers the bottom of the page.
. Go to http://localhost:8092/screenshot-tall.html[the long page].
. Scroll to the red box at the bottom of the page.
. Go to http://localhost:8092/find-image.html[the toolbar page].
. Compare the sample chart with the published chart image.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check pages for visual changes</title></head>
<body>
<h1>Check pages for visual changes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.</li>
  <li>The page shows the next invoice date and when the account last synced. Those times change on every visit.</li>
  <li>The billing panel sits at the top of the page.</li>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>With the cookie banner hidden, the page shows only its content.</li>
  <li>With the banner showing, it covers the bottom of the page.</li>
  <li>Go to <a href="http://localhost:8092/screenshot-tall.html">the long page</a>.</li>
  <li>Scroll to the red box at the bottom of the page.</li>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.</li>
  <li>Compare the sample chart with the published chart image.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Check pages for visual changes
==============================

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

#. The page shows the next invoice date and when the account last synced. Those times change on every visit.

#. The billing panel sits at the top of the page.

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. With the cookie banner hidden, the page shows only its content.

#. With the banner showing, it covers the bottom of the page.

#. Go to `the long page <http://localhost:8092/screenshot-tall.html>`_.

#. Scroll to the red box at the bottom of the page.

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

#. Compare the sample chart with the published chart image.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-visual-checks">
  <title>Check pages for visual changes</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd></step>
      <step><cmd>The page shows the next invoice date and when the account last synced. Those times change on every visit.</cmd></step>
      <step><cmd>The billing panel sits at the top of the page.</cmd></step>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>With the cookie banner hidden, the page shows only its content.</cmd></step>
      <step><cmd>With the banner showing, it covers the bottom of the page.</cmd></step>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-tall.html" scope="external" format="html">the long page</xref>.</cmd></step>
      <step><cmd>Scroll to the red box at the bottom of the page.</cmd></step>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd></step>
      <step><cmd>Compare the sample chart with the published chart image.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-visual-checks","detectSteps":true,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]} -->

# Check pages for visual changes

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced. Those times change on every visit.
   <!-- step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}} -->
3. The billing panel sits at the top of the page.
   <!-- step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}} -->
4. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
5. With the cookie banner hidden, the page shows only its content.
   <!-- step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}} -->
6. With the banner showing, it covers the bottom of the page.
   <!-- step {"screenshot":true} -->
7. Go to [the long page](http://localhost:8092/screenshot-tall.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-tall.html"} -->
8. Scroll to the red box at the bottom of the page.
   <!-- step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}} -->
9. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
10. Compare the sample chart with the published chart image.
   <!-- step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-visual-checks","detectSteps":true,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]} */}

# Check pages for visual changes

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced. Those times change on every visit.
   {/* step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}} */}
3. The billing panel sits at the top of the page.
   {/* step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}} */}
4. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
5. With the cookie banner hidden, the page shows only its content.
   {/* step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}} */}
6. With the banner showing, it covers the bottom of the page.
   {/* step {"screenshot":true} */}
7. Go to [the long page](http://localhost:8092/screenshot-tall.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-tall.html"} */}
8. Scroll to the red box at the bottom of the page.
   {/* step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}} */}
9. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
10. Compare the sample chart with the published chart image.
   {/* step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Check pages for visual changes

// (test {"testId":"capture-visual-checks","detectSteps":true,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced. Those times change on every visit.
+
// (step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}})
. The billing panel sits at the top of the page.
+
// (step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}})
. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. With the cookie banner hidden, the page shows only its content.
+
// (step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}})
. With the banner showing, it covers the bottom of the page.
+
// (step {"screenshot":true})
. Go to http://localhost:8092/screenshot-tall.html[the long page].
+
// (step {"goTo":"http://localhost:8092/screenshot-tall.html"})
. Scroll to the red box at the bottom of the page.
+
// (step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}})
. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Compare the sample chart with the published chart image.
+
// (step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check pages for visual changes</title></head>
<body>
<!-- test {"testId":"capture-visual-checks","detectSteps":true,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]} -->
<h1>Check pages for visual changes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced. Those times change on every visit.
    <!-- step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}} --></li>
  <li>The billing panel sits at the top of the page.
    <!-- step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}} --></li>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>With the cookie banner hidden, the page shows only its content.
    <!-- step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}} --></li>
  <li>With the banner showing, it covers the bottom of the page.
    <!-- step {"screenshot":true} --></li>
  <li>Go to <a href="http://localhost:8092/screenshot-tall.html">the long page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-tall.html"} --></li>
  <li>Scroll to the red box at the bottom of the page.
    <!-- step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}} --></li>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Compare the sample chart with the published chart image.
    <!-- step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Check pages for visual changes
==============================

.. test {"testId":"capture-visual-checks","detectSteps":true,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced. Those times change on every visit.

   .. step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}}

#. The billing panel sits at the top of the page.

   .. step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. With the cookie banner hidden, the page shows only its content.

   .. step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}}

#. With the banner showing, it covers the bottom of the page.

   .. step {"screenshot":true}

#. Go to `the long page <http://localhost:8092/screenshot-tall.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-tall.html"}

#. Scroll to the red box at the bottom of the page.

   .. step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Compare the sample chart with the published chart image.

   .. step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-visual-checks">
  <title>Check pages for visual changes</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-visual-checks","detectSteps":true,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced. Those times change on every visit.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}}'/></info></step>
      <step><cmd>The billing panel sits at the top of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}}'/></info></step>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>With the cookie banner hidden, the page shows only its content.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}}'/></info></step>
      <step><cmd>With the banner showing, it covers the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":true}'/></info></step>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-tall.html" scope="external" format="html">the long page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-tall.html"}'/></info></step>
      <step><cmd>Scroll to the red box at the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}}'/></info></step>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Compare the sample chart with the published chart image.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-visual-checks","detectSteps":false,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]} -->

# Check pages for visual changes

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced. Those times change on every visit.
   <!-- step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}} -->
3. The billing panel sits at the top of the page.
   <!-- step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}} -->
4. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
5. With the cookie banner hidden, the page shows only its content.
   <!-- step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}} -->
6. With the banner showing, it covers the bottom of the page.
   <!-- step {"screenshot":true} -->
7. Go to [the long page](http://localhost:8092/screenshot-tall.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-tall.html"} -->
8. Scroll to the red box at the bottom of the page.
   <!-- step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}} -->
9. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
10. Compare the sample chart with the published chart image.
   <!-- step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-visual-checks","detectSteps":false,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]} */}

# Check pages for visual changes

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced. Those times change on every visit.
   {/* step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}} */}
3. The billing panel sits at the top of the page.
   {/* step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}} */}
4. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
5. With the cookie banner hidden, the page shows only its content.
   {/* step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}} */}
6. With the banner showing, it covers the bottom of the page.
   {/* step {"screenshot":true} */}
7. Go to [the long page](http://localhost:8092/screenshot-tall.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-tall.html"} */}
8. Scroll to the red box at the bottom of the page.
   {/* step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}} */}
9. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
10. Compare the sample chart with the published chart image.
   {/* step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Check pages for visual changes

// (test {"testId":"capture-visual-checks","detectSteps":false,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced. Those times change on every visit.
+
// (step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}})
. The billing panel sits at the top of the page.
+
// (step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}})
. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. With the cookie banner hidden, the page shows only its content.
+
// (step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}})
. With the banner showing, it covers the bottom of the page.
+
// (step {"screenshot":true})
. Go to http://localhost:8092/screenshot-tall.html[the long page].
+
// (step {"goTo":"http://localhost:8092/screenshot-tall.html"})
. Scroll to the red box at the bottom of the page.
+
// (step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}})
. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Compare the sample chart with the published chart image.
+
// (step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Check pages for visual changes</title></head>
<body>
<!-- test {"testId":"capture-visual-checks","detectSteps":false,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]} -->
<h1>Check pages for visual changes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced. Those times change on every visit.
    <!-- step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}} --></li>
  <li>The billing panel sits at the top of the page.
    <!-- step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}} --></li>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>With the cookie banner hidden, the page shows only its content.
    <!-- step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}} --></li>
  <li>With the banner showing, it covers the bottom of the page.
    <!-- step {"screenshot":true} --></li>
  <li>Go to <a href="http://localhost:8092/screenshot-tall.html">the long page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-tall.html"} --></li>
  <li>Scroll to the red box at the bottom of the page.
    <!-- step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}} --></li>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Compare the sample chart with the published chart image.
    <!-- step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Check pages for visual changes
==============================

.. test {"testId":"capture-visual-checks","detectSteps":false,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced. Those times change on every visit.

   .. step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}}

#. The billing panel sits at the top of the page.

   .. step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. With the cookie banner hidden, the page shows only its content.

   .. step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}}

#. With the banner showing, it covers the bottom of the page.

   .. step {"screenshot":true}

#. Go to `the long page <http://localhost:8092/screenshot-tall.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-tall.html"}

#. Scroll to the red box at the bottom of the page.

   .. step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Compare the sample chart with the published chart image.

   .. step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-visual-checks">
  <title>Check pages for visual changes</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-visual-checks","detectSteps":false,"runOn":[{"platforms":["windows","mac","linux"],"browsers":{"name":"chrome","headless":true}}]}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced. Those times change on every visit.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-billing.png","directory":".dd-output","maxVariation":0.05,"threshold":0.2,"maxDiffPixels":500,"mask":["#clock",{"selector":".stamp"}]}}'/></info></step>
      <step><cmd>The billing panel sits at the top of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-panel.png","directory":".dd-output","overwrite":"true","crop":"#panel"}}'/></info></step>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>With the cookie banner hidden, the page shows only its content.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-content.png","directory":".dd-output","overwrite":"true","surface":"chrome","style":".cookie-banner { visibility: hidden !important; }","stable":true,"animations":"disabled"}}'/></info></step>
      <step><cmd>With the banner showing, it covers the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":true}'/></info></step>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-tall.html" scope="external" format="html">the long page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-tall.html"}'/></info></step>
      <step><cmd>Scroll to the red box at the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"capture-tall.png","directory":".dd-output","overwrite":"true","fullPage":true}}'/></info></step>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Compare the sample chart with the published chart image.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"http://localhost:8092/find-image-chart.png","crop":"#sample-chart","maxVariation":0.2}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-visual-checks",
      "runOn": [
        {
          "platforms": [
            "windows",
            "mac",
            "linux"
          ],
          "browsers": {
            "name": "chrome",
            "headless": true
          }
        }
      ],
      "steps": [
        {
          "goTo": "http://localhost:8092/mask.html"
        },
        {
          "screenshot": {
            "path": "capture-billing.png",
            "directory": ".dd-output",
            "maxVariation": 0.05,
            "threshold": 0.2,
            "maxDiffPixels": 500,
            "mask": [
              "#clock",
              {
                "selector": ".stamp"
              }
            ]
          }
        },
        {
          "screenshot": {
            "path": "capture-panel.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "crop": "#panel"
          }
        },
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": {
            "path": "capture-content.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "surface": "chrome",
            "style": ".cookie-banner { visibility: hidden !important; }",
            "stable": true,
            "animations": "disabled"
          }
        },
        {
          "screenshot": true
        },
        {
          "goTo": "http://localhost:8092/screenshot-tall.html"
        },
        {
          "screenshot": {
            "path": "capture-tall.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "fullPage": true
          }
        },
        {
          "goTo": "http://localhost:8092/find-image.html"
        },
        {
          "screenshot": {
            "path": "http://localhost:8092/find-image-chart.png",
            "crop": "#sample-chart",
            "maxVariation": 0.2
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-visual-checks
    runOn:
      - platforms:
          - windows
          - mac
          - linux
        browsers:
          name: chrome
          headless: true
    steps:
      - goTo: http://localhost:8092/mask.html
      - screenshot:
          path: capture-billing.png
          directory: .dd-output
          maxVariation: 0.05
          threshold: 0.2
          maxDiffPixels: 500
          mask:
            - "#clock"
            - selector: .stamp
      - screenshot:
          path: capture-panel.png
          directory: .dd-output
          overwrite: "true"
          crop: "#panel"
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot:
          path: capture-content.png
          directory: .dd-output
          overwrite: "true"
          surface: chrome
          style: ".cookie-banner { visibility: hidden !important; }"
          stable: true
          animations: disabled
      - screenshot: true
      - goTo: http://localhost:8092/screenshot-tall.html
      - screenshot:
          path: capture-tall.png
          directory: .dd-output
          overwrite: "true"
          fullPage: true
      - goTo: http://localhost:8092/find-image.html
      - screenshot:
          path: http://localhost:8092/find-image-chart.png
          crop: "#sample-chart"
          maxVariation: 0.2
```

### Screenshot options in this example

| Step                                                  | What it does                                                                                                                                                                                                                                                                                      |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mask` with a selector string and a `selector` object | Paints `#clock` and every `.stamp` element the same color in both images before comparing, so the times that change on every visit don't count. `threshold` sets how different a pixel's color must be to count as changed, and `maxDiffPixels` caps the changed pixels alongside `maxVariation`. |
| `"crop": "#panel"`                                    | Saves only the element that matches the selector or display text.                                                                                                                                                                                                                                 |
| `surface`, `style`, `stable`, and `animations`        | Takes the screenshot in the `chrome` browser surface with the cookie banner hidden by CSS. It waits until two images in a row match, and stops animations while it takes the screenshot.                                                                                                          |
| `"fullPage": true`                                    | Saves the whole page, including the parts you scroll to, not only the viewport.                                                                                                                                                                                                                   |
| `path` set to a URL                                   | Compares the chart on the page with `find-image-chart.png` on the test server. Doc Detective never writes to a URL reference, so the new image goes to the run folder.                                                                                                                            |
| `"screenshot": true`                                  | Saves the viewport to `<stepId>.png` in `outputDir`.                                                                                                                                                                                                                                              |

The test runs in headless Chrome on Windows, macOS, and Linux. The first run of the masked step has no reference to compare with, so it saves one. Later runs compare with it.

### What detection finds

Each link becomes a `goTo` step and a `checkLink` step. No default rule produces these screenshot options, so the screenshots are statements in every detected variant.

## Permutations

Each example below varies one setting, so you can compare it with its neighbors. For the full procedures that combine them, see the sections above. For the other options, see [Annotation options](/reference/docs-as-tests/annotation-options) and [Recording options](/reference/docs-as-tests/recording-options).

## `screenshot` permutations

Each example opens a test-server page and takes one screenshot. The pages whose content keeps changing open with a `goTo` that doesn't wait for the page to stop changing.

### String path

**Varies:** `screenshot` · **Value:** `".dd-output/banner.png"` · **Effect:** saves the viewport to the path, and compares it with the file already there, if any.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot to a path

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot to a path

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot to a path

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot to a path</title></head>
<body>
<h1>Save a screenshot to a path</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot to a path
===========================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-string">
  <title>Save a screenshot to a path</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-form-string","detectSteps":true} -->

# Save a screenshot to a path

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":".dd-output/banner.png"} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-form-string","detectSteps":true} */}

# Save a screenshot to a path

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":".dd-output/banner.png"} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot to a path

// (test {"testId":"capture-screenshot-form-string","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":".dd-output/banner.png"})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot to a path</title></head>
<body>
<!-- test {"testId":"capture-screenshot-form-string","detectSteps":true} -->
<h1>Save a screenshot to a path</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":".dd-output/banner.png"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot to a path
===========================

.. test {"testId":"capture-screenshot-form-string","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":".dd-output/banner.png"}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-string">
  <title>Save a screenshot to a path</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-form-string","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":".dd-output/banner.png"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-form-string","detectSteps":false} -->

# Save a screenshot to a path

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":".dd-output/banner.png"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-form-string","detectSteps":false} */}

# Save a screenshot to a path

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":".dd-output/banner.png"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot to a path

// (test {"testId":"capture-screenshot-form-string","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":".dd-output/banner.png"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot to a path</title></head>
<body>
<!-- test {"testId":"capture-screenshot-form-string","detectSteps":false} -->
<h1>Save a screenshot to a path</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":".dd-output/banner.png"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot to a path
===========================

.. test {"testId":"capture-screenshot-form-string","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":".dd-output/banner.png"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-string">
  <title>Save a screenshot to a path</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-form-string","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":".dd-output/banner.png"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-form-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": ".dd-output/banner.png"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-form-string
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot: .dd-output/banner.png
```

### Object with `path` and `directory`

**Varies:** `screenshot` · **Value:** `{ "path", "directory" }` · **Effect:** saves the viewport to `banner.png` in the `.dd-output` folder.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot with a path and a folder

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot with a path and a folder

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot with a path and a folder

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with a path and a folder</title></head>
<body>
<h1>Save a screenshot with a path and a folder</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot with a path and a folder
==========================================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-object">
  <title>Save a screenshot with a path and a folder</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-form-object","detectSteps":true} -->

# Save a screenshot with a path and a folder

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"banner.png","directory":".dd-output"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-form-object","detectSteps":true} */}

# Save a screenshot with a path and a folder

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"banner.png","directory":".dd-output"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot with a path and a folder

// (test {"testId":"capture-screenshot-form-object","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"banner.png","directory":".dd-output"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with a path and a folder</title></head>
<body>
<!-- test {"testId":"capture-screenshot-form-object","detectSteps":true} -->
<h1>Save a screenshot with a path and a folder</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"banner.png","directory":".dd-output"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot with a path and a folder
==========================================

.. test {"testId":"capture-screenshot-form-object","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"banner.png","directory":".dd-output"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-object">
  <title>Save a screenshot with a path and a folder</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-form-object","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"banner.png","directory":".dd-output"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-form-object","detectSteps":false} -->

# Save a screenshot with a path and a folder

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"banner.png","directory":".dd-output"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-form-object","detectSteps":false} */}

# Save a screenshot with a path and a folder

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"banner.png","directory":".dd-output"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot with a path and a folder

// (test {"testId":"capture-screenshot-form-object","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"banner.png","directory":".dd-output"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with a path and a folder</title></head>
<body>
<!-- test {"testId":"capture-screenshot-form-object","detectSteps":false} -->
<h1>Save a screenshot with a path and a folder</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"banner.png","directory":".dd-output"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot with a path and a folder
==========================================

.. test {"testId":"capture-screenshot-form-object","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"banner.png","directory":".dd-output"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-object">
  <title>Save a screenshot with a path and a folder</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-form-object","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"banner.png","directory":".dd-output"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-form-object",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": {
            "path": "banner.png",
            "directory": ".dd-output"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-form-object
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot:
          path: banner.png
          directory: .dd-output
```

### `true`

**Varies:** `screenshot` · **Value:** `true` · **Effect:** saves the viewport to `<stepId>.png` in `outputDir`.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot with the default name

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot with the default name

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot with the default name

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with the default name</title></head>
<body>
<h1>Save a screenshot with the default name</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot with the default name
=======================================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-true">
  <title>Save a screenshot with the default name</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-form-true","detectSteps":true} -->

# Save a screenshot with the default name

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":true} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-form-true","detectSteps":true} */}

# Save a screenshot with the default name

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":true} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot with the default name

// (test {"testId":"capture-screenshot-form-true","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":true})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with the default name</title></head>
<body>
<!-- test {"testId":"capture-screenshot-form-true","detectSteps":true} -->
<h1>Save a screenshot with the default name</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":true} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot with the default name
=======================================

.. test {"testId":"capture-screenshot-form-true","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":true}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-true">
  <title>Save a screenshot with the default name</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-form-true","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":true}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-form-true","detectSteps":false} -->

# Save a screenshot with the default name

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":true} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-form-true","detectSteps":false} */}

# Save a screenshot with the default name

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":true} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot with the default name

// (test {"testId":"capture-screenshot-form-true","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":true})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with the default name</title></head>
<body>
<!-- test {"testId":"capture-screenshot-form-true","detectSteps":false} -->
<h1>Save a screenshot with the default name</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":true} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot with the default name
=======================================

.. test {"testId":"capture-screenshot-form-true","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":true}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-form-true">
  <title>Save a screenshot with the default name</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-form-true","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":true}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-form-true",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": true
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-form-true
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot: true
```

### `overwrite: "true"`

**Varies:** `screenshot.overwrite` · **Value:** `"true"` · **Effect:** replaces the saved image on every run without comparing.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot with overwrite true

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot with overwrite true

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot with overwrite true

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite true</title></head>
<body>
<h1>Save a screenshot with overwrite true</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot with overwrite true
=====================================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-true">
  <title>Save a screenshot with overwrite true</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-overwrite-true","detectSteps":true} -->

# Save a screenshot with overwrite true

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-overwrite-true","detectSteps":true} */}

# Save a screenshot with overwrite true

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot with overwrite true

// (test {"testId":"capture-screenshot-overwrite-true","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite true</title></head>
<body>
<!-- test {"testId":"capture-screenshot-overwrite-true","detectSteps":true} -->
<h1>Save a screenshot with overwrite true</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot with overwrite true
=====================================

.. test {"testId":"capture-screenshot-overwrite-true","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-true">
  <title>Save a screenshot with overwrite true</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-overwrite-true","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-overwrite-true","detectSteps":false} -->

# Save a screenshot with overwrite true

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-overwrite-true","detectSteps":false} */}

# Save a screenshot with overwrite true

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot with overwrite true

// (test {"testId":"capture-screenshot-overwrite-true","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite true</title></head>
<body>
<!-- test {"testId":"capture-screenshot-overwrite-true","detectSteps":false} -->
<h1>Save a screenshot with overwrite true</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot with overwrite true
=====================================

.. test {"testId":"capture-screenshot-overwrite-true","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-true">
  <title>Save a screenshot with overwrite true</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-overwrite-true","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"overwrite-true.png","directory":".dd-output","overwrite":"true"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-overwrite-true",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": {
            "path": "overwrite-true.png",
            "directory": ".dd-output",
            "overwrite": "true"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-overwrite-true
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot:
          path: overwrite-true.png
          directory: .dd-output
          overwrite: "true"
```

### `overwrite: "false"`

**Varies:** `screenshot.overwrite` · **Value:** `"false"` · **Effect:** keeps the saved image, and skips the step when the file already exists.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot with overwrite false

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot with overwrite false

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot with overwrite false

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite false</title></head>
<body>
<h1>Save a screenshot with overwrite false</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot with overwrite false
======================================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-false">
  <title>Save a screenshot with overwrite false</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-overwrite-false","detectSteps":true} -->

# Save a screenshot with overwrite false

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-overwrite-false","detectSteps":true} */}

# Save a screenshot with overwrite false

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot with overwrite false

// (test {"testId":"capture-screenshot-overwrite-false","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite false</title></head>
<body>
<!-- test {"testId":"capture-screenshot-overwrite-false","detectSteps":true} -->
<h1>Save a screenshot with overwrite false</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot with overwrite false
======================================

.. test {"testId":"capture-screenshot-overwrite-false","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-false">
  <title>Save a screenshot with overwrite false</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-overwrite-false","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-overwrite-false","detectSteps":false} -->

# Save a screenshot with overwrite false

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-overwrite-false","detectSteps":false} */}

# Save a screenshot with overwrite false

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot with overwrite false

// (test {"testId":"capture-screenshot-overwrite-false","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite false</title></head>
<body>
<!-- test {"testId":"capture-screenshot-overwrite-false","detectSteps":false} -->
<h1>Save a screenshot with overwrite false</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot with overwrite false
======================================

.. test {"testId":"capture-screenshot-overwrite-false","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-false">
  <title>Save a screenshot with overwrite false</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-overwrite-false","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"overwrite-false.png","directory":".dd-output","overwrite":"false"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-overwrite-false",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": {
            "path": "overwrite-false.png",
            "directory": ".dd-output",
            "overwrite": "false"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-overwrite-false
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot:
          path: overwrite-false.png
          directory: .dd-output
          overwrite: "false"
```

### `overwrite: "aboveVariation"`

**Varies:** `screenshot.overwrite` · **Value:** `"aboveVariation"` · **Effect:** replaces the saved image only when the new one differs by more than `maxVariation`.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot with overwrite aboveVariation

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot with overwrite aboveVariation

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot with overwrite aboveVariation

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite aboveVariation</title></head>
<body>
<h1>Save a screenshot with overwrite aboveVariation</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot with overwrite aboveVariation
===============================================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-abovevariation">
  <title>Save a screenshot with overwrite aboveVariation</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":true} -->

# Save a screenshot with overwrite aboveVariation

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":true} */}

# Save a screenshot with overwrite aboveVariation

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot with overwrite aboveVariation

// (test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite aboveVariation</title></head>
<body>
<!-- test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":true} -->
<h1>Save a screenshot with overwrite aboveVariation</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot with overwrite aboveVariation
===============================================

.. test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-abovevariation">
  <title>Save a screenshot with overwrite aboveVariation</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":false} -->

# Save a screenshot with overwrite aboveVariation

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":false} */}

# Save a screenshot with overwrite aboveVariation

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot with overwrite aboveVariation

// (test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot with overwrite aboveVariation</title></head>
<body>
<!-- test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":false} -->
<h1>Save a screenshot with overwrite aboveVariation</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot with overwrite aboveVariation
===============================================

.. test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-overwrite-abovevariation">
  <title>Save a screenshot with overwrite aboveVariation</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-overwrite-abovevariation","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"overwrite-aboveVariation.png","directory":".dd-output","overwrite":"aboveVariation"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-overwrite-abovevariation",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": {
            "path": "overwrite-aboveVariation.png",
            "directory": ".dd-output",
            "overwrite": "aboveVariation"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-overwrite-abovevariation
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot:
          path: overwrite-aboveVariation.png
          directory: .dd-output
          overwrite: aboveVariation
```

### `maxVariation: 0.01`

**Varies:** `screenshot.maxVariation` · **Value:** `0.01` · **Effect:** warns when more than 1% of the pixels differ from the saved image.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Compare a screenshot with low tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Compare a screenshot with low tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Compare a screenshot with low tolerance

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with low tolerance</title></head>
<body>
<h1>Compare a screenshot with low tolerance</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Compare a screenshot with low tolerance
=======================================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-maxvariation-low">
  <title>Compare a screenshot with low tolerance</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-maxvariation-low","detectSteps":true} -->

# Compare a screenshot with low tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-maxvariation-low","detectSteps":true} */}

# Compare a screenshot with low tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Compare a screenshot with low tolerance

// (test {"testId":"capture-screenshot-maxvariation-low","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with low tolerance</title></head>
<body>
<!-- test {"testId":"capture-screenshot-maxvariation-low","detectSteps":true} -->
<h1>Compare a screenshot with low tolerance</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Compare a screenshot with low tolerance
=======================================

.. test {"testId":"capture-screenshot-maxvariation-low","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-maxvariation-low">
  <title>Compare a screenshot with low tolerance</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-maxvariation-low","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-maxvariation-low","detectSteps":false} -->

# Compare a screenshot with low tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-maxvariation-low","detectSteps":false} */}

# Compare a screenshot with low tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Compare a screenshot with low tolerance

// (test {"testId":"capture-screenshot-maxvariation-low","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with low tolerance</title></head>
<body>
<!-- test {"testId":"capture-screenshot-maxvariation-low","detectSteps":false} -->
<h1>Compare a screenshot with low tolerance</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Compare a screenshot with low tolerance
=======================================

.. test {"testId":"capture-screenshot-maxvariation-low","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-maxvariation-low">
  <title>Compare a screenshot with low tolerance</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-maxvariation-low","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"maxvariation-low.png","directory":".dd-output","maxVariation":0.01,"overwrite":"aboveVariation"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-maxvariation-low",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": {
            "path": "maxvariation-low.png",
            "directory": ".dd-output",
            "maxVariation": 0.01,
            "overwrite": "aboveVariation"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-maxvariation-low
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot:
          path: maxvariation-low.png
          directory: .dd-output
          maxVariation: 0.01
          overwrite: aboveVariation
```

### `maxVariation: 0.5`

**Varies:** `screenshot.maxVariation` · **Value:** `0.5` · **Effect:** warns only when more than half of the pixels differ from the saved image.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Compare a screenshot with high tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Compare a screenshot with high tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Compare a screenshot with high tolerance

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with high tolerance</title></head>
<body>
<h1>Compare a screenshot with high tolerance</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Compare a screenshot with high tolerance
========================================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-maxvariation-high">
  <title>Compare a screenshot with high tolerance</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-maxvariation-high","detectSteps":true} -->

# Compare a screenshot with high tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-maxvariation-high","detectSteps":true} */}

# Compare a screenshot with high tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Compare a screenshot with high tolerance

// (test {"testId":"capture-screenshot-maxvariation-high","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with high tolerance</title></head>
<body>
<!-- test {"testId":"capture-screenshot-maxvariation-high","detectSteps":true} -->
<h1>Compare a screenshot with high tolerance</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Compare a screenshot with high tolerance
========================================

.. test {"testId":"capture-screenshot-maxvariation-high","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-maxvariation-high">
  <title>Compare a screenshot with high tolerance</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-maxvariation-high","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-maxvariation-high","detectSteps":false} -->

# Compare a screenshot with high tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   <!-- step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-maxvariation-high","detectSteps":false} */}

# Compare a screenshot with high tolerance

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   {/* step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Compare a screenshot with high tolerance

// (test {"testId":"capture-screenshot-maxvariation-high","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
// (step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with high tolerance</title></head>
<body>
<!-- test {"testId":"capture-screenshot-maxvariation-high","detectSteps":false} -->
<h1>Compare a screenshot with high tolerance</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <!-- step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Compare a screenshot with high tolerance
========================================

.. test {"testId":"capture-screenshot-maxvariation-high","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-maxvariation-high">
  <title>Compare a screenshot with high tolerance</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-maxvariation-high","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"maxvariation-high.png","directory":".dd-output","maxVariation":0.5,"overwrite":"aboveVariation"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-maxvariation-high",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": {
            "path": "maxvariation-high.png",
            "directory": ".dd-output",
            "maxVariation": 0.5,
            "overwrite": "aboveVariation"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-maxvariation-high
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot:
          path: maxvariation-high.png
          directory: .dd-output
          maxVariation: 0.5
          overwrite: aboveVariation
```

### `crop` as a string

**Varies:** `screenshot.crop` · **Value:** `"#submit-button"` · **Effect:** saves only the element that matches the selector or display text.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot of one button

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The **Submit by ID** button is at the top of the form.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot of one button

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The **Submit by ID** button is at the top of the form.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot of one button

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
. The *Submit by ID* button is at the top of the form.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button</title></head>
<body>
<h1>Save a screenshot of one button</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.</li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot of one button
===============================

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

#. The **Submit by ID** button is at the top of the form.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-string">
  <title>Save a screenshot of one button</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-crop-string","detectSteps":true} -->

# Save a screenshot of one button

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The **Submit by ID** button is at the top of the form.
   <!-- step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-crop-string","detectSteps":true} */}

# Save a screenshot of one button

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The **Submit by ID** button is at the top of the form.
   {/* step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot of one button

// (test {"testId":"capture-screenshot-crop-string","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The *Submit by ID* button is at the top of the form.
+
// (step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button</title></head>
<body>
<!-- test {"testId":"capture-screenshot-crop-string","detectSteps":true} -->
<h1>Save a screenshot of one button</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.
    <!-- step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot of one button
===============================

.. test {"testId":"capture-screenshot-crop-string","detectSteps":true}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The **Submit by ID** button is at the top of the form.

   .. step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-string">
  <title>Save a screenshot of one button</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-crop-string","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-crop-string","detectSteps":false} -->

# Save a screenshot of one button

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The **Submit by ID** button is at the top of the form.
   <!-- step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-crop-string","detectSteps":false} */}

# Save a screenshot of one button

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The **Submit by ID** button is at the top of the form.
   {/* step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot of one button

// (test {"testId":"capture-screenshot-crop-string","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The *Submit by ID* button is at the top of the form.
+
// (step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button</title></head>
<body>
<!-- test {"testId":"capture-screenshot-crop-string","detectSteps":false} -->
<h1>Save a screenshot of one button</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.
    <!-- step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot of one button
===============================

.. test {"testId":"capture-screenshot-crop-string","detectSteps":false}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The **Submit by ID** button is at the top of the form.

   .. step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-string">
  <title>Save a screenshot of one button</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-crop-string","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"crop-string.png","directory":".dd-output","overwrite":"true","crop":"#submit-button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-crop-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "screenshot": {
            "path": "crop-string.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "crop": "#submit-button"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-crop-string
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - screenshot:
          path: crop-string.png
          directory: .dd-output
          overwrite: "true"
          crop: "#submit-button"
```

### `crop.padding` as a number

**Varies:** `screenshot.crop.padding` · **Value:** `10` · **Effect:** adds 10 pixels on every side of the element.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot of one button with even padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The **Submit by ID** button is at the top of the form.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot of one button with even padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The **Submit by ID** button is at the top of the form.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot of one button with even padding

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
. The *Submit by ID* button is at the top of the form.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button with even padding</title></head>
<body>
<h1>Save a screenshot of one button with even padding</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.</li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot of one button with even padding
=================================================

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

#. The **Submit by ID** button is at the top of the form.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-padding-number">
  <title>Save a screenshot of one button with even padding</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-crop-padding-number","detectSteps":true} -->

# Save a screenshot of one button with even padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The **Submit by ID** button is at the top of the form.
   <!-- step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-crop-padding-number","detectSteps":true} */}

# Save a screenshot of one button with even padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The **Submit by ID** button is at the top of the form.
   {/* step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot of one button with even padding

// (test {"testId":"capture-screenshot-crop-padding-number","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The *Submit by ID* button is at the top of the form.
+
// (step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button with even padding</title></head>
<body>
<!-- test {"testId":"capture-screenshot-crop-padding-number","detectSteps":true} -->
<h1>Save a screenshot of one button with even padding</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.
    <!-- step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot of one button with even padding
=================================================

.. test {"testId":"capture-screenshot-crop-padding-number","detectSteps":true}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The **Submit by ID** button is at the top of the form.

   .. step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-padding-number">
  <title>Save a screenshot of one button with even padding</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-crop-padding-number","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-crop-padding-number","detectSteps":false} -->

# Save a screenshot of one button with even padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The **Submit by ID** button is at the top of the form.
   <!-- step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-crop-padding-number","detectSteps":false} */}

# Save a screenshot of one button with even padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The **Submit by ID** button is at the top of the form.
   {/* step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot of one button with even padding

// (test {"testId":"capture-screenshot-crop-padding-number","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The *Submit by ID* button is at the top of the form.
+
// (step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button with even padding</title></head>
<body>
<!-- test {"testId":"capture-screenshot-crop-padding-number","detectSteps":false} -->
<h1>Save a screenshot of one button with even padding</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.
    <!-- step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot of one button with even padding
=================================================

.. test {"testId":"capture-screenshot-crop-padding-number","detectSteps":false}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The **Submit by ID** button is at the top of the form.

   .. step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-padding-number">
  <title>Save a screenshot of one button with even padding</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-crop-padding-number","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"crop-padding-number.png","directory":".dd-output","overwrite":"true","crop":{"selector":"#submit-button","padding":10}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-crop-padding-number",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "screenshot": {
            "path": "crop-padding-number.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "crop": {
              "selector": "#submit-button",
              "padding": 10
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-crop-padding-number
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - screenshot:
          path: crop-padding-number.png
          directory: .dd-output
          overwrite: "true"
          crop:
            selector: "#submit-button"
            padding: 10
```

### `crop.padding` as an object

**Varies:** `screenshot.crop.padding` · **Value:** `{ "top": 8, "right": 16, "bottom": 8, "left": 16 }` · **Effect:** adds a different amount of space on each side of the element.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot of one button with uneven padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The **Submit by ID** button is at the top of the form.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot of one button with uneven padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
2. The **Submit by ID** button is at the top of the form.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot of one button with uneven padding

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
. The *Submit by ID* button is at the top of the form.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button with uneven padding</title></head>
<body>
<h1>Save a screenshot of one button with uneven padding</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.</li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot of one button with uneven padding
===================================================

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

#. The **Submit by ID** button is at the top of the form.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-padding-object">
  <title>Save a screenshot of one button with uneven padding</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-crop-padding-object","detectSteps":true} -->

# Save a screenshot of one button with uneven padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The **Submit by ID** button is at the top of the form.
   <!-- step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-crop-padding-object","detectSteps":true} */}

# Save a screenshot of one button with uneven padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The **Submit by ID** button is at the top of the form.
   {/* step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot of one button with uneven padding

// (test {"testId":"capture-screenshot-crop-padding-object","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The *Submit by ID* button is at the top of the form.
+
// (step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button with uneven padding</title></head>
<body>
<!-- test {"testId":"capture-screenshot-crop-padding-object","detectSteps":true} -->
<h1>Save a screenshot of one button with uneven padding</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.
    <!-- step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot of one button with uneven padding
===================================================

.. test {"testId":"capture-screenshot-crop-padding-object","detectSteps":true}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The **Submit by ID** button is at the top of the form.

   .. step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-padding-object">
  <title>Save a screenshot of one button with uneven padding</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-crop-padding-object","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-crop-padding-object","detectSteps":false} -->

# Save a screenshot of one button with uneven padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. The **Submit by ID** button is at the top of the form.
   <!-- step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-crop-padding-object","detectSteps":false} */}

# Save a screenshot of one button with uneven padding

1. Go to [the sample form](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. The **Submit by ID** button is at the top of the form.
   {/* step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot of one button with uneven padding

// (test {"testId":"capture-screenshot-crop-padding-object","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the sample form].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. The *Submit by ID* button is at the top of the form.
+
// (step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of one button with uneven padding</title></head>
<body>
<!-- test {"testId":"capture-screenshot-crop-padding-object","detectSteps":false} -->
<h1>Save a screenshot of one button with uneven padding</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the sample form</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>The <strong>Submit by ID</strong> button is at the top of the form.
    <!-- step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot of one button with uneven padding
===================================================

.. test {"testId":"capture-screenshot-crop-padding-object","detectSteps":false}

#. Go to `the sample form <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. The **Submit by ID** button is at the top of the form.

   .. step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-crop-padding-object">
  <title>Save a screenshot of one button with uneven padding</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-crop-padding-object","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the sample form</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>The <b>Submit by ID</b> button is at the top of the form.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"crop-padding-object.png","directory":".dd-output","overwrite":"true","crop":{"elementText":"Submit by ID","padding":{"top":8,"right":16,"bottom":8,"left":16}}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-crop-padding-object",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "screenshot": {
            "path": "crop-padding-object.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "crop": {
              "elementText": "Submit by ID",
              "padding": {
                "top": 8,
                "right": 16,
                "bottom": 8,
                "left": 16
              }
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-crop-padding-object
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - screenshot:
          path: crop-padding-object.png
          directory: .dd-output
          overwrite: "true"
          crop:
            elementText: Submit by ID
            padding:
              top: 8
              right: 16
              bottom: 8
              left: 16
```

### `fullPage: true`

**Varies:** `screenshot.fullPage` · **Value:** `true` · **Effect:** saves the whole page, including the parts you scroll to.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot of a long page with fullPage true

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
2. The page ends with a red box at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot of a long page with fullPage true

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
2. The page ends with a red box at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot of a long page with fullPage true

. Open the page at `http://localhost:8092/screenshot-tall.html`.
. The page ends with a red box at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of a long page with fullPage true</title></head>
<body>
<h1>Save a screenshot of a long page with fullPage true</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-tall.html</code>.</li>
  <li>The page ends with a red box at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot of a long page with fullPage true
===================================================

#. Open the page at ``http://localhost:8092/screenshot-tall.html``.

#. The page ends with a red box at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-fullpage-true">
  <title>Save a screenshot of a long page with fullPage true</title>
  <taskbody>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-tall.html</codeph>.</cmd></step>
      <step><cmd>The page ends with a red box at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-fullpage-true","detectSteps":true} -->

# Save a screenshot of a long page with fullPage true

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. The page ends with a red box at the bottom.
   <!-- step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-fullpage-true","detectSteps":true} */}

# Save a screenshot of a long page with fullPage true

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. The page ends with a red box at the bottom.
   {/* step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot of a long page with fullPage true

// (test {"testId":"capture-screenshot-fullpage-true","detectSteps":true})

. Open the page at `http://localhost:8092/screenshot-tall.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. The page ends with a red box at the bottom.
+
// (step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of a long page with fullPage true</title></head>
<body>
<!-- test {"testId":"capture-screenshot-fullpage-true","detectSteps":true} -->
<h1>Save a screenshot of a long page with fullPage true</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-tall.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>The page ends with a red box at the bottom.
    <!-- step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot of a long page with fullPage true
===================================================

.. test {"testId":"capture-screenshot-fullpage-true","detectSteps":true}

#. Open the page at ``http://localhost:8092/screenshot-tall.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. The page ends with a red box at the bottom.

   .. step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-fullpage-true">
  <title>Save a screenshot of a long page with fullPage true</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-fullpage-true","detectSteps":true}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-tall.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>The page ends with a red box at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-fullpage-true","detectSteps":false} -->

# Save a screenshot of a long page with fullPage true

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. The page ends with a red box at the bottom.
   <!-- step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-fullpage-true","detectSteps":false} */}

# Save a screenshot of a long page with fullPage true

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. The page ends with a red box at the bottom.
   {/* step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot of a long page with fullPage true

// (test {"testId":"capture-screenshot-fullpage-true","detectSteps":false})

. Open the page at `http://localhost:8092/screenshot-tall.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. The page ends with a red box at the bottom.
+
// (step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of a long page with fullPage true</title></head>
<body>
<!-- test {"testId":"capture-screenshot-fullpage-true","detectSteps":false} -->
<h1>Save a screenshot of a long page with fullPage true</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-tall.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>The page ends with a red box at the bottom.
    <!-- step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot of a long page with fullPage true
===================================================

.. test {"testId":"capture-screenshot-fullpage-true","detectSteps":false}

#. Open the page at ``http://localhost:8092/screenshot-tall.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. The page ends with a red box at the bottom.

   .. step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-fullpage-true">
  <title>Save a screenshot of a long page with fullPage true</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-fullpage-true","detectSteps":false}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-tall.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>The page ends with a red box at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"fullpage-true.png","directory":".dd-output","overwrite":"true","fullPage":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-fullpage-true",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/screenshot-tall.html",
            "waitUntil": {
              "networkIdleTime": 0,
              "domIdleTime": 0
            }
          }
        },
        {
          "screenshot": {
            "path": "fullpage-true.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "fullPage": true
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-fullpage-true
    steps:
      - goTo:
          url: http://localhost:8092/screenshot-tall.html
          waitUntil:
            networkIdleTime: 0
            domIdleTime: 0
      - screenshot:
          path: fullpage-true.png
          directory: .dd-output
          overwrite: "true"
          fullPage: true
```

### `fullPage: false`

**Varies:** `screenshot.fullPage` · **Value:** `false` · **Effect:** saves only what fits in the viewport.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot of a long page with fullPage false

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
2. The page ends with a red box at the bottom.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot of a long page with fullPage false

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
2. The page ends with a red box at the bottom.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot of a long page with fullPage false

. Open the page at `http://localhost:8092/screenshot-tall.html`.
. The page ends with a red box at the bottom.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of a long page with fullPage false</title></head>
<body>
<h1>Save a screenshot of a long page with fullPage false</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-tall.html</code>.</li>
  <li>The page ends with a red box at the bottom.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot of a long page with fullPage false
====================================================

#. Open the page at ``http://localhost:8092/screenshot-tall.html``.

#. The page ends with a red box at the bottom.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-fullpage-false">
  <title>Save a screenshot of a long page with fullPage false</title>
  <taskbody>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-tall.html</codeph>.</cmd></step>
      <step><cmd>The page ends with a red box at the bottom.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-fullpage-false","detectSteps":true} -->

# Save a screenshot of a long page with fullPage false

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. The page ends with a red box at the bottom.
   <!-- step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-fullpage-false","detectSteps":true} */}

# Save a screenshot of a long page with fullPage false

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. The page ends with a red box at the bottom.
   {/* step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot of a long page with fullPage false

// (test {"testId":"capture-screenshot-fullpage-false","detectSteps":true})

. Open the page at `http://localhost:8092/screenshot-tall.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. The page ends with a red box at the bottom.
+
// (step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of a long page with fullPage false</title></head>
<body>
<!-- test {"testId":"capture-screenshot-fullpage-false","detectSteps":true} -->
<h1>Save a screenshot of a long page with fullPage false</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-tall.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>The page ends with a red box at the bottom.
    <!-- step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot of a long page with fullPage false
====================================================

.. test {"testId":"capture-screenshot-fullpage-false","detectSteps":true}

#. Open the page at ``http://localhost:8092/screenshot-tall.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. The page ends with a red box at the bottom.

   .. step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-fullpage-false">
  <title>Save a screenshot of a long page with fullPage false</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-fullpage-false","detectSteps":true}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-tall.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>The page ends with a red box at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-fullpage-false","detectSteps":false} -->

# Save a screenshot of a long page with fullPage false

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. The page ends with a red box at the bottom.
   <!-- step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-fullpage-false","detectSteps":false} */}

# Save a screenshot of a long page with fullPage false

1. Open the page at `http://localhost:8092/screenshot-tall.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. The page ends with a red box at the bottom.
   {/* step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot of a long page with fullPage false

// (test {"testId":"capture-screenshot-fullpage-false","detectSteps":false})

. Open the page at `http://localhost:8092/screenshot-tall.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. The page ends with a red box at the bottom.
+
// (step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of a long page with fullPage false</title></head>
<body>
<!-- test {"testId":"capture-screenshot-fullpage-false","detectSteps":false} -->
<h1>Save a screenshot of a long page with fullPage false</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-tall.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>The page ends with a red box at the bottom.
    <!-- step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot of a long page with fullPage false
====================================================

.. test {"testId":"capture-screenshot-fullpage-false","detectSteps":false}

#. Open the page at ``http://localhost:8092/screenshot-tall.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. The page ends with a red box at the bottom.

   .. step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-fullpage-false">
  <title>Save a screenshot of a long page with fullPage false</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-fullpage-false","detectSteps":false}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-tall.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-tall.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>The page ends with a red box at the bottom.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"fullpage-false.png","directory":".dd-output","overwrite":"true","fullPage":false}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-fullpage-false",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/screenshot-tall.html",
            "waitUntil": {
              "networkIdleTime": 0,
              "domIdleTime": 0
            }
          }
        },
        {
          "screenshot": {
            "path": "fullpage-false.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "fullPage": false
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-fullpage-false
    steps:
      - goTo:
          url: http://localhost:8092/screenshot-tall.html
          waitUntil:
            networkIdleTime: 0
            domIdleTime: 0
      - screenshot:
          path: fullpage-false.png
          directory: .dd-output
          overwrite: "true"
          fullPage: false
```

### `mask` with strings

**Varies:** `screenshot.mask` · **Value:** `["#clock", "#stamps"]` · **Effect:** hides the first match of each selector in both images before comparing, so the times don't count.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Compare a screenshot with string masks

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Compare a screenshot with string masks

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Compare a screenshot with string masks

. Go to http://localhost:8092/mask.html[the billing page].
. The page shows the next invoice date and when the account last synced.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with string masks</title></head>
<body>
<h1>Compare a screenshot with string masks</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.</li>
  <li>The page shows the next invoice date and when the account last synced.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Compare a screenshot with string masks
======================================

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

#. The page shows the next invoice date and when the account last synced.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-string">
  <title>Compare a screenshot with string masks</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-mask-string","detectSteps":true} -->

# Compare a screenshot with string masks

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced.
   <!-- step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-mask-string","detectSteps":true} */}

# Compare a screenshot with string masks

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced.
   {/* step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Compare a screenshot with string masks

// (test {"testId":"capture-screenshot-mask-string","detectSteps":true})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced.
+
// (step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with string masks</title></head>
<body>
<!-- test {"testId":"capture-screenshot-mask-string","detectSteps":true} -->
<h1>Compare a screenshot with string masks</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced.
    <!-- step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Compare a screenshot with string masks
======================================

.. test {"testId":"capture-screenshot-mask-string","detectSteps":true}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced.

   .. step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-string">
  <title>Compare a screenshot with string masks</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-mask-string","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-mask-string","detectSteps":false} -->

# Compare a screenshot with string masks

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced.
   <!-- step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-mask-string","detectSteps":false} */}

# Compare a screenshot with string masks

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced.
   {/* step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Compare a screenshot with string masks

// (test {"testId":"capture-screenshot-mask-string","detectSteps":false})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced.
+
// (step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with string masks</title></head>
<body>
<!-- test {"testId":"capture-screenshot-mask-string","detectSteps":false} -->
<h1>Compare a screenshot with string masks</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced.
    <!-- step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Compare a screenshot with string masks
======================================

.. test {"testId":"capture-screenshot-mask-string","detectSteps":false}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced.

   .. step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-string">
  <title>Compare a screenshot with string masks</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-mask-string","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"mask-string.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":["#clock","#stamps"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-mask-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/mask.html"
        },
        {
          "screenshot": {
            "path": "mask-string.png",
            "directory": ".dd-output",
            "maxVariation": 0.001,
            "overwrite": "aboveVariation",
            "mask": [
              "#clock",
              "#stamps"
            ]
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-mask-string
    steps:
      - goTo: http://localhost:8092/mask.html
      - screenshot:
          path: mask-string.png
          directory: .dd-output
          maxVariation: 0.001
          overwrite: aboveVariation
          mask:
            - "#clock"
            - "#stamps"
```

### `mask` with an element object

**Varies:** `screenshot.mask` · **Value:** `[{ "selector": ".stamp" }, "#clock"]` · **Effect:** hides every match of the object's selector, and the first match of the string.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Compare a screenshot with an element mask

. Go to http://localhost:8092/mask.html[the billing page].
. The page shows the next invoice date and when the account last synced.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with an element mask</title></head>
<body>
<h1>Compare a screenshot with an element mask</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.</li>
  <li>The page shows the next invoice date and when the account last synced.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Compare a screenshot with an element mask
=========================================

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

#. The page shows the next invoice date and when the account last synced.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-object">
  <title>Compare a screenshot with an element mask</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-mask-object","detectSteps":true} -->

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced.
   <!-- step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-mask-object","detectSteps":true} */}

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced.
   {/* step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Compare a screenshot with an element mask

// (test {"testId":"capture-screenshot-mask-object","detectSteps":true})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced.
+
// (step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with an element mask</title></head>
<body>
<!-- test {"testId":"capture-screenshot-mask-object","detectSteps":true} -->
<h1>Compare a screenshot with an element mask</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced.
    <!-- step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Compare a screenshot with an element mask
=========================================

.. test {"testId":"capture-screenshot-mask-object","detectSteps":true}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced.

   .. step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-object">
  <title>Compare a screenshot with an element mask</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-mask-object","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-mask-object","detectSteps":false} -->

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced.
   <!-- step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-mask-object","detectSteps":false} */}

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced.
   {/* step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Compare a screenshot with an element mask

// (test {"testId":"capture-screenshot-mask-object","detectSteps":false})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced.
+
// (step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with an element mask</title></head>
<body>
<!-- test {"testId":"capture-screenshot-mask-object","detectSteps":false} -->
<h1>Compare a screenshot with an element mask</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced.
    <!-- step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Compare a screenshot with an element mask
=========================================

.. test {"testId":"capture-screenshot-mask-object","detectSteps":false}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced.

   .. step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-object">
  <title>Compare a screenshot with an element mask</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-mask-object","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"mask-object.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"selector":".stamp"},"#clock"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-mask-object",
      "steps": [
        {
          "goTo": "http://localhost:8092/mask.html"
        },
        {
          "screenshot": {
            "path": "mask-object.png",
            "directory": ".dd-output",
            "maxVariation": 0.001,
            "overwrite": "aboveVariation",
            "mask": [
              {
                "selector": ".stamp"
              },
              "#clock"
            ]
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-mask-object
    steps:
      - goTo: http://localhost:8092/mask.html
      - screenshot:
          path: mask-object.png
          directory: .dd-output
          maxVariation: 0.001
          overwrite: aboveVariation
          mask:
            - selector: .stamp
            - "#clock"
```

### `mask` with `elementClass`

**Varies:** `screenshot.mask` · **Value:** `[{ "elementClass": "stamp" }, "#clock"]` · **Effect:** hides every element with the `stamp` class, and the first match of the string. A mask object takes the same locator fields as `find`.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
2. The page shows the next invoice date and when the account last synced.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Compare a screenshot with an element mask

. Go to http://localhost:8092/mask.html[the billing page].
. The page shows the next invoice date and when the account last synced.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with an element mask</title></head>
<body>
<h1>Compare a screenshot with an element mask</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.</li>
  <li>The page shows the next invoice date and when the account last synced.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Compare a screenshot with an element mask
=========================================

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

#. The page shows the next invoice date and when the account last synced.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-elementclass">
  <title>Compare a screenshot with an element mask</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-mask-elementclass","detectSteps":true} -->

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced.
   <!-- step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-mask-elementclass","detectSteps":true} */}

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced.
   {/* step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Compare a screenshot with an element mask

// (test {"testId":"capture-screenshot-mask-elementclass","detectSteps":true})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced.
+
// (step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with an element mask</title></head>
<body>
<!-- test {"testId":"capture-screenshot-mask-elementclass","detectSteps":true} -->
<h1>Compare a screenshot with an element mask</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced.
    <!-- step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Compare a screenshot with an element mask
=========================================

.. test {"testId":"capture-screenshot-mask-elementclass","detectSteps":true}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced.

   .. step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-elementclass">
  <title>Compare a screenshot with an element mask</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-mask-elementclass","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-mask-elementclass","detectSteps":false} -->

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   <!-- step {"goTo":"http://localhost:8092/mask.html"} -->
2. The page shows the next invoice date and when the account last synced.
   <!-- step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-mask-elementclass","detectSteps":false} */}

# Compare a screenshot with an element mask

1. Go to [the billing page](http://localhost:8092/mask.html).
   {/* step {"goTo":"http://localhost:8092/mask.html"} */}
2. The page shows the next invoice date and when the account last synced.
   {/* step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Compare a screenshot with an element mask

// (test {"testId":"capture-screenshot-mask-elementclass","detectSteps":false})

. Go to http://localhost:8092/mask.html[the billing page].
+
// (step {"goTo":"http://localhost:8092/mask.html"})
. The page shows the next invoice date and when the account last synced.
+
// (step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Compare a screenshot with an element mask</title></head>
<body>
<!-- test {"testId":"capture-screenshot-mask-elementclass","detectSteps":false} -->
<h1>Compare a screenshot with an element mask</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/mask.html">the billing page</a>.
    <!-- step {"goTo":"http://localhost:8092/mask.html"} --></li>
  <li>The page shows the next invoice date and when the account last synced.
    <!-- step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Compare a screenshot with an element mask
=========================================

.. test {"testId":"capture-screenshot-mask-elementclass","detectSteps":false}

#. Go to `the billing page <http://localhost:8092/mask.html>`_.

   .. step {"goTo":"http://localhost:8092/mask.html"}

#. The page shows the next invoice date and when the account last synced.

   .. step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-mask-elementclass">
  <title>Compare a screenshot with an element mask</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-mask-elementclass","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/mask.html" scope="external" format="html">the billing page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/mask.html"}'/></info></step>
      <step><cmd>The page shows the next invoice date and when the account last synced.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"mask-elementclass.png","directory":".dd-output","maxVariation":0.001,"overwrite":"aboveVariation","mask":[{"elementClass":"stamp"},"#clock"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-mask-elementclass",
      "steps": [
        {
          "goTo": "http://localhost:8092/mask.html"
        },
        {
          "screenshot": {
            "path": "mask-elementclass.png",
            "directory": ".dd-output",
            "maxVariation": 0.001,
            "overwrite": "aboveVariation",
            "mask": [
              {
                "elementClass": "stamp"
              },
              "#clock"
            ]
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-mask-elementclass
    steps:
      - goTo: http://localhost:8092/mask.html
      - screenshot:
          path: mask-elementclass.png
          directory: .dd-output
          maxVariation: 0.001
          overwrite: aboveVariation
          mask:
            - elementClass: stamp
            - "#clock"
```

### `stable: true`

**Varies:** `screenshot.stable` · **Value:** `true` · **Effect:** takes screenshots until two in a row match, so the loading bar has finished.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Wait for a page to settle before the screenshot

1. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
2. A loading bar fills, then the page shows its content.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Wait for a page to settle before the screenshot

1. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
2. A loading bar fills, then the page shows its content.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Wait for a page to settle before the screenshot

. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
. A loading bar fills, then the page shows its content.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for a page to settle before the screenshot</title></head>
<body>
<h1>Wait for a page to settle before the screenshot</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-late-reveal.html</code>.</li>
  <li>A loading bar fills, then the page shows its content.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Wait for a page to settle before the screenshot
===============================================

#. Open the page at ``http://localhost:8092/screenshot-late-reveal.html``.

#. A loading bar fills, then the page shows its content.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-stable-true">
  <title>Wait for a page to settle before the screenshot</title>
  <taskbody>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-late-reveal.html</codeph>.</cmd></step>
      <step><cmd>A loading bar fills, then the page shows its content.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-stable-true","detectSteps":true} -->

# Wait for a page to settle before the screenshot

1. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. A loading bar fills, then the page shows its content.
   <!-- step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-stable-true","detectSteps":true} */}

# Wait for a page to settle before the screenshot

1. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. A loading bar fills, then the page shows its content.
   {/* step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Wait for a page to settle before the screenshot

// (test {"testId":"capture-screenshot-stable-true","detectSteps":true})

. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. A loading bar fills, then the page shows its content.
+
// (step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for a page to settle before the screenshot</title></head>
<body>
<!-- test {"testId":"capture-screenshot-stable-true","detectSteps":true} -->
<h1>Wait for a page to settle before the screenshot</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-late-reveal.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>A loading bar fills, then the page shows its content.
    <!-- step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Wait for a page to settle before the screenshot
===============================================

.. test {"testId":"capture-screenshot-stable-true","detectSteps":true}

#. Open the page at ``http://localhost:8092/screenshot-late-reveal.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. A loading bar fills, then the page shows its content.

   .. step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-stable-true">
  <title>Wait for a page to settle before the screenshot</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-stable-true","detectSteps":true}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-late-reveal.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>A loading bar fills, then the page shows its content.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-stable-true","detectSteps":false} -->

# Wait for a page to settle before the screenshot

1. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. A loading bar fills, then the page shows its content.
   <!-- step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-stable-true","detectSteps":false} */}

# Wait for a page to settle before the screenshot

1. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. A loading bar fills, then the page shows its content.
   {/* step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Wait for a page to settle before the screenshot

// (test {"testId":"capture-screenshot-stable-true","detectSteps":false})

. Open the page at `http://localhost:8092/screenshot-late-reveal.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. A loading bar fills, then the page shows its content.
+
// (step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for a page to settle before the screenshot</title></head>
<body>
<!-- test {"testId":"capture-screenshot-stable-true","detectSteps":false} -->
<h1>Wait for a page to settle before the screenshot</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-late-reveal.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>A loading bar fills, then the page shows its content.
    <!-- step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Wait for a page to settle before the screenshot
===============================================

.. test {"testId":"capture-screenshot-stable-true","detectSteps":false}

#. Open the page at ``http://localhost:8092/screenshot-late-reveal.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. A loading bar fills, then the page shows its content.

   .. step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-stable-true">
  <title>Wait for a page to settle before the screenshot</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-stable-true","detectSteps":false}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-late-reveal.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-late-reveal.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>A loading bar fills, then the page shows its content.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"stable-true.png","directory":".dd-output","overwrite":"true","stable":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-stable-true",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/screenshot-late-reveal.html",
            "waitUntil": {
              "networkIdleTime": 0,
              "domIdleTime": 0
            }
          }
        },
        {
          "screenshot": {
            "path": "stable-true.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "stable": true
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-stable-true
    steps:
      - goTo:
          url: http://localhost:8092/screenshot-late-reveal.html
          waitUntil:
            networkIdleTime: 0
            domIdleTime: 0
      - screenshot:
          path: stable-true.png
          directory: .dd-output
          overwrite: "true"
          stable: true
```

### `animations: "disabled"`

**Varies:** `screenshot.animations` · **Value:** `"disabled"` · **Effect:** stops the spinner during the screenshot, so every run saves the same image.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot of an animated page with animations disabled

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
2. A spinner turns in the middle of the page.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot of an animated page with animations disabled

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
2. A spinner turns in the middle of the page.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot of an animated page with animations disabled

. Open the page at `http://localhost:8092/screenshot-loop.html`.
. A spinner turns in the middle of the page.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of an animated page with animations disabled</title></head>
<body>
<h1>Save a screenshot of an animated page with animations disabled</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-loop.html</code>.</li>
  <li>A spinner turns in the middle of the page.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot of an animated page with animations disabled
==============================================================

#. Open the page at ``http://localhost:8092/screenshot-loop.html``.

#. A spinner turns in the middle of the page.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-animations-disabled">
  <title>Save a screenshot of an animated page with animations disabled</title>
  <taskbody>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-loop.html</codeph>.</cmd></step>
      <step><cmd>A spinner turns in the middle of the page.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-animations-disabled","detectSteps":true} -->

# Save a screenshot of an animated page with animations disabled

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. A spinner turns in the middle of the page.
   <!-- step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-animations-disabled","detectSteps":true} */}

# Save a screenshot of an animated page with animations disabled

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. A spinner turns in the middle of the page.
   {/* step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot of an animated page with animations disabled

// (test {"testId":"capture-screenshot-animations-disabled","detectSteps":true})

. Open the page at `http://localhost:8092/screenshot-loop.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. A spinner turns in the middle of the page.
+
// (step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of an animated page with animations disabled</title></head>
<body>
<!-- test {"testId":"capture-screenshot-animations-disabled","detectSteps":true} -->
<h1>Save a screenshot of an animated page with animations disabled</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-loop.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>A spinner turns in the middle of the page.
    <!-- step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot of an animated page with animations disabled
==============================================================

.. test {"testId":"capture-screenshot-animations-disabled","detectSteps":true}

#. Open the page at ``http://localhost:8092/screenshot-loop.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. A spinner turns in the middle of the page.

   .. step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-animations-disabled">
  <title>Save a screenshot of an animated page with animations disabled</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-animations-disabled","detectSteps":true}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-loop.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>A spinner turns in the middle of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-animations-disabled","detectSteps":false} -->

# Save a screenshot of an animated page with animations disabled

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. A spinner turns in the middle of the page.
   <!-- step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-animations-disabled","detectSteps":false} */}

# Save a screenshot of an animated page with animations disabled

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. A spinner turns in the middle of the page.
   {/* step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot of an animated page with animations disabled

// (test {"testId":"capture-screenshot-animations-disabled","detectSteps":false})

. Open the page at `http://localhost:8092/screenshot-loop.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. A spinner turns in the middle of the page.
+
// (step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of an animated page with animations disabled</title></head>
<body>
<!-- test {"testId":"capture-screenshot-animations-disabled","detectSteps":false} -->
<h1>Save a screenshot of an animated page with animations disabled</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-loop.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>A spinner turns in the middle of the page.
    <!-- step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot of an animated page with animations disabled
==============================================================

.. test {"testId":"capture-screenshot-animations-disabled","detectSteps":false}

#. Open the page at ``http://localhost:8092/screenshot-loop.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. A spinner turns in the middle of the page.

   .. step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-animations-disabled">
  <title>Save a screenshot of an animated page with animations disabled</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-animations-disabled","detectSteps":false}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-loop.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>A spinner turns in the middle of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"animations-disabled.png","directory":".dd-output","overwrite":"true","animations":"disabled"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-animations-disabled",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/screenshot-loop.html",
            "waitUntil": {
              "networkIdleTime": 0,
              "domIdleTime": 0
            }
          }
        },
        {
          "screenshot": {
            "path": "animations-disabled.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "animations": "disabled"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-animations-disabled
    steps:
      - goTo:
          url: http://localhost:8092/screenshot-loop.html
          waitUntil:
            networkIdleTime: 0
            domIdleTime: 0
      - screenshot:
          path: animations-disabled.png
          directory: .dd-output
          overwrite: "true"
          animations: disabled
```

### `animations: "allow"`

**Varies:** `screenshot.animations` · **Value:** `"allow"` · **Effect:** leaves the spinner running, so the image shows it wherever it happens to be.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Save a screenshot of an animated page with animations allow

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
2. A spinner turns in the middle of the page.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Save a screenshot of an animated page with animations allow

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
2. A spinner turns in the middle of the page.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Save a screenshot of an animated page with animations allow

. Open the page at `http://localhost:8092/screenshot-loop.html`.
. A spinner turns in the middle of the page.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of an animated page with animations allow</title></head>
<body>
<h1>Save a screenshot of an animated page with animations allow</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-loop.html</code>.</li>
  <li>A spinner turns in the middle of the page.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Save a screenshot of an animated page with animations allow
===========================================================

#. Open the page at ``http://localhost:8092/screenshot-loop.html``.

#. A spinner turns in the middle of the page.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-animations-allow">
  <title>Save a screenshot of an animated page with animations allow</title>
  <taskbody>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-loop.html</codeph>.</cmd></step>
      <step><cmd>A spinner turns in the middle of the page.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-screenshot-animations-allow","detectSteps":true} -->

# Save a screenshot of an animated page with animations allow

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. A spinner turns in the middle of the page.
   <!-- step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-screenshot-animations-allow","detectSteps":true} */}

# Save a screenshot of an animated page with animations allow

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. A spinner turns in the middle of the page.
   {/* step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Save a screenshot of an animated page with animations allow

// (test {"testId":"capture-screenshot-animations-allow","detectSteps":true})

. Open the page at `http://localhost:8092/screenshot-loop.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. A spinner turns in the middle of the page.
+
// (step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of an animated page with animations allow</title></head>
<body>
<!-- test {"testId":"capture-screenshot-animations-allow","detectSteps":true} -->
<h1>Save a screenshot of an animated page with animations allow</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-loop.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>A spinner turns in the middle of the page.
    <!-- step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Save a screenshot of an animated page with animations allow
===========================================================

.. test {"testId":"capture-screenshot-animations-allow","detectSteps":true}

#. Open the page at ``http://localhost:8092/screenshot-loop.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. A spinner turns in the middle of the page.

   .. step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-animations-allow">
  <title>Save a screenshot of an animated page with animations allow</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-animations-allow","detectSteps":true}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-loop.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>A spinner turns in the middle of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-screenshot-animations-allow","detectSteps":false} -->

# Save a screenshot of an animated page with animations allow

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} -->
2. A spinner turns in the middle of the page.
   <!-- step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-screenshot-animations-allow","detectSteps":false} */}

# Save a screenshot of an animated page with animations allow

1. Open the page at `http://localhost:8092/screenshot-loop.html`.
   {/* step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} */}
2. A spinner turns in the middle of the page.
   {/* step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Save a screenshot of an animated page with animations allow

// (test {"testId":"capture-screenshot-animations-allow","detectSteps":false})

. Open the page at `http://localhost:8092/screenshot-loop.html`.
+
// (step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}})
. A spinner turns in the middle of the page.
+
// (step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Save a screenshot of an animated page with animations allow</title></head>
<body>
<!-- test {"testId":"capture-screenshot-animations-allow","detectSteps":false} -->
<h1>Save a screenshot of an animated page with animations allow</h1>
<ol>
  <li>Open the page at <code>http://localhost:8092/screenshot-loop.html</code>.
    <!-- step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}} --></li>
  <li>A spinner turns in the middle of the page.
    <!-- step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Save a screenshot of an animated page with animations allow
===========================================================

.. test {"testId":"capture-screenshot-animations-allow","detectSteps":false}

#. Open the page at ``http://localhost:8092/screenshot-loop.html``.

   .. step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}

#. A spinner turns in the middle of the page.

   .. step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-screenshot-animations-allow">
  <title>Save a screenshot of an animated page with animations allow</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-screenshot-animations-allow","detectSteps":false}'/>
    <steps>
      <step><cmd>Open the page at <codeph>http://localhost:8092/screenshot-loop.html</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/screenshot-loop.html","waitUntil":{"networkIdleTime":0,"domIdleTime":0}}}'/></info></step>
      <step><cmd>A spinner turns in the middle of the page.</cmd>
        <info><data name="doc-detective" value='step {"screenshot":{"path":"animations-allow.png","directory":".dd-output","overwrite":"true","animations":"allow"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-screenshot-animations-allow",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/screenshot-loop.html",
            "waitUntil": {
              "networkIdleTime": 0,
              "domIdleTime": 0
            }
          }
        },
        {
          "screenshot": {
            "path": "animations-allow.png",
            "directory": ".dd-output",
            "overwrite": "true",
            "animations": "allow"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-screenshot-animations-allow
    steps:
      - goTo:
          url: http://localhost:8092/screenshot-loop.html
          waitUntil:
            networkIdleTime: 0
            domIdleTime: 0
      - screenshot:
          path: animations-allow.png
          directory: .dd-output
          overwrite: "true"
          animations: allow
```

### An image with the `screenshot` class

**Varies:** `detection: image class` · **Value:** `screenshot` · **Effect:** default detection turns the image into a `screenshot` step that saves to the image's path.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Mark an image as a screenshot

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
   ![The banner page](.dd-output/detected-banner.png){.screenshot}
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Mark an image as a screenshot

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
2. The page opens with a cookie banner at the bottom.
   <img src=".dd-output/detected-banner.png" alt="The banner page" className="screenshot" />
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Mark an image as a screenshot

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
. The page opens with a cookie banner at the bottom.
+
image:.dd-output/detected-banner.png[The banner page,role=screenshot]
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Mark an image as a screenshot</title></head>
<body>
<h1>Mark an image as a screenshot</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.</li>
  <li>The page opens with a cookie banner at the bottom.
    <img src=".dd-output/detected-banner.png" alt="The banner page" class="screenshot"></li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Mark an image as a screenshot
=============================

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

#. The page opens with a cookie banner at the bottom.

   .. image:: .dd-output/detected-banner.png
      :alt: The banner page
      :class: screenshot
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-detect-screenshot-image">
  <title>Mark an image as a screenshot</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><image href=".dd-output/detected-banner.png" outputclass="screenshot"><alt>The banner page</alt></image></info></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"capture-detect-screenshot-image","detectSteps":true} -->

# Mark an image as a screenshot

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   ![The banner page](.dd-output/detected-banner.png){.screenshot}

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"capture-detect-screenshot-image","detectSteps":true} */}

# Mark an image as a screenshot

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   <img src=".dd-output/detected-banner.png" alt="The banner page" className="screenshot" />

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Mark an image as a screenshot

// (test {"testId":"capture-detect-screenshot-image","detectSteps":true})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
image:.dd-output/detected-banner.png[The banner page,role=screenshot]

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Mark an image as a screenshot</title></head>
<body>
<!-- test {"testId":"capture-detect-screenshot-image","detectSteps":true} -->
<h1>Mark an image as a screenshot</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <img src=".dd-output/detected-banner.png" alt="The banner page" class="screenshot"></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Mark an image as a screenshot
=============================

.. test {"testId":"capture-detect-screenshot-image","detectSteps":true}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. image:: .dd-output/detected-banner.png
      :alt: The banner page
      :class: screenshot

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-detect-screenshot-image">
  <title>Mark an image as a screenshot</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-detect-screenshot-image","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><image href=".dd-output/detected-banner.png" outputclass="screenshot"><alt>The banner page</alt></image></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"capture-detect-screenshot-image","detectSteps":false} -->

# Mark an image as a screenshot

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} -->
2. The page opens with a cookie banner at the bottom.
   ![The banner page](.dd-output/detected-banner.png){.screenshot}
   <!-- step {"screenshot":".dd-output/detected-banner.png"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"capture-detect-screenshot-image","detectSteps":false} */}

# Mark an image as a screenshot

1. Go to [the banner page](http://localhost:8092/screenshot-banner.html).
   {/* step {"goTo":"http://localhost:8092/screenshot-banner.html"} */}
2. The page opens with a cookie banner at the bottom.
   <img src=".dd-output/detected-banner.png" alt="The banner page" className="screenshot" />
   {/* step {"screenshot":".dd-output/detected-banner.png"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Mark an image as a screenshot

// (test {"testId":"capture-detect-screenshot-image","detectSteps":false})

. Go to http://localhost:8092/screenshot-banner.html[the banner page].
+
// (step {"goTo":"http://localhost:8092/screenshot-banner.html"})
. The page opens with a cookie banner at the bottom.
+
image:.dd-output/detected-banner.png[The banner page,role=screenshot]
+
// (step {"screenshot":".dd-output/detected-banner.png"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Mark an image as a screenshot</title></head>
<body>
<!-- test {"testId":"capture-detect-screenshot-image","detectSteps":false} -->
<h1>Mark an image as a screenshot</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/screenshot-banner.html">the banner page</a>.
    <!-- step {"goTo":"http://localhost:8092/screenshot-banner.html"} --></li>
  <li>The page opens with a cookie banner at the bottom.
    <img src=".dd-output/detected-banner.png" alt="The banner page" class="screenshot">
    <!-- step {"screenshot":".dd-output/detected-banner.png"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Mark an image as a screenshot
=============================

.. test {"testId":"capture-detect-screenshot-image","detectSteps":false}

#. Go to `the banner page <http://localhost:8092/screenshot-banner.html>`_.

   .. step {"goTo":"http://localhost:8092/screenshot-banner.html"}

#. The page opens with a cookie banner at the bottom.

   .. image:: .dd-output/detected-banner.png
      :alt: The banner page
      :class: screenshot

   .. step {"screenshot":".dd-output/detected-banner.png"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="capture-detect-screenshot-image">
  <title>Mark an image as a screenshot</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"capture-detect-screenshot-image","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/screenshot-banner.html" scope="external" format="html">the banner page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/screenshot-banner.html"}'/></info></step>
      <step><cmd>The page opens with a cookie banner at the bottom.</cmd>
        <info><image href=".dd-output/detected-banner.png" outputclass="screenshot"><alt>The banner page</alt></image>
          <data name="doc-detective" value='step {"screenshot":".dd-output/detected-banner.png"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "capture-detect-screenshot-image",
      "steps": [
        {
          "goTo": "http://localhost:8092/screenshot-banner.html"
        },
        {
          "screenshot": ".dd-output/detected-banner.png"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: capture-detect-screenshot-image
    steps:
      - goTo: http://localhost:8092/screenshot-banner.html
      - screenshot: .dd-output/detected-banner.png
```