Skip to content

Commit 06d4721

Browse files
authored
feat: Introduce maestro for UI testing (#5013)
* add rc-maestro with tests * point to remote * add promo-offer-primary-button * move mise.toml to root * added change plans test * follow spm conventions + remove test files * add manage_subscriptions test * add see all purchases test * added xccondig * renamed to Local.xcconfig instead of Maestro.xcconfig * renamed * deleted Derived folder * delete .swiftpm/xcode/xcshareddata/xcschemes/RevenueCat-Package.xcscheme * dont override default xcconfig * delete theme test * find implicit deps
1 parent 84283a0 commit 06d4721

22 files changed

+665
-0
lines changed

Examples/rc-maestro/.gitignore

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
### macOS ###
2+
# General
3+
.DS_Store
4+
.AppleDouble
5+
.LSOverride
6+
7+
# Icon must end with two
8+
Icon
9+
10+
# Thumbnails
11+
._*
12+
13+
# Files that might appear in the root of a volume
14+
.DocumentRevisions-V100
15+
.fseventsd
16+
.Spotlight-V100
17+
.TemporaryItems
18+
.Trashes
19+
.VolumeIcon.icns
20+
.com.apple.timemachine.donotpresent
21+
22+
# Directories potentially created on remote AFP share
23+
.AppleDB
24+
.AppleDesktop
25+
Network Trash Folder
26+
Temporary Items
27+
.apdisk
28+
29+
### Xcode ###
30+
# Xcode
31+
#
32+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
33+
34+
## User settings
35+
xcuserdata/
36+
37+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
38+
*.xcscmblueprint
39+
*.xccheckout
40+
41+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
42+
build/
43+
DerivedData/
44+
*.moved-aside
45+
*.pbxuser
46+
!default.pbxuser
47+
*.mode1v3
48+
!default.mode1v3
49+
*.mode2v3
50+
!default.mode2v3
51+
*.perspectivev3
52+
!default.perspectivev3
53+
54+
### Xcode Patch ###
55+
*.xcodeproj/*
56+
!*.xcodeproj/project.pbxproj
57+
!*.xcodeproj/xcshareddata/
58+
!*.xcworkspace/contents.xcworkspacedata
59+
/*.gcno
60+
61+
### Projects ###
62+
*.xcodeproj
63+
*.xcworkspace
64+
65+
### Tuist derived files ###
66+
graph.dot
67+
Derived/
68+
69+
### Tuist managed dependencies ###
70+
Tuist/.build
71+
72+
### xcconfig
73+
**/Local.xcconfig

Examples/rc-maestro/Project.swift

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import ProjectDescription
2+
3+
let project = Project(
4+
name: "Maestro",
5+
organizationName: "RevenueCat",
6+
settings: .settings(
7+
configurations: [
8+
.debug(name: "Debug", xcconfig: .relativeToManifest("rc-maestro/Resources/Local.xcconfig"))
9+
],
10+
defaultSettings: .essential
11+
),
12+
targets: [
13+
.target(
14+
name: "Maestro-Debug",
15+
destinations: .iOS,
16+
product: .app,
17+
bundleId: "com.revenuecat.maestro.ios",
18+
deploymentTargets: .iOS("17.0"),
19+
infoPlist: .extendingDefault(
20+
with: [
21+
"UILaunchScreen": [
22+
"UIColorName": "",
23+
"UIImageName": "",
24+
],
25+
"REVENUECAT_API_KEY": "$(REVENUECAT_API_KEY)"
26+
]
27+
),
28+
sources: ["rc-maestro/Sources/**/*.swift"],
29+
resources: [
30+
"rc-maestro/Resources/**/*.xcassets",
31+
],
32+
dependencies: [
33+
.external(name: "RevenueCat"),
34+
.external(name: "RevenueCatUI"),
35+
.sdk(name: "StoreKit", type: .framework, status: .required)
36+
]
37+
)
38+
],
39+
schemes: [
40+
.scheme(
41+
name: "Maestro-Debug",
42+
shared: true,
43+
hidden: false,
44+
buildAction: .buildAction(targets: ["Maestro-Debug"], findImplicitDependencies: true),
45+
runAction: .runAction(
46+
configuration: "Debug",
47+
executable: "Maestro-Debug",
48+
options: .options(
49+
storeKitConfigurationPath: "rc-maestro/Resources/StoreKit/StoreKitConfigDefault.storekit"
50+
)
51+
)
52+
)
53+
],
54+
additionalFiles: [
55+
"rc-maestro/Resources/**/Local.xcconfig.sample",
56+
"rc-maestro/Resources/**/Local.xcconfig"
57+
]
58+
)

Examples/rc-maestro/Tuist.swift

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import ProjectDescription
2+
3+
let tuist = Tuist(project: .tuist())
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// swift-tools-version: 6.0
2+
@preconcurrency import PackageDescription
3+
4+
#if TUIST
5+
import ProjectDescription
6+
7+
let packageSettings = PackageSettings(
8+
productTypes: [
9+
"RevenueCat": .framework,
10+
"RevenueCatUI": .framework // default is .staticFramework
11+
]
12+
)
13+
14+
#endif
15+
16+
let package = Package(
17+
name: "Dependencies",
18+
dependencies: [
19+
.package(
20+
url: "https://github.com/RevenueCat/purchases-ios-spm",
21+
branch: "main"
22+
),
23+
]
24+
)
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# config.yaml
2+
flows:
3+
- customer_center/promo_offer/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
appId: com.revenuecat.maestro.ios
2+
3+
---
4+
- launchApp
5+
- runFlow:
6+
file: "../../utils/buy_product.yaml"
7+
env:
8+
PRODUCT_ID: "maestro.weekly.tests"
9+
- runFlow: "../../utils/open_customer_center.yaml"
10+
- tapOn: "Change plans"
11+
- tapOn: "Maestro Montly Tests (1 month)"
12+
- tapOn: Subscribe
13+
- tapOn: Ok
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
appId: com.revenuecat.maestro.ios
2+
3+
---
4+
- launchApp
5+
- runFlow: "../../utils/open_customer_center.yaml"
6+
- assertVisible: "No subscriptions found"
7+
- tapOn:
8+
id: "xmark"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
appId: com.revenuecat.maestro.ios
2+
3+
---
4+
- launchApp
5+
- runFlow: "../../utils/open_customer_center.yaml"
6+
- tapOn: "Restore past purchases"
7+
- assertVisible: "No past purchases"
8+
- tapOn: "Dismiss"
9+
- tapOn:
10+
id: "xmark"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
appId: com.revenuecat.maestro.ios
2+
3+
---
4+
- launchApp
5+
- runFlow:
6+
file: "../../utils/buy_product.yaml"
7+
env:
8+
PRODUCT_ID: "maestro.weekly.tests"
9+
- runFlow: "../../utils/open_customer_center.yaml"
10+
- tapOn: "See all purchases"
11+
- assertVisible: "ACTIVE SUBSCRIPTIONS"
12+
- tapOn: Maestro Weekly Tests
13+
- assertVisible: Active
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: com.revenuecat.maestro.ios
2+
3+
---
4+
- launchApp
5+
- runFlow:
6+
file: "../../utils/buy_product.yaml"
7+
env:
8+
PRODUCT_ID: "maestro.weekly.tests"
9+
- runFlow: "../../utils/open_customer_center.yaml"
10+
- tapOn: "Cancel Subscription"
11+
- tapOn: "Too expensive"
12+
- tapOn:
13+
id: "promo-offer-primary-button"
14+
- tapOn: Subscribe
15+
- tapOn: Ok
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
appId: com.revenuecat.maestro.ios
2+
3+
inputText: ${PRODUCT_ID}
4+
5+
---
6+
7+
- tapOn: "Buy something"
8+
- tapOn: "Buy ${PRODUCT_ID}"
9+
- tapOn: "Subscribe"
10+
- tapOn: "Ok"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
appId: com.revenuecat.maestro.ios
2+
3+
---
4+
- tapOn: "Present Customer Center"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"scale" : "2x",
6+
"size" : "20x20"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"scale" : "3x",
11+
"size" : "20x20"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"scale" : "2x",
16+
"size" : "29x29"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"scale" : "3x",
21+
"size" : "29x29"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"scale" : "2x",
26+
"size" : "40x40"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"scale" : "3x",
31+
"size" : "40x40"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"scale" : "2x",
36+
"size" : "60x60"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"scale" : "3x",
41+
"size" : "60x60"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"scale" : "1x",
46+
"size" : "20x20"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"scale" : "2x",
51+
"size" : "20x20"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"scale" : "1x",
56+
"size" : "29x29"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"scale" : "2x",
61+
"size" : "29x29"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"scale" : "1x",
66+
"size" : "40x40"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"scale" : "2x",
71+
"size" : "40x40"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"scale" : "1x",
76+
"size" : "76x76"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"scale" : "2x",
81+
"size" : "76x76"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"scale" : "2x",
86+
"size" : "83.5x83.5"
87+
},
88+
{
89+
"idiom" : "ios-marketing",
90+
"scale" : "1x",
91+
"size" : "1024x1024"
92+
}
93+
],
94+
"info" : {
95+
"author" : "xcode",
96+
"version" : 1
97+
}
98+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}

0 commit comments

Comments
 (0)