I have a bunch of UI tests using OCUnit and OCMock, which run fine if the simulator is not up already or in Default (portrait). However, the same tests fail, if I start the tests with the simulator already up and in either of the Landscape orientations. The tests are run considering iPad is in default portrait. How do I prevent those tests from failing because the simulator is in another orientation?
My 2 options were.
- Check if the orientation is Default portrait, if not skip those tests. This works, but doesn't seem to be very elegant.
- Before the test, programmatically set the device orientation to Default portrait, which I'm not very sure of. I'm guessing this would also require a tearDown method to revert?