Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Learn how to test Apple Pay on real iOS devices. Covers sandbox setup, Appium automation with the applePay capability, device matrix, and CI/CD integration.

Vaishali Vatsayan
Author

Salman Khan
Reviewer
Last Updated on: July 7, 2026
Overview
What makes Apple Pay testing different from other mobile flows?
Apple Pay runs inside the iOS Secure Element, a dedicated hardware chip on the device. This means most of the payment authorization work happens in hardware that emulators and simulators cannot replicate. Three constraints make real device testing non-negotiable:
What you need before your first test
An Apple Developer account with a sandbox merchant ID, a sandbox tester account in App Store Connect, a developer-certificate-signed build, and a real iPhone 13 or later running iOS 15 through iOS 18. TestMu AI's Real Device Cloud provides the devices; you bring the app and credentials.
Digital wallets now represent 53% of global ecommerce transaction value, according to the Worldpay Global Payments Report 2025. For iOS apps with a checkout flow, a broken Apple Pay integration is not a UX inconvenience. It is a direct revenue block.
This guide covers Apple Pay testing end-to-end: what the sandbox environment requires, how to write automation code that runs on real iOS hardware, how to build a device matrix, and how to gate Apple Pay tests in CI/CD.
Most Apple Pay failures do not surface on the iOS Simulator. Here is where they actually hide:
None of these failure modes surface reliably on the Simulator. Testing Apple Pay on real devices is the minimum viable QA bar, not a premium-tier best practice.
Apple Pay automation on TestMu AI follows a five-step flow derived directly from the Apple Pay Automation documentation. Understanding what each step requires before writing a single line of code prevents the most common setup mistakes:
| Step | What happens | What you provide | Common failure if skipped |
|---|---|---|---|
| 1. Upload app | TestMu AI installs the IPA on a real device and returns an app ID | Developer-signed IPA (not enterprise cert) | Apple Pay silently unavailable at runtime |
| 2. Add desired capabilities | Platform provisions Wallet, a sandbox card, and the passcode on a real iPhone | applePay: true and applePayCardType in lt:options | Payment sheet launches but no card is provisioned |
| 3. Update shipping/billing (optional) | Platform pre-fills contact and address on the payment sheet | shippingDetails, billingDetails, contact via the lambda-applepay-details hook | Shipping picker blocks automation if your merchant requires it |
| 4. Confirm payment | Platform taps the confirmation button on the Apple Pay sheet | lambda_executor applePay confirmPayment hook | Sheet stalls at the confirmation step |
| 5. Enter passcode | Your script types the passcode to authorize the transaction | Send the passcode (default 123456) to the Passcode field | Payment hangs indefinitely waiting for authorization |
Getting the environment wrong is the number one reason Apple Pay tests fail before a single test case runs. Work through this checklist completely before writing automation code:
applePay capability provisions the passcode, and your script enters it at the confirmation step (the default is 123456).isRealMobile: true.Manual Apple Pay testing catches the failure modes automation handles poorly: biometric edge cases, card setup errors, and multi-step recovery flows. Run these scenarios on a real device before setting up any automation:
Run these manually on TestMu AI's real device cloud directly from a browser. The live session captures device logs and network traces in real time, so the network interruption scenario gives you the full HTTP log showing exactly which API call timed out. The Face ID and Touch ID prompts themselves have their own failure modes; the guide on testing biometric authentication with Appium covers the retry, fallback, and lockout paths in depth.
TestMu AI supports Apple Pay automation on real iOS devices. Enabling the applePay capability provisions Wallet, a sandbox card, and the device passcode, so you never interact with Face ID or Touch ID programmatically. The following Python example runs a complete Apple Pay checkout flow on an iPhone 16 running iOS 18:
from appium import webdriver
from appium.options.ios import XCUITestOptions
from appium.webdriver.common.appiumby import AppiumBy
options = XCUITestOptions()
lt_options = {
"username": "YOUR_LT_USERNAME",
"accessKey": "YOUR_LT_ACCESS_KEY",
"deviceName": "iPhone 16",
"platformName": "iOS",
"platformVersion": "18",
"app": "lt://YOUR_APP_ID",
"isRealMobile": True,
"build": "Payment Flow - Apple Pay",
"name": "Apple Pay Checkout Test",
# Provisions Wallet, a sandbox card, and the device passcode
"applePay": True,
# Card networks in priority order: amex, visa, master, discover
"applePayCardType": ["visa", "master"],
}
options.set_capability("lt:options", lt_options)
driver = webdriver.Remote(
command_executor="https://mobile-hub.lambdatest.com/wd/hub",
options=options
)
try:
# Navigate to checkout and launch the Apple Pay sheet
driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Checkout").click()
driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Pay with Apple Pay").click()
# Optional: set billing details on the payment sheet
driver.execute_script("lambda-applepay-details", {
"billingDetails": {
"firstName": "Jane",
"lastName": "Tester",
"street": "123 Market St",
"city": "San Francisco",
"postalCode": "94107",
"state": "CA",
"country": "US"
}
})
# Confirm the Apple Pay payment via the TestMu AI hook
driver.execute_script(
'lambda_executor: {"action": "applePay", "arguments": {"confirmPayment": "true"}}'
)
# Enter the device passcode to authorize (default 123456)
driver.find_element(AppiumBy.XPATH, '//*[@name="Passcode field"]').send_keys("123456")
# Verify the success screen
success_el = driver.find_element(AppiumBy.ACCESSIBILITY_ID, "Order Confirmed")
assert success_el.is_displayed(), "Apple Pay checkout did not complete"
print("Apple Pay test passed")
finally:
driver.quit()Setting applePay: true provisions Wallet, a sandbox card, and the passcode; applePayCardType picks the card networks in priority order. The lambda-applepay-details hook fills billing, shipping, and contact fields on the sheet, the lambda_executor confirm hook taps the pay button, and the script enters the passcode (default 123456) to authorize. Full capability and hook reference is in the Apple Pay Automation documentation at testmuai.com/support/docs/apple-pay-auto/.
Not all iPhone models behave identically in Apple Pay flows. PassKit interacts with device-specific hardware (secure enclave, biometric sensor, NFC chip) in ways that vary across generations. A matrix that tests only the latest flagship will miss failures your users encounter on older hardware or previous iOS versions.
TestMu AI currently enables Apple Pay automation on four Face ID iPhones, one per supported iOS version. Weight your run toward the devices your actual user base runs (pull the split from App Store Connect analytics):
| Device | iOS | Auth | Why Include |
|---|---|---|---|
| iPhone 16 | iOS 18 | Face ID | Latest supported model; catches iOS 18 PassKit changes |
| iPhone 15 | iOS 17 | Face ID | Broad user base; stable PassKit baseline on iOS 17 |
| iPhone 14 | iOS 16 | Face ID | Mid-cycle hardware; verifies iOS 16 payment sheet behavior |
| iPhone 13 | iOS 15 | Face ID | Oldest supported model; minimum iOS version edge case |
All four automation devices use Face ID. Cover the Touch ID side-button confirmation path (iPhone SE or iPad) and the tablet payment-sheet layout in a manual real device session, since the current automation device set is Face ID-based.
Run this matrix in parallel on TestMu AI: all four devices execute simultaneously. A suite that takes 15 minutes per device completes in 15 minutes total. For how checkout test patterns scale across environments, see the guide on cross-browser checkout flow testing.
Network condition testing on the same matrix: After confirming all devices pass the happy path, re-run under 3G throttling via TestMu AI's network simulation. Apple Pay API calls that complete in 400ms on LTE can hit 2 to 3 second timeouts on 3G. If your merchant validation endpoint has a 1.5 second timeout, it fails on 3G but never surfaces in office testing.
Note: TestMu AI's Real Device Cloud gives you instant access to 10,000+ real Android and iOS devices to test Apple Pay without maintaining a physical device lab. Try it free.
Apple Pay tests belong in CI/CD, not only in pre-release manual runs. A checkout regression that breaks Apple Pay will not wait for release day to surface.
The recommended structure by pipeline stage:
A GitHub Actions workflow that triggers Apple Pay tests on TestMu AI for every push to a release branch:
name: Apple Pay Tests
on:
push:
branches:
- release/**
schedule:
- cron: '0 2 * * *' # Nightly at 2am UTC
jobs:
apple-pay-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install Appium-Python-Client
- name: Run Apple Pay tests on real iOS devices
env:
LT_USERNAME: ${{ secrets.LT_USERNAME }}
LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
run: python tests/payment/test_apple_pay.pyFor larger suites, TestMu AI's HyperExecute distributes test cases across the device matrix with intelligent parallelization, reducing end-to-end payment test time by up to 70% compared to sequential execution. This is the recommended path for teams running 20 or more Apple Pay test cases across all four devices.
For the broader question of when to use Simulator versus real devices at each CI stage, see the comparison guide on emulator vs simulator vs real device testing. For fintech app testing patterns beyond Apple Pay, the guide on testing a fintech application with real-world examples covers authentication flows and payment gateway integration more broadly.
Apple Pay testing on real devices is not optional for any iOS app with a checkout flow. The Simulator misses the biometric hardware, the secure enclave interactions, and the network timing failures that only surface under real conditions.
Here is the practical path forward:
isRealMobile: true and applePay capabilities on TestMu AI's real device cloud.Start with TestMu AI's real device cloud: 60 minutes free, no credit card required. Follow the step-by-step manual Apple Pay testing walkthrough in the docs, and the Apple Pay automation setup takes around 30 minutes from a blank account.
Author
Vaishali Vatsayan is a Community Contributor at TestMu AI with 5+ years of experience in copywriting, content strategy, and UX writing for SaaS and AI products. She is skilled in test automation and mobile automation testing across Android and iOS, and specializes in product copy, onboarding flows, microcopy, UI strings, and brand voice. She worked as a Senior Copywriter at Leena AI.
Reviewer
Salman is a Test Automation Evangelist and Community Contributor at TestMu AI, with over 6 years of hands-on experience in software testing and automation. He has completed his Master of Technology in Computer Science and Engineering, demonstrating strong technical expertise in software development, testing, AI agents and LLMs. He is certified in KaneAI, Automation Testing, Selenium, Cypress, Playwright, and Appium, with deep experience in CI/CD pipelines, cross-browser testing, AI in testing, and mobile automation. Salman works closely with engineering teams to convert complex testing concepts into actionable, developer-first content. Salman has authored 120+ technical tutorials, guides, and documentation on test automation, web development, and related domains, making him a strong voice in the QA and testing community.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance