简体   繁体   中英

iOS Unit Tests: simulate Home Button press etc

is it possible to simulate pressing Home Button to terminate app in the automated tests? Is it possible to simulate switching to AirPlane Mode? I am using GHUnit and I want to test these scenarios:

  1. Press Home button during file download and wake the app again
  2. Switch to AirPlane mode during download (or simply turn on AirPlane mode)
  3. Switch from WiFi/3G to EDGE
  4. Simulate memory-warning
  5. Simulate incoming call when connected to EDGE

Thank you

I'm working with a test framework called Frank. From the items you listed you can simulate the following with Frank:

  1. Press Home button
  2. Simulate memory warning.

Frank is an acceptance test framework to the users interaction with the application. You can find it here .

For your other scenario's I can't think of a way you could test it with the simulator.
I think that is more important for you to know which events are triggered when such a scenario occurs. You then maybe use the Frank framework to simulate such events.

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