@@ -36,6 +36,8 @@ final class MidiControlUITests: XCTestCase {
36
36
37
37
let midiSetupApp = XCUIApplication ( bundleIdentifier: " com.apple.audio.AudioMIDISetup " )
38
38
39
+ let vmpkApp = XCUIApplication ( bundleIdentifier: " net.sourceforge.vmpk " )
40
+
39
41
override func setUpWithError( ) throws {
40
42
// Put setup code here. This method is called before the invocation of each test method in the class.
41
43
@@ -107,6 +109,74 @@ final class MidiControlUITests: XCTestCase {
107
109
midiSetupApp. terminate ( )
108
110
}
109
111
112
+ func testLogsAreAdded( ) throws {
113
+ let viewLogsButton = app. buttons [ " View Midi Messages Logs " ]
114
+ XCTAssertTrue ( viewLogsButton. exists)
115
+ viewLogsButton. click ( ) ;
116
+
117
+ vmpkApp. terminate ( )
118
+ vmpkApp. launch ( )
119
+
120
+ let inputCheckbox = app. checkBoxes [ " VMPK Output (MIDI-1UP) " ]
121
+ XCTAssertTrue ( inputCheckbox. waitForExistence ( timeout: 5 ) )
122
+ // Click if not checked
123
+ if !( inputCheckbox. value as! Bool ) {
124
+ inputCheckbox. click ( )
125
+ }
126
+ else
127
+ {
128
+ inputCheckbox. doubleClick ( )
129
+ }
130
+ sleep ( 1 )
131
+
132
+ let controlCheckBox = vmpkApp. checkBoxes. firstMatch
133
+ XCTAssertTrue ( controlCheckBox. exists)
134
+ controlCheckBox. click ( )
135
+ controlCheckBox. click ( )
136
+ controlCheckBox. click ( )
137
+
138
+ let logsList = app. tables [ " Midi Logs List " ]
139
+ XCTAssertTrue ( logsList. exists)
140
+
141
+ XCTAssertTrue ( logsList. tableRows. count == 3 )
142
+
143
+ vmpkApp. terminate ( )
144
+ }
145
+
146
+ func testLogIsAddedWithCorrectText( ) throws {
147
+ let viewLogsButton = app. buttons [ " View Midi Messages Logs " ]
148
+ XCTAssertTrue ( viewLogsButton. exists)
149
+ viewLogsButton. click ( ) ;
150
+
151
+ vmpkApp. terminate ( )
152
+ vmpkApp. launch ( )
153
+
154
+ let inputCheckbox = app. checkBoxes [ " VMPK Output (MIDI-1UP) " ]
155
+ XCTAssertTrue ( inputCheckbox. waitForExistence ( timeout: 5 ) )
156
+ // Click if not checked
157
+ if !( inputCheckbox. value as! Bool ) {
158
+ inputCheckbox. click ( )
159
+ }
160
+ else
161
+ {
162
+ inputCheckbox. doubleClick ( )
163
+ }
164
+ sleep ( 1 )
165
+
166
+ let controlCheckBox = vmpkApp. checkBoxes. firstMatch
167
+ XCTAssertTrue ( controlCheckBox. exists)
168
+ controlCheckBox. click ( )
169
+
170
+ let logsList = app. tables [ " Midi Logs List " ]
171
+ XCTAssertTrue ( logsList. exists)
172
+
173
+ let text = logsList. tableRows. firstMatch. staticTexts. firstMatch. value as! String
174
+ print ( text)
175
+ XCTAssertTrue ( text. contains ( " Control Change " ) )
176
+
177
+ vmpkApp. terminate ( )
178
+ }
179
+
110
180
func testLaunchPerformance( ) throws {
111
181
if #available( macOS 10 . 15 , iOS 13 . 0 , tvOS 13 . 0 , watchOS 7 . 0 , * ) {
112
182
// This measures how long it takes to launch your application.
0 commit comments