jeudi 23 mars 2017

Xcode - test iOS Application behaviour in specific time or date

I need to write automated tests for an iOS application in various scenarios. An important test case is when the app is launched in specific times of day (day vs night) and in specific dates (user's birthday, year seasons etc.).

Adding a mock object in the application's code itself is not a good option. Also, I know the device time can be changed manually via Preferences App, but the tests must be fully automated. I also know the settimeofday is restricted in iOS sandboxed application.

I was hoping to be able to set the application's time inside my XCUITestCase, in such a way that only the application under test would be affected (for sake of security).

Is this doable? Or should I submit a feature request to Apple?

Thanks!

Aucun commentaire:

Enregistrer un commentaire