added java client test #8
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
name: Appium Flutter Integration Driver | |
jobs: | |
Java_Test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
api-level: [29] | |
target: [google_apis] | |
steps: | |
- name: Check out my other private repo | |
uses: actions/checkout@master | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Setup Android SDK | |
uses: android-actions/[email protected] | |
- name: 'List files' | |
run: | | |
release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) | |
asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) | |
android_app=$(echo "$asset_urls" | head -n 1) | |
echo "$android_app" | |
ios_app=$(echo "$asset_urls" | tail -n 1) | |
echo "$ios_app" | |
curl -LO $android_app | |
ls ${{ github.workspace }} | |
echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- 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: Setup gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
arch: x86_64 | |
profile: Nexus 6 | |
working-directory: ${{ github.workspace }}/flutter-by/java | |
script: | | |
echo ${{ env }} | |
adb devices | |
node --version | |
mkdir ${{ github.workspace }}/appium-logs | |
npm install -g wait-on | |
npm install -g appium | |
appium driver install uiautomator2 | |
appium driver install --source npm appium-flutter-integration-driver | |
appium driver list | |
appium plugin list | |
adb logcat > ${{ github.workspace }}/appium-logs/flutter.txt & | |
./gradlew clean build | |
# appium server -pa=/wd/hub & wait-on http://127.0.0.1:4723/wd/hub/status && | |
- name: upload appium logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: appium-logs | |
path: ${{ github.workspace }}/flutter-by/java/build/reports | |
WDIO_Test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
api-level: [ 29 ] | |
target: [ google_apis ] | |
steps: | |
- name: Check out my other private repo | |
uses: actions/checkout@master | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Setup Android SDK | |
uses: android-actions/[email protected] | |
- name: 'List files' | |
run: | | |
release_info=$(curl -s https://api.github.com/repos/AppiumTestDistribution/appium-flutter-server/releases/latest) | |
asset_urls=$(echo "$release_info" | grep "browser_download_url" | cut -d '"' -f 4) | |
android_app=$(echo "$asset_urls" | head -n 1) | |
echo "$android_app" | |
ios_app=$(echo "$asset_urls" | tail -n 1) | |
echo "$ios_app" | |
curl -LO $android_app | |
ls ${{ github.workspace }} | |
echo "APP_PATH=${{ github.workspace }}/app-debug.apk" >> $GITHUB_ENV | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- 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: run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
target: ${{ matrix.target }} | |
arch: x86_64 | |
profile: Nexus 6 | |
working-directory: ${{ github.workspace }}/flutter-by/wdio-flutter-by-service | |
script: | | |
echo ${{ env }} | |
adb devices | |
node --version | |
mkdir ${{ github.workspace }}/appium-logs | |
npm install | |
npm install -g wait-on | |
npm install -g appium | |
appium driver list | |
appium plugin list | |
adb logcat > ${{ github.workspace }}/appium-logs/flutter.txt & | |
APP_PATH=${{ env.APP_PATH }} npm run wdio-android | |
# appium server -pa=/wd/hub & wait-on http://127.0.0.1:4723/wd/hub/status && | |
- name: upload appium logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: appium-logs | |
path: ${{ github.workspace }}/flutter-by/java/build/reports |