Skip to content
Open
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
19 changes: 13 additions & 6 deletions .github/actions/maestro-ios/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Maestro E2E iOS
description: Runs E2E Tests on iOS using Maestro
description: Runs E2E Tests on iOS using Maestro against a remote simulator via sim-remote
inputs:
app-path:
required: true
Expand Down Expand Up @@ -33,11 +33,14 @@ runs:
- name: Installing Maestro
shell: bash
run: export MAESTRO_VERSION=2.6.1; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Installing Maestro dependencies
shell: bash
run: |
brew tap facebook/fb
brew install facebook/fb/idb-companion
- name: Install sim-remote
uses: software-mansion-labs/argent-cloud-actions/install@v1
- name: Acquire remote simulator
# Credentials come from the calling job's env. The machine is released
# by the action's post step, even if the job fails or is cancelled.
uses: software-mansion-labs/argent-cloud-actions/acquire@v1
with:
api-key: ${{ env.SIM_ROUTER_API_KEY }}
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
Expand All @@ -57,6 +60,10 @@ runs:
cd ${{ inputs.working-directory }}
yarn start &
sleep 5 # to give metro time to load
- name: Install Maestro shims
# Puts xcrun, xcodebuild, plutil, ... stand-ins on PATH so stock Maestro
# drives the remote simulator, and exports SIM_REMOTE_BIN for the script.
uses: software-mansion-labs/argent-cloud-actions/maestro-shims@v1
- name: Run tests
id: run-tests
shell: bash
Expand Down
20 changes: 20 additions & 0 deletions .github/workflow-scripts/maestro-ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,24 @@ function installAppOnSimulator(appPath, udid) {
childProcess.execSync(`xcrun simctl install "${udid}" "${appPath}"`);
}

// A remote simulator's localhost is the remote host, so Metro needs a tunnel.
function exposeMetroToSimulator(udid) {
const simRemote = process.env.SIM_REMOTE_BIN;
if (!simRemote) {
return;
}

console.log('Exposing local Metro port 8081 to the remote simulator');
childProcess.execSync(`"${simRemote}" reverse start "${udid}" 8081`, {
stdio: 'inherit',
});
}

function bringSimulatorInForeground() {
// Nothing to foreground on a remote simulator.
if (process.env.SIM_REMOTE_BIN) {
return;
}
console.log('Bringing simulator in foreground');
childProcess.execSync('open -a simulator');
}
Expand Down Expand Up @@ -266,6 +283,9 @@ async function main(args = process.argv.slice(2)) {
launchSimulator(simulator);
installAppOnSimulator(appPath, simulator.udid);
bringSimulatorInForeground();
if (isDebug) {
exposeMetroToSimulator(simulator.udid);
}
await launchAppOnSimulator(appId, simulator.udid, isDebug);
await executeFlows(appId, simulator.udid, maestroFlow, jsengine);
console.log('Test finished');
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/e2e-ios-rntester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ on:

jobs:
test:
runs-on: macos-26-large
runs-on: ubuntu-latest
env:
SIM_ROUTER_API_KEY: ${{ secrets.SIM_ROUTER_API_KEY }}
outputs:
status: ${{ steps.report-status.outputs.status }}
strategy:
Expand Down Expand Up @@ -45,7 +47,7 @@ jobs:
maestro-flow: ./packages/rn-tester/.maestro/
flavor: ${{ matrix.flavor }}
device-model: iPhone-17-Pro
device-os: iOS-26-2
device-os: iOS-26-5
- name: Report status
id: report-status
if: ${{ always() && steps.run-tests.outcome == 'failure' }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e-ios-templateapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:
value: ${{ jobs.report.outputs.status }}

jobs:
# Building the app needs Xcode, so it stays on a macOS runner. The E2E run
# itself drives a remote simulator via sim-remote, so it runs on Linux.
build:
runs-on: macos-26-large
strategy:
Expand Down Expand Up @@ -99,7 +101,9 @@ jobs:

test:
needs: build
runs-on: macos-26-large
runs-on: ubuntu-latest
env:
SIM_ROUTER_API_KEY: ${{ secrets.SIM_ROUTER_API_KEY }}
outputs:
status: ${{ steps.report-status.outputs.status }}
strategy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ appId: ${APP_ID}
id: 'ScrollViewMaintainVisibleContentPositionExample'
direction: DOWN
speed: 80
timeout: 90000
- tapOn:
id: 'ScrollViewMaintainVisibleContentPositionExample'
- waitForAnimationToEnd:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ appId: ${APP_ID}
id: 'ScrollViewMaintainVisibleContentPositionExample'
direction: DOWN
speed: 80
timeout: 90000
- tapOn:
id: 'ScrollViewMaintainVisibleContentPositionExample'
- waitForAnimationToEnd:
Expand Down