-
Notifications
You must be signed in to change notification settings - Fork 174
Monkey never stops if app crashes when testing with xcodebuild #65
Comments
Did a little more of investigation. Looks like it's not that Monkey is keeping the app alive, but since we crashed the app via input event instead of Steps to reproduce:
If you'd replace test code with something like So basically, it seems that in order to get this working we'd need to do something like is mentioned here #2. |
Based on my last comment, I got an idea of how to make the test fail when app has stopped. We can do it if we add something like:
in Then after app has crashed the test will fail with:
However I noticed a problem with this approach - no crash report is generated in |
@andris-zalitis Thanks for reporting this issue! I'm on it! Will keep you informed. |
Hey @andris-zalitis! I did some tests on my own and I couldn't find any workaround for solving this issue. I think your suggestion
... could be the best thing we're having right now. I tried "breaking" the infinite loops SwiftMonkey is using in Let's keep this issue open, perhaps someone might have an idea how it can be solved. |
Closing the issue due to inactivity. Please reopen it if you think it should be addressed. |
I think SwiftMonkey is very powerful way to find crashes in an app 👍. Ideally I'd like to be able to run it from CLI. That would make it possible to create scripts that run SwiftMonkey non-stop, gather crash reports, screenshots etc.
However, currently if a test is being launched via
xcodebuild test
SwiftMonkey continues its frenzy even after the app has crashed (after some time, it usually crashes some system apps too 😀).xcodebuild
also continues running after the app has crashed.However if I create UI Test that "manually" executes the same button press that results in a crash, then
xcodebuild
reports failed test and stops.The reason why Monkey keeps running is probably related to the fact that
XCUIApplication().state
returns.runningForeground
even after the app has crashed (I checked by adding a line infunc monkeyAround()
). It seems that somehow Monkey is keeping it alive?I'm experiencing this behaviour on Xcode 10, didn't try on Xcode 9 yet.
The text was updated successfully, but these errors were encountered: