Skip to navigation

Recording options, written as tests

Each example on this page varies one setting in a short procedure, shown as prose, detected tests, inline tests, and a standalone spec. For what each tab holds, see Navigation and interaction.

The examples write their images and videos to a .dd-output folder next to the example files. For full procedures, see Screenshots and recordings.

autoScreenshot and autoRecord precedence

A test’s value wins over the spec’s, which wins over the config’s. The examples config turns both off. The autoRecord examples run in headless Chrome, which records its tab.

autoScreenshot on in config

Varies: config.autoScreenshot · Value: true · Effect: saves a screenshot after every step to the run folder.

prose.md
# Type text with autoScreenshot on in config
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

autoScreenshot: true on the test

Varies: test.autoScreenshot · Value: true · Effect: turns it on for this test, though the config turns it off.

prose.md
# Type text with autoScreenshot on for one test
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

autoScreenshot: false on the test over config

Varies: test.autoScreenshot · Value: false · Effect: turns it off for this test, though the config turns it on.

prose.md
# Type text with autoScreenshot off for one test
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

autoScreenshot: false on the spec over config

Varies: spec.autoScreenshot · Value: false · Effect: turns it off for every test in the spec. Inline statements can’t set spec fields, so the inline and detected variants set it on the test.

prose.md
# Type text with autoScreenshot off for a spec
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

autoRecord on in config

Varies: config.autoRecord · Value: true · Effect: saves a video of the whole test to the run folder.

prose.md
# Type text with autoRecord on in config
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

autoRecord: true on the test

Varies: test.autoRecord · Value: true · Effect: turns it on for this test, though the config turns it off.

prose.md
# Type text with autoRecord on for one test
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

autoRecord: false on the test over config

Varies: test.autoRecord · Value: false · Effect: turns it off for this test, though the config turns it on.

prose.md
# Type text with autoRecord off for one test
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

autoRecord: false on the spec over config

Varies: spec.autoRecord · Value: false · Effect: turns it off for every test in the spec. Inline statements can’t set spec fields, so the inline and detected variants set it on the test.

prose.md
# Type text with autoRecord off for a spec
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello".

record and stopRecord permutations

Each example records typing in a field. The browser engine runs in headless Chrome on Windows, macOS, and Linux. The ffmpeg example needs a display, so it runs only in headed Chrome on Windows and macOS.

String path

Varies: record · Value: ".dd-output/typing.webm" · Effect: records to the path. With no overwrite, it skips when the file exists.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

true

Varies: record · Value: true · Effect: records to <stepId>.mp4 in outputDir with the engine Doc Detective picks.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

Object with path, directory, and overwrite

Varies: record · Value: { "path", "directory", "overwrite": "true" } · Effect: records to record-object.webm in .dd-output, replacing the last run’s file.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

engine: "browser"

Varies: record.engine · Value: "browser" · Effect: records the Chrome tab in a headed or a headless browser.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

engine: "ffmpeg"

Varies: record.engine · Value: "ffmpeg" · Effect: records the screen, so the test runs only in headed Chrome on Windows and macOS.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

Named recording

Varies: record.name · Value: "typing" · Effect: gives the recording a name that stopRecord can target.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

verify with minDuration and maxDuration

Varies: record.verify · Value: { "minDuration": 0.5, "maxDuration": 120 } · Effect: fails the stop step if the video is shorter than half a second or longer than two minutes.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

verify with notBlack

Varies: record.verify.notBlack · Value: true · Effect: fails the stop step if the video is almost all black.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

verify with resolution: true

Varies: record.verify.resolution · Value: true · Effect: fails the stop step if the video’s size doesn’t match what Doc Detective expected to record.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

verify with resolution as an object

Varies: record.verify.resolution · Value: { "width": 800, "height": 600 } · Effect: fails the stop step unless the video is exactly 800 by 600 pixels, the size of the test’s headless Chrome viewport.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

The test’s runOn runs it on headless Chrome only, where the video matches the viewport. Headed Chrome on a display smaller than the window can record a shorter video, and the run warns.

checkpoints: true

Varies: record.checkpoints · Value: true · Effect: saves a screenshot after each step and compares it with the last run’s, with the default settings.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

checkpoints as an object

Varies: record.checkpoints · Value: { "maxVariation": 0.5, "directory": ".dd-output/typing-checkpoints" } · Effect: keeps the comparison images in its own folder and tolerates more change before it warns.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

stopRecord: true

Varies: stopRecord · Value: true · Effect: stops the most recent recording.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

stopRecord with a name

Varies: stopRecord · Value: "typing" · Effect: stops the recording named typing.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.

stopRecord as an object

Varies: stopRecord · Value: { "name": "typing" } · Effect: stops the recording named typing, written as an object.

prose.md
# Record typing in a field
1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Start recording.
3. Click **Type here:**.
4. Type "Hello".
5. Wait a moment, then stop the recording.