diff --git a/CHANGELOG.md b/CHANGELOG.md index fcbf936..6abb7b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Your contribution here. * [#69](https://github.com/Antondomashnev/FBSnapshotsViewer/pull/69): Replace Swap with Accept and Accept All. - [@babbage](https://github.com/babbage). * [#70](https://github.com/Antondomashnev/FBSnapshotsViewer/pull/70): Remove accepted images from failed image path. - [@babbage](https://github.com/babbage). +* [#72](https://github.com/Antondomashnev/FBSnapshotsViewer/pull/72): Recognise and enable acceptance of AutoRecorded images. - [@babbage](https://github.com/babbage). ### 0.8.0 (11.10.2017) diff --git a/FBSnapshotsViewer/Managers/SnapshotTestResultAcceptor.swift b/FBSnapshotsViewer/Managers/SnapshotTestResultAcceptor.swift index 321e3e4..c3274ab 100644 --- a/FBSnapshotsViewer/Managers/SnapshotTestResultAcceptor.swift +++ b/FBSnapshotsViewer/Managers/SnapshotTestResultAcceptor.swift @@ -34,7 +34,7 @@ class SnapshotTestResultAcceptor { let failedImageSizeSuffix = imagePath.substring(with: failedImageSizeSuffixRange) let recordedImageURLs = testResult.build.fbReferenceImageDirectoryURLs.flatMap { fbReferenceImageDirectoryURL -> URL? in let url = fbReferenceImageDirectoryURL.appendingPathComponent(testResult.testClassName).appendingPathComponent("\(testResult.testName)\(failedImageSizeSuffix)").appendingPathExtension("png") - return fileManager.fileExists(atPath: url.path) ? url : nil + return url } guard let url = recordedImageURLs.first else { throw SnapshotTestResultAcceptorError.notExistedRecordedImage(testResult: testResult) diff --git a/FBSnapshotsViewer/Models/ApplicationLogLine.swift b/FBSnapshotsViewer/Models/ApplicationLogLine.swift index 685501b..3fb6f2f 100644 --- a/FBSnapshotsViewer/Models/ApplicationLogLine.swift +++ b/FBSnapshotsViewer/Models/ApplicationLogLine.swift @@ -34,6 +34,7 @@ struct ApplicationLogLineIndicatorContainer { static func snapshotTestErrorMessageIndicators(for configuration: Configuration) -> [String] { return [" : ((noErrors) is true) failed - Snapshot comparison failed", " : failed - Snapshot comparison failed: Optional(Error Domain=FBSnapshotTestControllerErrorDomain Code=4", + " : failed - No previous reference image. New image has been stored for approval.", " : failed - Test ran in record mode."] } }