Add job to run maestro tests using the iOS template (#45703)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45703

## Context
Running manual tests when preparing a release, it's time consuming.
We have to do the cherry picks, wait for CI to finish, and then manually test 8 configurations.

Maestro is a tool that allow us to run E2E tests automatically, and we can wire it to CI.

## Change

Add job to create a new iOS app from the template and run maestro test on it

Changelog:
[Internal] - Exploration to integrate maestro

Reviewed By: blakef

Differential Revision: D60282811

fbshipit-source-id: 2a1dcb1de09795bd0323357455e98a7fa379a2e7
This commit is contained in:
Riccardo Cipolleschi
2024-07-26 09:57:46 -07:00
committed by Facebook GitHub Bot
parent a11ab3b129
commit 806e5ffadc
+66
View File
@@ -213,6 +213,72 @@ jobs:
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./packages/rn-tester/.maestro/
test_e2e_ios_templateapp:
runs-on: macos-13
needs: build_npm_package
env:
HERMES_WS_DIR: /tmp/hermes
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
continue-on-error: true
strategy:
fail-fast: false
matrix:
jsengine: [Hermes, JSC]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Setup node.js
uses: ./.github/actions/setup-node
- name: Run yarn
uses: ./.github/actions/yarn-install-with-cache
- name: Setup ruby
uses: ruby/setup-ruby@v1.170.0
with:
ruby-version: 2.6.10
- name: Download Hermes
uses: actions/download-artifact@v4
with:
name: hermes-darwin-bin-Release
path: /tmp/react-native-tmp
- name: Download React Native Package
uses: actions/download-artifact@v4
with:
name: react-native-package
path: /tmp/react-native-tmp
- name: Print /tmp folder
run: ls -lR /tmp/react-native-tmp
- name: Prepare artifacts
run: |
REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz")
echo "React Native tgs is $REACT_NATIVE_PKG"
HERMES_PATH=$(find /tmp/react-native-tmp -type f -name "*.tar.gz")
echo "Hermes path is $HERMES_PATH"
# TODO: from next/latest/main convert to branch
node ./scripts/e2e/init-project-e2e.js --projectName RNTestProject --currentBranch 0.75-stable --directory /tmp/RNTestProject --pathToLocalReactNative $REACT_NATIVE_PKG
cd /tmp/RNTestProject/ios
bundle install
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH bundle exec pod install
xcrun xcodebuild \
-scheme "RNTestProject" \
-workspace RNTestProject.xcworkspace \
-configuration "Release" \
-sdk "iphonesimulator" \
-destination "generic/platform=iOS Simulator" \
-derivedDataPath "/tmp/RNTestProject"
- name: Run E2E Tests
uses: ./.github/actions/maestro-ios
with:
app-path: "/tmp/RNTestProject/Build/Products/Release-iphonesimulator/RNTestProject.app"
app-id: org.reactjs.native.example.RNTestProject
jsengine: ${{ matrix.jsengine }}
maestro-flow: ./scripts/e2e/.maestro/
build_hermesc_linux:
runs-on: ubuntu-latest
needs: prepare_hermes_workspace