Search code examples
ioscocoa-touchunit-testingautomated-testsgh-unit

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


Solution

  • 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.