Post

Replies

Boosts

Views

Activity

testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase)
I am trying to test this simulated Error. The issue is, I can't get this to trigger through the simulatedError function. Error will always end up as an unknown error Example code snippet: @available(iOS 17.0, *) func testPurchase_InvalidQuantity() async throws { // Arrange testSession.clearTransactions() testSession.resetToDefaultState() let productID = "consumable_1" try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase) guard let product = await fetchProduct(identifier: productID) else { XCTFail("Failed to fetch test product") return } let option = Product.PurchaseOption.quantity(4) let result = await manager.purchase(product: product, options: option) switch result { case .success: XCTFail("Expected failure due to invalid quantity") case .failure(let error): print("Received error: \(error.localizedDescription)") switch error { case .purchaseError(let purchaseError): XCTAssertEqual(purchaseError.code, StoreKitPurchaseError.invalidQuantity.code) default: XCTFail("Unexpected error: \(error)") } } } In the above code snippet, I have an Unexpected Error. But if i remove try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase) I will receive a XCTFail in the success of my result. So when I set the quantity to a -1, only then can I correctly receive an invalidQuantity. Does anyone know why the try await testSession.setSimulatedError(.purchase(.invalidQuantity), forAPI: .purchase) would fail to work as directed? I have tests for all the generic errors for loadProducts API and the simulatedError works great for them
1
0
329
Feb ’25
Xcode cloud access
Today, I was suddenly unable to access Xcode Cloud. when viewing in app store connect, it says: The page you’re looking for can’t be found. The page you’re looking for does not exist, or you do not have permission to view it. after about an hour, i could once again see xcode cloud, but without any of my builds. A few minutes after that, a reload put me back to the lack of permission page Anyone else seeing this?
0
0
821
May ’23
Xcode Cloud workflow Primary Repository
Trying to create my first Xcode Cloud Workflow, however the default workflow has a primary Repository URL that is in Derived Data for some reason. I am unable to update this URL even when selecting the drop down. Anyone have any idea on how to fix this? This is really frustrating because I am unable to get through the final step of workflow creation, connecting my git code: However, while editing the workflow, when doing choosing which branches to trigger a build from, it is correctly able to detect all my branches, etc Anyone have any idea on what is happening?
4
0
1.8k
Feb ’23