diff --git a/packages/driver/src/cy/snapshots.ts b/packages/driver/src/cy/snapshots.ts index 707a83fd0b39..297758848ec1 100644 --- a/packages/driver/src/cy/snapshots.ts +++ b/packages/driver/src/cy/snapshots.ts @@ -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 {