Skip to content

Commit

Permalink
fix: only take snapshots if the AUT document is in state
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Nov 3, 2022
1 parent 720d788 commit 458786b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/driver/src/cy/snapshots.ts
Expand Up @@ -229,6 +229,11 @@ export const create = ($$: $Cy['$$'], state: StateFunc) => {

const createSnapshot = (name, $elToHighlight, preprocessedSnapshot) => {
Cypress.action('cy:snapshot', name)
// only take a snapshot if the AUT document is in state to prevent cypress-in-cypress like snapshots
// or if the snapshot has been taken in a spec bridge and has already been preprocessed
if (!preprocessedSnapshot && !state('document')) {
return null
}

try {
const {
Expand Down

0 comments on commit 458786b

Please sign in to comment.