I have an app which in production will be on five different devices, talking to each other using MultipeerConnectivity
. I have a bash script which launches the app on five different Simulators. This works great, but there are many buttons I have to tap on each device to test everything each time.
So I thought maybe XCUITest
could help to automate this, and remove these external bash script dependencies (would like to do everything within Xcode/Swift). I tried a naive approach like this:
func testExample() {
// Use recording to get started writing UI tests.
// Use XCTAssert and related functions to verify your tests produce the correct results.
let app1 = XCUIApplication(bundleIdentifier: "com.madebymist.qdb-ios")
let app2 = XCUIApplication(bundleIdentifier: "com.madebymist.qdb-ios")
app1.launch()
app1.buttons["Select Group"].tap()
app1.sheets.buttons["Group one"].tap()
app1.buttons["Host"].tap()
// Launch and test App 2
app2.launch()
app2.buttons["Select Group"].tap()
app2.sheets.buttons["Group one"].tap()
app2.buttons["Join"].tap()
}
But that only launched the app one by one, after each other, in the same Simulator.
So, is there any way to achieve simultaneous XCUITest on multiple Simulator devices? (Preferably within Xcode/Swift, but other options would work as well).