Skip to content

UITests

Bret Johnson edited this page May 19, 2023 · 37 revisions

Prerequisites

Android prerequisites

Ensure that you have the Android API 30 SDK installed, with the emulator image for Play store on x86/x64. By default, the tests use that. See screenshot below. If you want to use another image you can specify the --device argument, with something like --device="android-emulator-64_33" where the 64 means image x86_x64 and 33 indicates the API level.

image

Running from the command line (you can replace ./build.ps1 by dotnet cake)

./build.ps1 --target=dotnet-buildtasks --configuration="Release" --workloads=global

Android

./build.ps1 --target=dotnet-samples --configuration="Release" --workloads=global --android --usenuget=false
./build.ps1 -Script eng/devices/android.cake --target=uitest --project="src/Controls/tests/UITests/Controls.AppiumTests.csproj" --appproject="src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj" --configuration="Release"

Windows

./build.ps1 --target=dotnet-samples --configuration="Release" --windows --verbosity=diagnostic --workloads=global --usenuget=false
./build.ps1 -Script eng/devices/windows.cake --target=uitest --project="/Users/ruimarinho/dotnet/maui/src/Controls/tests/UITests/Controls.AppiumTests.csproj" --appproject="/Users/ruimarinho/dotnet/maui/src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj" --device="windows10" --apiversion="10.0.20348" --configuration="Release"

iOS

./build.ps1 --target=dotnet-samples --configuration="Release" --workloads=global --ios --usenuget=false
./build.ps1 -Script  eng/devices/ios.cake --target=uitest --project="/Users/ruimarinho/dotnet/maui/src/Controls/tests/UITests/Controls.AppiumTests.csproj" --appproject="/Users/ruimarinho/dotnet/maui/src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj" --device=ios-simulator-64 --apiversion="16.2" --configuration="Release"

Catalyst

./build.ps1 --target=dotnet-samples --configuration="Release" --catalyst --verbosity=diagnostic --workloads=global --usenuget=false
./build.ps1 -Script eng/devices/catalyst.cake --target=uitest --project="/Users/ruimarinho/dotnet/maui/src/Controls/tests/UITests/Controls.AppiumTests.csproj" --appproject="/Users/ruimarinho/dotnet/maui/src/Controls/samples/Controls.Sample.UITests/Controls.Sample.UITests.csproj" --apiversion="10.13" --configuration="Release" --device=mac

Running from the IDE

  • Deploy the app Control.Sample.UITests to your simulator, device or on your desktop.
  • Build the Controls.AppiumTests.csproj so the tests show up on the Test Explorer
  • Run the tests
Clone this wiki locally