I'm running bunch of XCUItests as Fastlane job. Every time some of the tests get failed with an error "Failed to terminate com.****.****:57929".
Works fine when I run these tests directly using Xcode on simulator. Issue occurs only when I run these tests using Fastlane on Simulator. Failures happen on different tests on different time. Below is the sample code:
class ExampleTests: XCTestCase {
var app: XCUIApplication!
override func setUp() {
super.setUp()
app = XCUIApplication()
continueAfterFailure = false
}
override func tearDown() {
super.tearDown()
}
func testCase1() {
app.launch()
/* Test steps1
step 2
*/
}
func testCase2() {
app.launch()
/* Test steps1
step 2
*/
}
When the test executes app.launch() it tries to terminate the previous app instance and that's where its's failing. Is there a way to fix this issue? Any help is much appreciated.