简体   繁体   中英

UIAutomation bringing iOS app to a consistent state

I writing JavaScript test for my iOS app. I am hoping of using Apples Profiler and UIAutomation.

1) I was wondering how can I reset the app every time I run the test. I would like to reset my app to a consistent state every time before I run a new test. Have separated my tests into few groups. Every test of the first group should start on the first screen containing a tableView and filters for sorting elements in that table should be set to a consistent state. Second group of tests should start on the Settings screen and some options/switches should be pressed in particular order for me to test the UI.

2) Also first time the app starts there is a tutorial. How can I make the app think it is freshly installed and test the tutorial feature.

Thanks for the answers

How can I make the app think it is freshly installed ?

As the iOS applications are sandboxed, the only way is to delete and re-install the app every time.

In the Illuminator framework that I wrote (which extends UIAutomation), we provide an automation bridge that allows us to send "reset" commands to the app, putting it into a known state before each test is run. This makes the testing very repeatable, even if some tests fail.

Additionally, the command line scripts can recover the test run even if the app crashes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM