-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): Switch from Appium to Maestro (#4210)
- Loading branch information
1 parent
0966e69
commit 4c3c7db
Showing
17 changed files
with
178 additions
and
383 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 |
---|---|---|
|
@@ -14,6 +14,8 @@ concurrency: | |
|
||
env: | ||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
MAESTRO_VERSION: '1.39.0' | ||
IOS_DEVICE: 'iPhone 14' | ||
|
||
jobs: | ||
diff_check: | ||
|
@@ -168,12 +170,10 @@ jobs: | |
rn-version: '0.76.0' | ||
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/ | ||
runtime: 'latest' | ||
device: 'iPhone 14' | ||
- platform: ios | ||
rn-version: '0.65.3' | ||
runs-on: macos-13 | ||
runtime: 'latest' | ||
device: 'iPhone 14' | ||
- platform: android | ||
runs-on: ubuntu-latest | ||
exclude: | ||
|
@@ -308,12 +308,10 @@ jobs: | |
rn-version: '0.76.0' | ||
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/ | ||
runtime: 'latest' | ||
device: 'iPhone 14' | ||
- platform: ios | ||
rn-version: '0.65.3' | ||
runs-on: macos-latest | ||
runtime: 'latest' | ||
device: 'iPhone 14' | ||
- platform: android | ||
runs-on: ubuntu-latest | ||
exclude: | ||
|
@@ -329,12 +327,18 @@ jobs: | |
- rn-version: '0.76.0' | ||
platform: 'ios' | ||
rn-architecture: 'new' | ||
env: | ||
PLATFORM: ${{ matrix.platform }} | ||
DEVICE: ${{ matrix.device }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Maestro | ||
uses: dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # [email protected] | ||
with: | ||
version: ${{env.MAESTRO_VERSION}} | ||
|
||
- name: Install iDB Companion | ||
if: ${{ matrix.platform == 'ios' }} | ||
run: brew tap facebook/fb && brew install facebook/fb/idb-companion | ||
|
||
- uses: ./.github/actions/disk-cleanup | ||
if: ${{ matrix.platform == 'android' }} | ||
|
||
|
@@ -400,11 +404,10 @@ jobs: | |
-timezone US/Pacific | ||
script: ./dev-packages/e2e-tests/cli.mjs ${{ matrix.platform }} --test | ||
|
||
- uses: actions/cache@v4 | ||
- uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9 # pin@v3 | ||
if: ${{ matrix.platform == 'ios' }} | ||
with: | ||
path: test/e2e/DerivedData/Build/Products/Debug-iphonesimulator/WebDriverAgentRunner-Runner.app | ||
key: appium-webdriveragent-${{ hashFiles('test/e2e/yarn.lock') }} | ||
model: ${{ env.IOS_DEVICE }} | ||
|
||
- name: Run tests on iOS | ||
if: ${{ matrix.platform == 'ios' }} | ||
|
@@ -415,6 +418,4 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-logs | ||
path: | | ||
test/e2e/*.log | ||
test/e2e/*.png | ||
path: ./dev-packages/e2e-tests/maestro-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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
*.app | ||
*.apk | ||
|
||
react-native-versions | ||
/react-native-versions | ||
/maestro-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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
appId: ${APP_ID} | ||
--- | ||
- runFlow: utils/launchTestAppClear.yml | ||
- tapOn: "Capture Exception" | ||
- runFlow: utils/assertEventIdVisible.yml |
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: ${APP_ID} | ||
--- | ||
- runFlow: utils/launchTestAppClear.yml | ||
- tapOn: "Capture Message" | ||
- runFlow: utils/assertEventIdVisible.yml |
5 changes: 5 additions & 0 deletions
5
dev-packages/e2e-tests/maestro/captureUnhandledPromiseRejection.yml
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: ${APP_ID} | ||
--- | ||
- runFlow: utils/launchTestAppClear.yml | ||
- tapOn: "Unhandled Promise Rejection" | ||
- runFlow: utils/assertEventIdVisible.yml |
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: ${APP_ID} | ||
--- | ||
- runFlow: utils/launchTestAppClear.yml | ||
- tapOn: "Close" | ||
|
||
- assertNotVisible: | ||
id: "eventId" |
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: ${APP_ID} | ||
--- | ||
- runFlow: utils/launchTestAppClear.yml | ||
- tapOn: "Crash" | ||
|
||
- launchApp | ||
- assertVisible: "E2E Tests Ready" |
10 changes: 10 additions & 0 deletions
10
dev-packages/e2e-tests/maestro/utils/assertEventIdVisible.yml
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: ${APP_ID} | ||
--- | ||
- extendedWaitUntil: | ||
visible: | ||
id: "eventId" | ||
timeout: 600_000 # 10 minutes | ||
|
||
- copyTextFrom: | ||
id: "eventId" | ||
- assertTrue: ${maestro.copiedText} |
10 changes: 10 additions & 0 deletions
10
dev-packages/e2e-tests/maestro/utils/launchTestAppClear.yml
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: ${APP_ID} | ||
--- | ||
- launchApp: | ||
clearState: true | ||
arguments: | ||
sentryAuthToken: ${SENTRY_AUTH_TOKEN} | ||
|
||
- extendedWaitUntil: | ||
visible: "E2E Tests Ready" | ||
timeout: 120_000 # 2 minutes |
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
Oops, something went wrong.