It is super annoying when a popup appears asking for permissions while the tests are running, and it also makes the test very unstable and unreliable. On Android, we can use autoGrantPermissions, but I couldn't find anything for iOS XCUITest framework. Using XPath to locate the popup is also an option, but it still makes the test pass sometimes and fail the others, which is not reliable.