Use Xcode 16 for iOS UI Tests #143
Workflow file for this run
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: Run UI Tests Android | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: [ "main" ] | |
env: | |
BUILD_CONFIGURATION: Release | |
CSPROJ_TO_BUILD: samples/Plugin.Maui.UITestHelpers.Sample/Plugin.Maui.UITestHelpers.Sample.csproj | |
APP_TO_TEST: samples/Plugin.Maui.UITestHelpers.Sample/bin/Release/net8.0-android/com.companyname.uitesthelperssample-Signed.apk | |
CSPROJ_TO_TEST: samples/UITests.Android/UITests.Android.csproj | |
APP_ID: com.companyname.uitesthelperssample | |
TARGET_FRAMEWORK: net8.0-android | |
TEST_EMULATOR_NAME: UITestEmu | |
ANDROID_EMULATOR_IMAGE: system-images;android-33;default;x86_64 | |
SCREENCAPTURE_FOLDER: samples/UITests.Android/bin/Debug/net8.0 | |
ARTIFACTS_PATH: ${{ github.workspace }}/output | |
jobs: | |
ui-test-android: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Restore Tools | |
run: dotnet tool restore | |
- name: Restore Workload | |
run: dotnet workload restore --project ${{ env.CSPROJ_TO_BUILD }} | |
- name: Publish APK | |
run: dotnet publish ${{ env.CSPROJ_TO_BUILD }} -f ${{ env.TARGET_FRAMEWORK }} | |
- name: Boot Android emulator | |
run: | | |
dotnet android sdk install --package '${{ env.ANDROID_EMULATOR_IMAGE }}' | |
dotnet android avd create --name ${{ env.TEST_EMULATOR_NAME }} --sdk '${{ env.ANDROID_EMULATOR_IMAGE }}' --force | |
dotnet android avd start --name ${{ env.TEST_EMULATOR_NAME }} --wait-boot --gpu guest --no-snapshot --no-audio --no-boot-anim --no-window | |
dotnet android device list | |
- name: Install App | |
run: dotnet android device install --package ${{ env.APP_TO_TEST }} | |
- name: Install Appium | |
run: | | |
npm install -g appium | |
appium driver install uiautomator2 | |
- name: Run UI Tests | |
run: dotnet test ${{ env.CSPROJ_TO_TEST }} --environment APPIUM_LOG_FILE=${{ env.ARTIFACTS_PATH }}/appium-logs/appium.log --environment APPID="${{ env.APP_ID }}" | |
- name: Publish Artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: logs-and-screenshots | |
path: | | |
${{ env.ARTIFACTS_PATH }}/**/*.* | |
${{ env.SCREENCAPTURE_FOLDER }}/*.png |