Skip to content

Commit dea83b0

Browse files
fix: leave test failure screenshots alone
1 parent 27da3d3 commit dea83b0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/plugin.js

+7
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ const getCompareSnapshotsPlugin = on => {
125125
// Intercept cypress screenshot and create a new image with our own
126126
// name convention and file structure for simplicity and consistency
127127
on('after:screenshot', details => {
128+
// A screenshot could be taken automatically due to a test failure
129+
// and not a call to cy.compareSnapshot / cy.screenshot. These files
130+
// should be left alone
131+
if (details.testFailure) {
132+
return;
133+
}
134+
128135
// Change screenshots file permission so it can be moved from drive to drive
129136
setFilePermission(details.path, 0o777)
130137
renameAndMoveFile(details.path, paths.image.comparison(details.name))

0 commit comments

Comments
 (0)