start rewriting readme

This commit is contained in:
Joshua 2023-02-20 19:21:40 +01:00
parent af82f108ad
commit 7f629969d5

View file

@ -1,4 +1,4 @@
# @cypress/snapshot # @datashard/snapshot
> Adds value / object / DOM element snapshot testing support to Cypress test runner > Adds value / object / DOM element snapshot testing support to Cypress test runner
@ -30,6 +30,7 @@ After installing, add the following to your `cypress/support/commands.js` file
```js ```js
require("@cypress/snapshot").register(); require("@cypress/snapshot").register();
``` ```
This registers a new command to create new snapshot or compare value to old snapshot This registers a new command to create new snapshot or compare value to old snapshot
and add the following to your `cypress.config.js` and add the following to your `cypress.config.js`
@ -43,7 +44,6 @@ and add the following to your `cypress.config.js`
**Note:** `@cypress/snapshot` **requires** the `readFileMaybe` plugin to be included, which can be easily done using the code above **Note:** `@cypress/snapshot` **requires** the `readFileMaybe` plugin to be included, which can be easily done using the code above
# Usage # Usage
Currently, if you want to take more than one snapshot, you need to pass a Step Name to prevent overwrites / test failures Currently, if you want to take more than one snapshot, you need to pass a Step Name to prevent overwrites / test failures
@ -116,6 +116,7 @@ cy.get(...).snapshot("Intercepted API Request", {
This module provides some configuration options: This module provides some configuration options:
#### snapshotPath #### snapshotPath
Sets the default Path for saving Snapshots (default: `cypress/snapshots`) Sets the default Path for saving Snapshots (default: `cypress/snapshots`)
## Debugging ## Debugging