What a test covers
Mobile tests run on iOS Simulators, which ship with a simulated card (no Wallet setup required). During a run the agent:- Taps your app’s Apple Pay button like a user would.
- Waits for the payment sheet and verifies it appears with your line items and total.
- Authorizes the payment.
- Continues through your app’s post-payment flow (confirmation screen, receipt, navigation).
What a test can’t cover
iOS Simulators have no Secure Element, so the payment token your app receives is Apple’s simulator dummy - it contains no card data and cannot be decrypted or settled by a payment processor. That means:- Covered: button rendering, sheet presentation, line items and totals, your authorization handler, error and cancel handling, and everything in your app after authorization.
- Not covered: server-side token decryption, processor calls, and settlement.
Requirements
Your uploaded build must include the Apple Pay capability (thecom.apple.developer.in-app-payments entitlement with at least one merchant ID). Simulator builds don’t need a provisioning profile for this - enabling the capability on your target in Xcode is enough. Without the capability, Apple Pay UI will not appear in the app and payment steps will fail.
Writing the test
Describe the flow in plain language - no special syntax is needed:Limitations
- Native iOS apps only. Apple Pay on the mobile web (Safari) is not supported - Apple’s payment sheet does not function in Safari on any iOS Simulator.
- The simulated card is always a Visa; card-network-specific behavior can’t be selected.
- Payment declines can’t be simulated - the simulator always authorizes.