Skip to content

Commit

Permalink
Adds e2e testing on GitHub action for Android (#1126)
Browse files Browse the repository at this point in the history
## Description

Adds e2e testing on GitHub action for Android
  • Loading branch information
Ubax committed Sep 21, 2021
1 parent bde0132 commit 2fa86a9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/android-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test Android e2e
on:
pull_request:
paths:
- 'Example/**'
push:
branches:
- master
workflow_dispatch:
jobs:
test:
runs-on: macos-latest
timeout-minutes: 40
env:
WORKING_DIRECTORY: Example
concurrency:
group: android-e2e-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
- name: Install root node dependencies
run: yarn
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn build-e2e-android
- name: Run emulator and tests
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
api-level: 29
avd-name: e2e_emulator
script: yarn test-e2e-android
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: android-fail-screen-shoots
path: ${{ env.WORKING_DIRECTORY }}/artifacts
2 changes: 1 addition & 1 deletion Example/.detoxrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"emulator": {
"type": "android.emulator",
"device": {
"avdName": "Pixel_3a_API_30_x86"
"avdName": "e2e_emulator"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build-e2e-ios": "detox build --configuration ios.release",
"build-e2e-android": "detox build --configuration android.release",
"test-e2e-ios": "detox test --configuration ios.release",
"test-e2e-android": "detox test --configuration android.release"
"test-e2e-android": "detox test --configuration android.release --take-screenshots failing"
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.10",
Expand Down

0 comments on commit 2fa86a9

Please sign in to comment.