0

In some, or all of my UI testing, the UIApplicationDelegate is completely useless.

Is it possible to start with a blank screen and then I can present a view controller as part of my testing code?

William Entriken
  • 37,208
  • 23
  • 149
  • 195

1 Answers1

0

This is not possible.

The UI testing framework allows you to interact with your app only through a proxy, and considers the app a black box. You have no control on it apart from the possibility to set launch arguments and environment variables.

This is an intentional design decision that many acceptance frameworks take, and it is meant to focus the UI tests on the users interaction and how the app responds to it.

You can always leverage the launch arguments or environment variables to pass an instruction to your app to load your desired view controller straight away from the app delegate's applicationDidFinishLaunching(_: withOptions:), for example using a router.

More info can be found here:

bneely
  • 9,083
  • 4
  • 38
  • 46
mokagio
  • 16,391
  • 3
  • 51
  • 58