GetNativePageSource helper method added #161
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 iOS | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: [ "main" ] | |
env: | |
# Release builds don't run on the Simulator | |
BUILD_CONFIGURATION: Debug | |
CSPROJ_TO_BUILD: samples/Plugin.Maui.UITestHelpers.Sample/Plugin.Maui.UITestHelpers.Sample.csproj | |
APP_TO_TEST: samples/Plugin.Maui.UITestHelpers.Sample/bin/Debug/net8.0-ios/iossimulator-arm64/Plugin.Maui.UITestHelpers.Sample.app | |
CSPROJ_TO_TEST: samples/UITests.iOS/UITests.iOS.csproj | |
APP_ID: com.companyname.uitesthelperssample | |
TARGET_FRAMEWORK: net8.0-ios | |
XCODE_VERSION: 16.0 | |
TEST_SIM_NAME: UITestSim | |
SCREENCAPTURE_FOLDER: samples/UITests.iOS/bin/Debug/net8.0 | |
ARTIFACTS_PATH: ${{ github.workspace }}/output | |
jobs: | |
ui-test-ios: | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode version | |
run: sudo xcode-select -s '/Applications/Xcode_${{ env.XCODE_VERSION }}.app/Contents/Developer' | |
- name: Restore Workload | |
run: dotnet workload restore --project ${{ env.CSPROJ_TO_BUILD }} | |
- name: Build App | |
run: dotnet build ${{ env.CSPROJ_TO_BUILD }} -f ${{ env.TARGET_FRAMEWORK }} -c ${{ env.BUILD_CONFIGURATION }} | |
- name: Install Appium | |
run: | | |
npm install -g appium | |
appium driver install xcuitest | |
- name: Create iOS Simulator | |
# This creates a iPhone 15 Pro Simulator with iOS 17.5 | |
run: | | |
#xcodes runtimes install "iOS 17.5" | |
#simudid=$(xcrun simctl create ${{ env.TEST_SIM_NAME }} com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro com.apple.CoreSimulator.SimRuntime.iOS-17-5) | |
simudid=$(xcrun simctl create ${{ env.TEST_SIM_NAME }} com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro) | |
echo "SIM_UDID=$(echo $simudid)" >> $GITHUB_ENV | |
echo "Created Simulator UDID: $simudid" | |
- name: Install App | |
run: | | |
xcrun simctl boot "${{ env.SIM_UDID }}" | |
xcrun simctl install "${{ env.SIM_UDID }}" "${{ env.APP_TO_TEST }}" | |
- name: Run UI Tests | |
# We're passing on the values we used to create the Simulator with to the test project to find the correct one | |
run: | | |
dotnet test ${{ env.CSPROJ_TO_TEST }} --environment SIMNAME="${{ env.TEST_SIM_NAME }}" --environment SIMID="${{ env.SIM_UDID }}" \ | |
--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 |