I'm doing some UI testing in my iOS app but I'm seeing some strange behaviour.
In my setUp()
method I'm adding some values to XCUIApplication().launchArguments
but when I query to see the launch arguments, I'm getting and empty array.
This is how my setUp()
method looks like:
override func setUp() {
super.setUp()
let application = XCUIApplication()
application.launchArguments = ["USE_SERVER_DEBUG"]
application.launch()
}
This is the function that calls Process.arguments
to retrieve the arguments
func checkArguments(){
let launchArguments = Process.arguments
for index in 0 ..< launchArguments.count {
let argument = launchArguments[index] as String
if argument.compare("USE_DEBUG_SERVER") == NSComparisonResult.OrderedSame {
// Do something
}
}
return true
}