Change wdOpts #40
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
name: Android App Test | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install app dependencies | |
run: | | |
npm ci | |
- name: Install test dependencies | |
run: | | |
npm i --save-dev webdriverio | |
- name: Install Appium driver | |
run: | | |
npx appium driver install uiautomator2 | |
- name: Start Appium server | |
run: | | |
npx appium & | |
sleep 30 | |
- name: Enable KVM group perms | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: Build Framework7 app | |
run: | | |
npm run build | |
- name: Install Cordova | |
run: | | |
npm install -g cordova | |
- name: Add Android platform to Cordova | |
run: | | |
cordova platform add android | |
- name: Build Cordova app | |
run: | | |
cordova build android | |
- name: Set up emulator, install apk and run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
script: | | |
echo "Emulator has started" | |
adb install platforms/android/app/build/outputs/apk/debug/app-debug.apk | |
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82' | |
node src/tests/test.js | |
env: | |
API_KEY: ${{ secrets.API_KEY }} |