-
Notifications
You must be signed in to change notification settings - Fork 1
/
ImageFlipUITests.swift
executable file
·41 lines (31 loc) · 1.28 KB
/
ImageFlipUITests.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import XCTest
import SwiftSnapshotTesting
class MultipeerUITests: SnapshotTestCase {
let app = XCUIApplication()
override var snapshotsReferencesFolder: String {
var path = "/Users/eugenebokhan/Desktop/"
let testsAppName = Bundle(for: Self.self).bundleIdentifier?.components(separatedBy: ".").last
path += testsAppName != nil ? "\(testsAppName!)-Snapshots/" : ""
return path
}
override func setUpWithError() throws {
self.continueAfterFailure = true
}
func testSnaphotting() throws {
self.app.activate()
defer { self.app.terminate() }
let flipTextureButton = self.app.buttons["FlipTextureButton"]
try self.assert(element: flipTextureButton,
testName: self.testName(),
recording: false)
try self.assert(screenshot: self.app.screenshot(),
testName: self.testName(),
ignore: [.statusBar],
recording: false)
flipTextureButton.tap()
try self.assert(screenshot: self.app.screenshot(),
testName: self.testName(),
ignore: [.statusBar],
recording: false)
}
}