Open ainame opened 1 year ago
I got a small PoC code that works with our project at my work. I'll share ideas and the piece of code I used soon 🙏
I published two things for PoC. Nothing is done properly. It's a quick and dirty implementation.
storekitd
(this is heavily inspired by the blog post I shared) https://github.com/ainame/StoreKitTestingProxyStoreKitTestingProxy
for PoC https://github.com/ainame/maestro/commit/74664bb4c36915a2557b06fef4866c3dbc3723e4 at https://github.com/ainame/maestro/tree/integrate-storekittesting-proxyTo test it,
maestro_driver_iosUITests.swift
to put your .storekit
file path or even hardcode the file content./maestro-driver-ios/build-maestro-ios-runner.sh
to update the iOS-driver./maestro test
with your yaml file. ↓ You can see at least the IAP dialogue on your simulator hopefully
This has proven maestro
can incorporate StoreKit Testing support. For the proper implementation, I believe we can add new Handlers
and Routes
for operations around StoreKit Testing, just like other operations. We'll still need to work on further reverse engineering to figure out what to do for things available in SKTestSession
; for example, SKTestSession.disableDialogs
property is a great configuration for UI testing, but the XPC interfaces don't expose that API directly and instead uses setInteger
method. We need to find out the key to it.
Let me know what you think. I can spend some time helping with implementation if needed.
I've been looking into maestro to migrate our UI testing layer from XCTest. It is essential for us and other iOS devs/teams to test IAP (in-app purchase) flows. I think it's currently missing in maestro.
In the normal XCTest world, since 2020, we can test IAP flows locally on iOS Simulator with StoreKit by StoreKit configuration file.
We can use
SKTestSession
from the StoreKitTest framework to load the.storekit
file for UI testing.It would be tough to support the capability to load the
.storekit
configuration file for maestro but I'm sure many maestro users would appreciate it if it's implemented.According to this blog post, within
StoreKitTest
framework, it's usingXPC
to communicate between processes. maestro can perhaps re-implementSKTestSession
by itself.I wonder if we can just put
SKTestSession
code somewhere within this file to load the.storekit
configuration file conditionally (sorry I haven't figured out the entire architecture of maestro for iOS platform). https://github.com/mobile-dev-inc/maestro/blob/main/maestro-driver-ios/maestro-driver-iosUITests/maestro_driver_iosUITests.swift