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 fb480f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/driver/src/cypress/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,12 @@ export class Log {
}
}

const snapshot = this.createSnapshot(name, this.get('$el'))
// only take a snapshot if the AUT document is in state to prevent cypress-in-cypress like snapshots
if (this.state('document')) {
const snapshot = this.createSnapshot(name, this.get('$el'))

this.addSnapshot(snapshot, options)
this.addSnapshot(snapshot, options)
}

return this
}
Expand Down

0 comments on commit fb480f5

Please sign in to comment.