/
Formant_AnalyzerUITests.swift
72 lines (60 loc) · 2.02 KB
/
Formant_AnalyzerUITests.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// FormantPlotterUITests.swift
// FormantPlotterUITests
//
// Created by William Entriken on 11/10/15.
// Copyright © 2015 William Entriken. All rights reserved.
//
import XCTest
func delay(_ delay:Double, closure:@escaping ()->()) {
DispatchQueue.main.asyncAfter(
deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure)
}
class Formant_AnalyzerUITests: XCTestCase {
override func setUp() {
super.setUp()
// In UI tests it is usually best to stop immediately when a failure occurs.
continueAfterFailure = false
let app = XCUIApplication()
setupSnapshot(app)
app.launch()
app.buttons["Microphone"].tap()
app.sheets["Audio source"].collectionViews.buttons["arm"].tap()
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testSig() {
let app = XCUIApplication()
app.buttons["Sig"].tap()
delay(1.5) {
snapshot("1Sig", waitForLoadingIndicator:true)
}
self.waitForExpectations(timeout: 2, handler: nil)
}
func testLpc() {
let app = XCUIApplication()
app.buttons["LPC"].tap()
delay(1.5) {
snapshot("2Lpc", waitForLoadingIndicator:true)
}
self.waitForExpectations(timeout: 2, handler: nil)
}
func testHw() {
let app = XCUIApplication()
app.segmentedControls.buttons.element(boundBy: 2).tap()
delay(1.5) {
snapshot("3Hw", waitForLoadingIndicator:true)
}
self.waitForExpectations(timeout: 2, handler: nil)
}
func testFrmnt() {
let app = XCUIApplication()
app.buttons["Frmnt"].tap()
delay(1.5) {
snapshot("4Frmnt", waitForLoadingIndicator:true)
}
self.waitForExpectations(timeout: 2, handler: nil)
}
}