Skip to content

Commit 33d1129

Browse files
ref(sample-e2e): v7: Migrate from Detox to Maestro (#5473)
* chore(sample-e2e): Migrate from Detox to Maestro * fix set dsn script path * fix: Update script paths after detox-to-maestro migration The set-dsn scripts were moved from scripts/detox/ to scripts/ during the migration * Update script paths * Fix tests * Fix test failure * Fix idle issue * fix(e2e): Fix Maestro flows for captureMessage and captureSpaceflightNewsScreen - Add scrollUntilVisible for 'Capture message' button (might be off-screen) - Add proper waiting and scrolling for SpaceflightNewsScreen to trigger auto-load - Wait for 'Load More Articles' button to appear after autoLoadCount threshold * chore(e2e-sample): Increase Maestro driver startup timeout (cherry picked from commit ee429b5) * increase timeout * Increase timeouts on Android too --------- Co-authored-by: Krystof Woldrich <krystof.woldrich@sentry.io>
1 parent 84390fb commit 33d1129

File tree

49 files changed

+277
-855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+277
-855
lines changed

.github/workflows/sample-application.yml

Lines changed: 4 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ concurrency:
1515
env:
1616
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
1717
MAESTRO_VERSION: '2.0.10'
18+
MAESTRO_DRIVER_STARTUP_TIMEOUT: 90000 # Increase timeout from default 30s to 90s for CI stability
1819
RN_SENTRY_POD_NAME: RNSentry
1920
IOS_APP_ARCHIVE_PATH: sentry-react-native-sample.app.zip
2021
ANDROID_APP_ARCHIVE_PATH: sentry-react-native-sample.apk.zip
@@ -82,7 +83,7 @@ jobs:
8283
- uses: ruby/setup-ruby@v1
8384
if: ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
8485
with:
85-
working-directory: ${{ matrix.platform == 'ios' && env.REACT_NATIVE_SAMPLE_PATH || ' samples/react-native-macos' }}
86+
working-directory: ${{ matrix.platform == 'ios' && env.REACT_NATIVE_SAMPLE_PATH || 'samples/react-native-macos' }}
8687
ruby-version: '3.3.0' # based on what is used in the sample
8788
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
8889
cache-version: 1 # cache the installed gems
@@ -128,7 +129,7 @@ jobs:
128129
export RN_ARCHITECTURE="${{ matrix.rn-architecture }}"
129130
[[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='release' || export CONFIG='debug'
130131
131-
./scripts/detox/set-dsn-aos.mjs
132+
./scripts/set-dsn-aos.mjs
132133
./scripts/build-android.sh -PreactNativeArchitectures=x86
133134
134135
- name: Build iOS App
@@ -137,7 +138,7 @@ jobs:
137138
run: |
138139
[[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug'
139140
140-
./scripts/detox/set-dsn-ios.mjs
141+
./scripts/set-dsn-ios.mjs
141142
./scripts/build-ios.sh
142143
143144
- name: Build macOS App
@@ -198,138 +199,6 @@ jobs:
198199
name: build-sample-${{ matrix.rn-architecture }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs
199200
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/${{ matrix.platform }}/*.log
200201

201-
test-detox:
202-
name: ${{ matrix.job-name }}
203-
runs-on: ${{ matrix.runs-on }}
204-
needs: [diff_check, build]
205-
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
206-
strategy:
207-
# we want that the matrix keeps running, default is to cancel them if it fails.
208-
fail-fast: false
209-
matrix:
210-
include:
211-
- job-name: 'Test iOS Release Auto Init'
212-
platform: ios
213-
runs-on: macos-15
214-
rn-architecture: 'new'
215-
ios-use-frameworks: 'no-frameworks'
216-
build-type: 'production'
217-
test-command: 'yarn test-ios-auto' # tests native auto init from JS
218-
219-
- job-name: 'Test iOS Release Manual Init'
220-
platform: ios
221-
runs-on: macos-15
222-
rn-architecture: 'new'
223-
ios-use-frameworks: 'no-frameworks'
224-
build-type: 'production'
225-
test-command: 'yarn test-ios-manual'
226-
227-
- job-name: 'Test Android Release Manual Init'
228-
platform: android
229-
runs-on: ubuntu-latest
230-
rn-architecture: 'new'
231-
build-type: 'production'
232-
test-command: 'yarn test-android-manual'
233-
234-
steps:
235-
- uses: actions/checkout@v4
236-
237-
- name: Download iOS App Archive
238-
if: ${{ matrix.platform == 'ios' }}
239-
uses: actions/download-artifact@v4
240-
with:
241-
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.platform }}
242-
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
243-
244-
- name: Download Android APK
245-
if: ${{ matrix.platform == 'android' }}
246-
uses: actions/download-artifact@v4
247-
with:
248-
name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.platform }}
249-
path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
250-
251-
- name: Unzip iOS App Archive
252-
if: ${{ matrix.platform == 'ios' }}
253-
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
254-
run: unzip ${{ env.IOS_APP_ARCHIVE_PATH }}
255-
256-
- name: Unzip Android APK
257-
if: ${{ matrix.platform == 'android' }}
258-
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
259-
run: unzip ${{ env.ANDROID_APP_ARCHIVE_PATH }}
260-
261-
- name: Enable Corepack
262-
run: |
263-
npm install -g corepack@0.29.4
264-
corepack enable
265-
- uses: actions/setup-node@v4
266-
with:
267-
node-version: 18
268-
cache: 'yarn'
269-
cache-dependency-path: yarn.lock
270-
271-
- name: Install JS Dependencies
272-
run: yarn install
273-
274-
- name: Install Detox
275-
run: npm install -g detox-cli@20.0.0
276-
277-
- name: Install Apple Simulator Utilities
278-
if: ${{ matrix.platform == 'ios' }}
279-
run: |
280-
brew tap wix/brew
281-
brew install applesimutils
282-
283-
- name: Setup KVM
284-
if: ${{ matrix.platform == 'android' }}
285-
shell: bash
286-
run: |
287-
# check if virtualization is supported...
288-
sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
289-
# allow access to KVM to run the emulator
290-
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
291-
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
292-
sudo udevadm control --reload-rules
293-
sudo udevadm trigger --name-match=kvm
294-
295-
- uses: futureware-tech/simulator-action@dab10d813144ef59b48d401cd95da151222ef8cd # pin@v4
296-
if: ${{ matrix.platform == 'ios' }}
297-
with:
298-
# the same envs are used by Detox ci.sim configuration
299-
model: ${{ env.IOS_DEVICE }}
300-
os_version: ${{ env.IOS_VERSION }}
301-
302-
- name: Run Detox iOS Tests
303-
if: ${{ matrix.platform == 'ios' }}
304-
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
305-
run: ${{ matrix.test-command }}
306-
307-
- name: Run tests on Android
308-
if: ${{ matrix.platform == 'android' }}
309-
env:
310-
# used by Detox ci.android configuration
311-
ANDROID_AVD_NAME: 'test' # test is default reactivecircus/android-emulator-runner name
312-
ANDROID_TYPE: 'android.emulator'
313-
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # pin@v2.33.0
314-
with:
315-
api-level: ${{ env.ANDROID_API_LEVEL }}
316-
force-avd-creation: false
317-
disable-animations: true
318-
disable-spellchecker: true
319-
target: 'aosp_atd'
320-
channel: canary # Necessary for ATDs
321-
emulator-options: >
322-
-no-window
323-
-no-snapshot-save
324-
-gpu swiftshader_indirect
325-
-noaudio
326-
-no-boot-anim
327-
-camera-back none
328-
-camera-front none
329-
-timezone US/Pacific
330-
working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }}
331-
script: ${{ matrix.test-command }}
332-
333202
test:
334203
name: Test ${{ matrix.platform }} ${{ matrix.build-type }} REV2
335204
runs-on: ${{ matrix.runs-on }}

samples/react-native/e2e-detox/captureTransaction.test.ts

Lines changed: 0 additions & 206 deletions
This file was deleted.

samples/react-native/e2e-detox/jest.config.base.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)