|
| 1 | +import Admonition from "@theme/Admonition"; |
| 2 | + |
| 3 | +# Time Travel (Preview) |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +The Time Travel mode is a new Testplane UI tool that allows you to observe test execution in real-time, as well as record and replay the test's progress. |
| 10 | + |
| 11 | +- Time Travel records snapshots of the DOM tree, not screenshots or videos, but the actual DOM structure |
| 12 | +- The average snapshot size is about 200KB thanks to compression and an incremental recording algorithm |
| 13 | +- The entire functionality is available both within the GUI and in a static report generated from any CI |
| 14 | + |
| 15 | +## Getting Started |
| 16 | + |
| 17 | +<Admonition type="warning"> |
| 18 | + Please note that the Time Travel feature is currently in Preview. For production use, we |
| 19 | + recommend waiting for the stable version. |
| 20 | +</Admonition> |
| 21 | + |
| 22 | +1. Install the alpha versions of `testplane` and `html-reporter`: |
| 23 | + |
| 24 | + ```shell |
| 25 | + |
| 26 | + ``` |
| 27 | + |
| 28 | +2. Enable snapshot recording in the Testplane config: |
| 29 | + |
| 30 | + ```typescript |
| 31 | + export = { |
| 32 | + /* ... */ |
| 33 | + record: "on", |
| 34 | + }; |
| 35 | + ``` |
| 36 | + |
| 37 | +3. Run the tests and activate Time Travel in the UI settings: |
| 38 | + |
| 39 | +  |
| 40 | + |
| 41 | +## Using Time Travel |
| 42 | + |
| 43 | +After activating Time Travel in all supported browsers, a player window will appear before the test starts. During test execution, the browser's activity will be streamed into this player. |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +After the test run is complete, you can replay the recorded snapshots and navigate through time. Hovering over a specific step will show the browser's state at that exact moment. |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +To debug the layout, you can use the browser's DevTools. All selectors and attributes are preserved without changes. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +## Configuring Time Travel |
| 56 | + |
| 57 | +Currently, snapshot recording is controlled via the `record` option in the Testplane config. It supports two values: `"on"` (snapshots will be recorded for every test run) and `"off"` (snapshots are completely disabled). |
| 58 | + |
| 59 | +<Admonition type="info"> |
| 60 | + In the near future, smarter recording modes will be available, such as "only on failure" or |
| 61 | + "enabled during retries." Additionally, network request debugging and full-screen mode will soon |
| 62 | + be available. |
| 63 | +</Admonition> |
0 commit comments