How can I clear my Safari history and data for the iPhone simulator in an XCUITest before running the test?
I am trying to test the login features of an app and would like the login credentials not to be saved i.e. google sign in. For this I need to clear the safari history and data in the iPhone simulator settings. Is there a way of doing this in code in the setup or tear down methods?
2
Answers
Simple solution: use Private mode in Safari
You could do that by having a setup function that wipes the Safari data through Settings. Something like this: