I\'ve tried setting attributes in the XCUIApplication
instance, in my UI Tests setUp()
let app = XCUIApplication()
app.launchEnviro
For launch arguments, pass them as two separate arguments:
let app = XCUIApplication()
app.launchArguments.append("-arg")
app.launchArguments.append("val")
app.launch()
Taken from here.
Here is example with launchArguments and Objective-C:
if ([[NSProcessInfo processInfo].arguments containsObject:@"SNAPSHOT"]) {
//do snapshot;
}
Swift:
let arguments = ProcessInfo.processInfo.arguments
if arguments.contains("SNAPSHOT") {
//do snapshot
}