Hello,
I have an app which should be tested on iOS Simulator. The app is installed without any problems on the simulator using Appium. I have a script which creates an account in the app and log in it. Unfortunately, when I start the test one more time it fails. The reason for failure is that I am already logged in the app. That`s why I have to reset the simulator every time when the test is running or to reset the state of the app. I tried to use mobile: reset command but it does not work for me because when I start the app I am still logged in.
So does anyone have an idea how to reset the simulator or the app state? ( I am using appium.dmg to start appium )
PS: I have created an apple script which can start the simulator, reset it and close it. You can see it below. Is there a way to integrate this script with appium and to be execute it every time when the simulator is launched?
do shell script "touch /private/var/db/.AccessibilityAPIEnabled" password "pwd" with administrator privileges
tell application "iPhone Simulator"
activate
end tell
tell application "System Events"
tell process "iPhone Simulator"
tell menu bar 1
tell menu bar item "iOs Simulator"
tell menu "iOs Simulator"
click menu item "Reset Content and Settings…"
end tell
end tell
end tell
tell window 1
click button "Reset"
end tell
end tell
end tell
tell application "iPhone Simulator" to quit
Any feedback will be useful. Thank you in advance!