Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stuck XCUITest runner when a popup is shown on the screen #510

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

dmissmann
Copy link
Collaborator

When a popup (like a permission popup for the camera, notifications, etc) is shown before the XCUITest is started, the XCUITest runner will hang and after 30s we get the error Failed to background test runner within 30.0s.

By adding the option "__ActivateSuspended": uint64(1), when we launch the XCUITest (like Xcode does), this is not happening anymore.

Also, the Error() method of NSError was a bit too verbose. In the error that we got here, there is a entry screenshot-data in the userInfo dictionary, and we shouldn't include that in the error message (it's still stored in the error if someone really needs that)

sometimes those errors contain a screenshot and that creates unreadable logs
with this option the XCUITest runner is coming into foreground even when there is a popup on the screen when at the time when the runner gets launched
@dmissmann dmissmann marked this pull request as ready for review November 8, 2024 12:45
Copy link
Collaborator

@shamanec shamanec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing find, I spent some effort on this but never would have thought of that prefix... 🚀

@dmissmann dmissmann merged commit 1caa612 into main Nov 11, 2024
5 checks passed
@dmissmann dmissmann deleted the dm-xcuitest-alert branch November 11, 2024 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants