How To Add Launch Arguments & Environment values on iOS Extension In UI Automation Test

119 Views Asked by At

I've got a UIAutomation test that tests an app with a Share Extension. I want to pass in some launchArguments and launchEnvironment properties to the Share Extension in my test.

I can't figure out a way of doing it.

When debug the ProcessInfo in the extension my values aren't there. I've tried setting them like this:

XCUIApplication(bundleIdentifier:"com.my.app").launchArguments = ["TEST"]
XCUIApplication(bundleIdentifier:"com.my.app").launchEnvironment = ["TEST":"TEST"]

and this:

XCUIApplication().launchArguments = ["TEST"]
XCUIApplication().launchEnvironment = ["TEST":"TEST"]

Note, I am correctly getting the correct process when I'm finding it with the bundle identifier.

0

There are 0 best solutions below