Justin Rainwater
Justin Rainwater

Reputation: 11

When using UIAutomation Instruments for iOS is there a way to keep my app open between tests?

So far I've successfully run iOS automation from the Instruments GUI and also using instruments on the command line. I haven't found any options that would allow me to manually open or close my app as part of the test. Instead it seems that running instruments will always launch the app at the beginning and close it at the end.

The reason I would like my app to stay open is because part of my test involves a pairing process with the desktop browser. Ideally in jenkins on osx I'd have a sequence of shell commands:

  1. run instruments test that puts app into "display passcode" state.
  2. run another command that enters the passcode in my browser component.
  3. run another instruments test that verifies my app has successfully paired.

If my app automatically closes after step 1 then the rest of the sequence won't work.

Alternatively I've checked if there's a way to execute the shell commands from within the instrumented test, but it seems that js doesnt allow such things because it would be a security risk. I'm happy with osx specific commands since I don't intend to run this on windows.

Upvotes: 1

Views: 603

Answers (1)

Jonathan Penn
Jonathan Penn

Reputation: 1341

Alas, there is no way to keep the app process running when Instruments is done with it. But, you can use target.delay() to wait until the app is in a state you're looking for. I'm not quite sure what you mean by your step 2. Are you manipulating a "browser component" outside of the simulator? Or is this this all in the same app?

Upvotes: 1

Related Questions