Attempting to run multiple tests using Xcode's new UI testing fails
Asked Answered
N

3

3

When I try to run multiple UI tests at the same time in the new Xcode beta, it fails after the first test, with the error "UI Testing Failure: App state is still not terminated" for each test after the first. Anyone got a fix for this?

Nunes answered 14/7, 2015 at 4:28 Comment(0)
F
0

Did you include a

func tearDown() { super.tearDown() }

function?

It's needed to terminate the app state after each test before it is re-initialized by the

func setUp() { super.setUp(); XCUIApplication().launch }

Fungiform answered 25/8, 2015 at 21:50 Comment(1)
Can you please add some code code blocks? This is really hard to read.Robrobaina
F
0

I have faced the same issue. It seems that, at least in my case, application had never been terminated.

I solved it by putting the following statement in the setUp() method:

continueAfterFailure = false

This should stop a running test process after first failure.

Filberte answered 23/11, 2015 at 9:39 Comment(0)
R
0

I cannot post a comment, so I will try to answer your question while getting some clarification.

I have faced this issue when running on physical devices. On simulator I did not face this issue. So are you facing this issue when running on device or simulator or both?

If its a device, then there is a known bug which has been reported to Apple. To overcome this issue, at runtime I have inserted dummy test cases between two genuine test cases.

Rupiah answered 21/3, 2016 at 18:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.