-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
488 additions
and
10,045 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
name: Maestro UI Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
paths: | ||
- 'Sources/**' | ||
- 'Tests/**' | ||
- '.github/workflows/ui-tests.yml' | ||
- 'fastlane/**' | ||
- '.sauce/config.yml' | ||
- 'scripts/ci-select-xcode.sh' | ||
- 'Samples/iOS-Swift/**' | ||
|
||
|
||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-sample-for-maestro: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- sample-name: iOS-ObjectiveC | ||
lane_name: build_ios_objc_for_sim_tests | ||
artifact-name: maestro-ios-objc | ||
app_path: DerivedData/Build/Products/Debug-iphonesimulator/iOS-ObjectiveC.app | ||
- sample-name: iOS-Swift | ||
lane_name: build_ios_swift_for_sim_tests | ||
artifact-name: maestro-ios-swift | ||
app_path: DerivedData/Build/Products/Debug-iphonesimulator/iOS-Swift.app | ||
- sample-name: iOS-SwiftUI | ||
lane_name: build_ios_swift_ui_for_sim_tests | ||
artifact-name: maestro-ios-swift-ui | ||
app_path: DerivedData/Build/Products/Debug-iphonesimulator/iOS-SwiftUI.app | ||
name: Build ${{matrix.sample-name}} Sample | ||
runs-on: macos-14 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: ./scripts/ci-select-xcode.sh 15.4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec fastlane ${{matrix.lane_name}} | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{matrix.artifact-name}} | ||
path: ${{matrix.app_path}} | ||
|
||
eval-maestro-swift-ui-tests: | ||
name: Test ${{matrix.sample-name}} on iOS ${{matrix.os-version}} on ${{matrix.device}} Simulator | ||
needs: [build-sample-for-maestro] | ||
runs-on: ${{matrix.runs-on}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- sample-name: iOS-ObjectiveC | ||
artifact-name: maestro-ios-objc | ||
app: "Sample.app" | ||
test_suit: "Samples/iOS-ObjectiveC/.maestro" | ||
runs-on: macos-14 | ||
xcode: "14.3.1" | ||
device: "iPhone 14" | ||
os-version: "16.4" | ||
|
||
- sample-name: iOS-SwiftUI | ||
artifact-name: maestro-ios-swift-ui | ||
app: "Sample.app" | ||
test_suit: "Samples/iOS-SwiftUI/.maestro" | ||
runs-on: macos-12 | ||
xcode: "13.4.1" | ||
device: "iPhone 8" | ||
os-version: "15.5" | ||
- sample-name: iOS-SwiftUI | ||
artifact-name: maestro-ios-swift-ui | ||
app: "Sample.app" | ||
test_suit: "Samples/iOS-SwiftUI/.maestro" | ||
runs-on: macos-14 | ||
xcode: "14.3.1" | ||
device: "iPhone 14" | ||
os-version: "16.4" | ||
|
||
- sample-name: iOS-Swift | ||
artifact-name: maestro-ios-swift | ||
app: "Sample.app" | ||
test_suit: "Samples/iOS-Swift/.maestro" | ||
runs-on: macos-12 | ||
xcode: "13.4.1" | ||
device: "iPhone 8" | ||
os-version: "15.5" | ||
- sample-name: iOS-Swift | ||
artifact-name: maestro-ios-swift | ||
app: "Sample.app" | ||
test_suit: "Samples/iOS-Swift/.maestro" | ||
runs-on: macos-13 | ||
xcode: "14.3.1" | ||
device: "iPhone 14" | ||
os-version: "16.4" | ||
- sample-name: iOS-Swift | ||
artifact-name: maestro-ios-swift | ||
app: "Sample.app" | ||
test_suit: "Samples/iOS-Swift/.maestro" | ||
runs-on: macos-14 | ||
xcode: "15.4" | ||
device: "iPhone 15" | ||
os-version: "17.5" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create ${{matrix.device}} (${{matrix.os-version}}) Simulator using Xcode ${{matrix.xcode}} | ||
run: ./scripts/create-simulator.sh "${{matrix.xcode}}" "${{matrix.os-version}}" "${{matrix.device}}" | ||
- name: Install Maestro | ||
run: brew tap mobile-dev-inc/tap && brew install mobile-dev-inc/tap/maestro@1.38 | ||
- name: Install iDB Companion | ||
run: brew tap facebook/fb && brew install facebook/fb/idb-companion | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{matrix.artifact-name}} | ||
path: ${{ matrix.app }} | ||
- uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9 # pin@v3 | ||
with: | ||
model: ${{matrix.device}} | ||
os_version: ${{matrix.os-version}} | ||
- name: Run Maestro Flows | ||
env: | ||
# https://github.com/facebook/react-native/blob/24e7f7d25629a7af6d877a0b79fed2faaab96437/.github/actions/maestro-ios/action.yml#L57 | ||
MAESTRO_DRIVER_STARTUP_TIMEOUT: 1500000 # 25 min, CI can be slow at times | ||
MAX_ATTEMPTS: 3 # Maestro test suits re runs in case of flakyness | ||
run: | | ||
xcrun simctl install booted ${{ matrix.app}} | ||
# Avoid exit after command fails | ||
set +e | ||
# Add retries for flakyness | ||
CURR_ATTEMPT=0 | ||
RESULT=1 | ||
while [[ $CURR_ATTEMPT -lt $MAX_ATTEMPTS ]] && [[ $RESULT -ne 0 ]]; do | ||
maestro test ${{matrix.test_suit}} --format junit --debug-output .logs | ||
RESULT=$? | ||
done | ||
exit $RESULT | ||
- name: Store Maestro Logs | ||
uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: maestro-logs-${{matrix.sample-name}}-${{matrix.device}}-${{matrix.os-version}} | ||
path: .logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,3 +81,6 @@ Package.resolved | |
|
||
Cartfile.resolved | ||
*.log | ||
|
||
# Maestro Logs | ||
.logs/.maestro/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
appId: io.sentry.iOS-ObjectiveC | ||
--- | ||
- launchApp | ||
- tapOn: "crash" | ||
- launchApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Extra" | ||
- assertVisible: "{ category: ui.lifecycle, parentViewController: UITabBarController, beingPresented: false, window_isKeyWindow: true, is_window_rootViewController: false }" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Capture Error" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Capture NSException" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
env: | ||
MAESTRO_FLOW_NAME: "Check Frames Proportions" | ||
--- | ||
- launchApp | ||
- tapOn: "Extra" | ||
- tapOn: "Frames Count" | ||
- assertVisible: "Frames Count OK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
env: | ||
MAESTRO_FLOW_NAME: "Check Frames Proportions" | ||
--- | ||
- launchApp | ||
- tapOn: "Extra" | ||
- tapOn: "Frames Proportions" | ||
- assertVisible: "Frames Proportions OK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Extra" | ||
- tapOn: "Corrupt Envelope" | ||
- tapOn: "Close SDK" | ||
- tapOn: "Corrupt Envelope" | ||
- stopApp | ||
- launchApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Crash the app" | ||
- launchApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Transactions" | ||
- tapOn: "Load Image Controller" | ||
- assertVisible: "ASSERT: SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Transactions" | ||
- tapOn: "Nib Controller" | ||
- assertVisible: "a lonely button" | ||
- assertVisible: "ASSERT: SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Transactions" | ||
- tapOn: "Split Controller" | ||
- assertVisible: "ASSERT: SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Transactions" | ||
- tapOn: "Table Controller" | ||
- assertVisible: "Gradient Table View" | ||
- assertVisible: "ASSERT: SUCCESS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Transactions" | ||
- tapOn: "Lorem Ipsum Controller" | ||
- copyTextFrom: | ||
id: "LoremIpsumTextView" | ||
- assertTrue: "maestro.copiedText.startsWith('Lorem ipsum dolor sit amet')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
- launchApp | ||
- tapOn: "Transactions" | ||
- tapOn: "UIClick Transaction" |
10 changes: 10 additions & 0 deletions
10
Samples/iOS-Swift/.maestro/useAfterFreeAfterUIImageNamedEmptyString.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
appId: io.sentry.sample.iOS-Swift | ||
--- | ||
# We received a customer report that ASAN reports a use-after-free error after | ||
# calling UIImage(named:) with an empty string argument. Recording another | ||
# transaction leads to the ASAN error. | ||
- launchApp | ||
# this primes the state required according to the customer report, by setting a UIImageView.image property to a UIImage(named: "") | ||
- tapOn: "Use-after-free" | ||
# this causes another transaction to be recorded which hits the codepath necessary for the ASAN to trip | ||
- tapOn: "Extra" |
Oops, something went wrong.