snapshot/lib/assets/SnapshotHelper.swift in fastlane-2.88.0.beta.20180325050025 vs snapshot/lib/assets/SnapshotHelper.swift in fastlane-2.88.0.beta.20180327050037

- old
+ new

@@ -159,11 +159,16 @@ guard let app = self.app else { print("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().") return } - let screenshot = app.windows.firstMatch.screenshot() + guard let window = app.windows.allElementsBoundByIndex.first(where: { $0.frame.isEmpty == false }) else { + print("Couldn't find an element window in XCUIApplication with a non-empty frame.") + return + } + + let screenshot = window.screenshot() guard let simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return } let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png") do { try screenshot.pngRepresentation.write(to: path) } catch let error { @@ -271,6 +276,6 @@ } } // Please don't remove the lines below // They are used to detect outdated configuration files -// SnapshotHelperVersion [1.9] +// SnapshotHelperVersion [1.10]