func testPurchasingCoins_success() { self.app.launchArguments.append(contentsOf: [ "-mockPurchase", "true" ]) self.app.launch() // ... assert what should happen ... } func testPurchasingCoins_failure() { self.app.launchArguments.append(contentsOf: [ "-mockPurchase", "false" ]) self.app.launch() // ... assert what should happen ... }