Skip to content

feat: Introduce maestro for UI testing #5013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions Examples/rc-maestro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno

### Projects ###
*.xcodeproj
*.xcworkspace

### Tuist derived files ###
graph.dot
Derived/

### Tuist managed dependencies ###
Tuist/.build

### xcconfig
**/Local.xcconfig
58 changes: 58 additions & 0 deletions Examples/rc-maestro/Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import ProjectDescription

let project = Project(
name: "Maestro",
organizationName: "RevenueCat",
settings: .settings(
configurations: [
.debug(name: "Debug", xcconfig: .relativeToManifest("rc-maestro/Resources/Local.xcconfig"))
],
defaultSettings: .essential
),
targets: [
.target(
name: "Maestro-Debug",
destinations: .iOS,
product: .app,
bundleId: "com.revenuecat.maestro.ios",
deploymentTargets: .iOS("17.0"),
infoPlist: .extendingDefault(
with: [
"UILaunchScreen": [
"UIColorName": "",
"UIImageName": "",
],
"REVENUECAT_API_KEY": "$(REVENUECAT_API_KEY)"
]
),
sources: ["rc-maestro/Sources/**/*.swift"],
resources: [
"rc-maestro/Resources/**/*.xcassets",
],
dependencies: [
.external(name: "RevenueCat"),
.external(name: "RevenueCatUI"),
.sdk(name: "StoreKit", type: .framework, status: .required)
]
)
],
schemes: [
.scheme(
name: "Maestro-Debug",
shared: true,
hidden: false,
buildAction: .buildAction(targets: ["Maestro-Debug"], findImplicitDependencies: true),
runAction: .runAction(
configuration: "Debug",
executable: "Maestro-Debug",
options: .options(
storeKitConfigurationPath: "rc-maestro/Resources/StoreKit/StoreKitConfigDefault.storekit"
)
)
)
],
additionalFiles: [
"rc-maestro/Resources/**/Local.xcconfig.sample",
"rc-maestro/Resources/**/Local.xcconfig"
]
)
3 changes: 3 additions & 0 deletions Examples/rc-maestro/Tuist.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ProjectDescription

let tuist = Tuist(project: .tuist())
24 changes: 24 additions & 0 deletions Examples/rc-maestro/Tuist/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// swift-tools-version: 6.0
@preconcurrency import PackageDescription

#if TUIST
import ProjectDescription

let packageSettings = PackageSettings(
productTypes: [
"RevenueCat": .framework,
"RevenueCatUI": .framework // default is .staticFramework
]
)

#endif

let package = Package(
name: "Dependencies",
dependencies: [
.package(
url: "https://github.com/RevenueCat/purchases-ios-spm",
branch: "main"
),
]
)
3 changes: 3 additions & 0 deletions Examples/rc-maestro/maestro/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# config.yaml
flows:
- customer_center/promo_offer/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
appId: com.revenuecat.maestro.ios

---
- launchApp
- runFlow:
file: "../../utils/buy_product.yaml"
env:
PRODUCT_ID: "maestro.weekly.tests"
- runFlow: "../../utils/open_customer_center.yaml"
- tapOn: "Change plans"
- tapOn: "Maestro Montly Tests (1 month)"
- tapOn: Subscribe
- tapOn: Ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
appId: com.revenuecat.maestro.ios

---
- launchApp
- runFlow: "../../utils/open_customer_center.yaml"
- assertVisible: "No subscriptions found"
- tapOn:
id: "xmark"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
appId: com.revenuecat.maestro.ios

---
- launchApp
- runFlow: "../../utils/open_customer_center.yaml"
- tapOn: "Restore past purchases"
- assertVisible: "No past purchases"
- tapOn: "Dismiss"
- tapOn:
id: "xmark"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
appId: com.revenuecat.maestro.ios

---
- launchApp
- runFlow:
file: "../../utils/buy_product.yaml"
env:
PRODUCT_ID: "maestro.weekly.tests"
- runFlow: "../../utils/open_customer_center.yaml"
- tapOn: "See all purchases"
- assertVisible: "ACTIVE SUBSCRIPTIONS"
- tapOn: Maestro Weekly Tests
- assertVisible: Active

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
appId: com.revenuecat.maestro.ios

---
- launchApp
- runFlow:
file: "../../utils/buy_product.yaml"
env:
PRODUCT_ID: "maestro.weekly.tests"
- runFlow: "../../utils/open_customer_center.yaml"
- tapOn: "Cancel Subscription"
- tapOn: "Too expensive"
- tapOn:
id: "promo-offer-primary-button"
- tapOn: Subscribe
- tapOn: Ok
10 changes: 10 additions & 0 deletions Examples/rc-maestro/maestro/utils/buy_product.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
appId: com.revenuecat.maestro.ios

inputText: ${PRODUCT_ID}

---

- tapOn: "Buy something"
- tapOn: "Buy ${PRODUCT_ID}"
- tapOn: "Subscribe"
- tapOn: "Ok"
4 changes: 4 additions & 0 deletions Examples/rc-maestro/maestro/utils/open_customer_center.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
appId: com.revenuecat.maestro.ios

---
- tapOn: "Present Customer Center"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading