|
| 1 | +# Gradle |
| 2 | +# Build your Java project and run tests with Gradle using a Gradle wrapper script. |
| 3 | +# Add steps that analyze code, save build artifacts, deploy, and more: |
| 4 | +# https://docs.microsoft.com/azure/devops/pipelines/languages/java |
| 5 | +trigger: |
| 6 | + - main |
| 7 | + |
| 8 | +variables: |
| 9 | + ANDROID_EMU_NAME: test |
| 10 | + ANDROID_EMU_ABI: x86 |
| 11 | + ANDROID_EMU_TARGET: android-28 |
| 12 | + ANDROID_EMU_TAG: default |
| 13 | + XCODE_VERSION: 14.2 |
| 14 | + IOS_PLATFORM_VERSION: 16.2 |
| 15 | + IOS_DEVICE_NAME: iPhone 12 |
| 16 | + NODE_VERSION: 18.x |
| 17 | + JDK_VERSION: 1.8 |
| 18 | + |
| 19 | +jobs: |
| 20 | + - job: Android_E2E_Tests |
| 21 | + pool: |
| 22 | + vmImage: 'macOS-latest' |
| 23 | + steps: |
| 24 | + - template: .azure-template/bootstrap.yml |
| 25 | + - script: $NVM_DIR/versions/node/`node --version`/bin/appium driver install uiautomator2 |
| 26 | + displayName: Install UIA2 driver |
| 27 | + - script: | |
| 28 | + echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;$(ANDROID_EMU_TARGET);$(ANDROID_EMU_TAG);$(ANDROID_EMU_ABI)' |
| 29 | + echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n "$(ANDROID_EMU_NAME)" -k 'system-images;$(ANDROID_EMU_TARGET);$(ANDROID_EMU_TAG);$(ANDROID_EMU_ABI)' --force |
| 30 | + echo $ANDROID_HOME/emulator/emulator -list-avds |
| 31 | +
|
| 32 | + echo "Starting emulator" |
| 33 | + nohup $ANDROID_HOME/emulator/emulator -avd "$(ANDROID_EMU_NAME)" -no-snapshot -delay-adb > /dev/null 2>&1 & |
| 34 | + $ANDROID_HOME/platform-tools/adb wait-for-device |
| 35 | + $ANDROID_HOME/platform-tools/adb devices -l |
| 36 | + echo "Emulator started" |
| 37 | + displayName: Emulator configuration |
| 38 | + - script: | |
| 39 | + npm ci |
| 40 | + $NVM_DIR/versions/node/$(node --version)/bin/appium plugin install --source=local . |
| 41 | + nohup $NVM_DIR/versions/node/$(node --version)/bin/appium server -ka 800 --use-plugins=gestures -pa /wd/hub & |
| 42 | + $NVM_DIR/versions/node/$(node --version)/bin/wait-on http://127.0.0.1:4723/wd/hub/status |
| 43 | + PLATFORM=android npm run test-e2e |
| 44 | + displayName: Android E2E Test |
0 commit comments