Skip to content

Purchase testing ​

Test purchase flows on a test device: what to prepare, and how purchase steps behave.

Astra Scout only runs against test devices. There is no purchase guard and no special mode: purchase-like steps in flows, AI auto-fix, Explore app and the CLI (MCP) simply run, with no questions asked.

You are responsible for preparing the test environment below. Never use a real account or card.

How purchase steps behave ​

  • In Explore app, purchase buttons and paywalls are offered to the AI labelled "(purchase – sandbox)". The AI never types passwords or card numbers. The one exception is the sandbox password on the iOS system purchase sheet, taken from the runner environment variable SANDBOX_PASSWORD. Without it, exploration stops as Tester needed.
  • On a real iPhone, the SpringBoard purchase dialog is not visible to the AI, so exploration stops in the Tester needed state (NEEDS_HUMAN) and you continue on the device.
  • The only action that still needs your confirmation is posting a bug report to Jira (Awaiting confirmation). See Jira.

Environments ​

EnvironmentSetup
iOS Simulator with a StoreKit ConfigurationAdd a .storekit file to the app's scheme and run the app from Xcode (Astra Scout cannot check this, so make sure of it yourself). Clear transactions between tests with Debug → StoreKit → Manage Transactions in Xcode.
Real iPhone with a Sandbox accountCreate a Sandbox Tester in App Store Connect and sign in at Settings → App Store → Sandbox Account on the iPhone. Connect by USB, keep it unlocked, with Focus or Do Not Disturb on. Turn on Allow Purchases & Renewals under Settings → Developer → Sandbox Apple Account.
Android with a License testerAdd the device's Google account under Setup → License testing in Play Console, install the app from a test track, and use only test cards ("Test card, always approves").

An account that already purchased will not see the trial offer again. Clear its purchase history from Astra Scout (see Sandbox testers), in App Store Connect, or use another account.

Automating the iOS purchase sheet ​

Astra Scout can operate the system purchase sheet and password dialog by selector (text or id), without coordinates. On the iPhone, turn off Face ID & Passcode → iTunes & App Store, so payment no longer asks for Face ID or a passcode and the sheet just shows a Subscribe button. Keep the whole sequence in one flow:

yaml
- tapOn: "6 Month"          # button in the app; the sheet appears after 1-12 s
- tapOn: "Subscribe"        # on the sheet; plain text must match the whole string
- tapOn: "Password"         # sandbox password field
- inputText: ${SANDBOX_PASSWORD}
- tapOn: "Confirm"

Text matching follows Maestro: a regex that must match the element's entire text, case-insensitive for plain text. Use ".*Subscribe.*" to match part of it. Only text and id selectors (plus index) work on system dialogs. If the text is not on the sheet, the step fails with SYSTEM_OVERLAY. Each step on the sheet takes about 3 to 12 seconds on a real iPhone. Example: flows/mydmv/purchase_6month_selectors.yaml.