Conversation
# Conflicts: # eng/pipelines/common/ui-tests.yml
# Conflicts: # src/Controls/tests/TestCases.Shared.Tests/UITest.cs
There was a problem hiding this comment.
Pull Request Overview
This PR updates the iOS simulator version from a hardcoded value to dynamically pick the latest available simulator, and adjusts related build and test scripts to use the new default version.
- Updated default iOS version constant and matching logic in UI tests.
- Switched
iosVersionsin multiple pipeline definitions to'latest'. - Aligned common templates and Cake scripts to use 18.4 as the resolved “latest” simulator version.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/UITest.cs | Updated _defaultiOSVersion, device-matching logic, and assertion |
| eng/pipelines/ui-tests.yml | Changed iosVersions to 'latest' |
| eng/pipelines/device-tests.yml | Changed iosVersions to 'latest' |
| eng/pipelines/common/ui-tests.yml | Bumped the resolved “latest” version to 18.4 in UI test templates |
| eng/pipelines/common/device-tests-jobs.yml | Added mapping for 'latest' to simulator-64 with API 18.4 |
| eng/devices/ios.cake | Updated DefaultVersion and DefaultTestDevice constant |
| ?? throw new InvalidOperationException("deviceName capability is missing or null."); | ||
|
|
||
| if (device.Contains(" Xs", StringComparison.OrdinalIgnoreCase) && platformVersion == "18.0") | ||
| environmentName = "ios"; |
There was a problem hiding this comment.
This environmentName = "ios"; statement is now unconditional and will override any other environment settings. It should be moved inside the if (device.Contains(" Xs" ...) && platformVersion == _defaultiOSVersion) block to preserve correct logic.
| environmentName = "ios"; |
| else | ||
| { | ||
| Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS 17.2) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}'. Follow the steps on the MAUI UI testing wiki."); | ||
| //Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS {_defaultiOSVersion}) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}' '{platformVersion}'. Follow the steps on the MAUI UI testing wiki."); |
There was a problem hiding this comment.
[nitpick] Instead of commenting out this assertion, update the failure message to reference the new default iOS version and re-enable the Assert.Fail so unsupported simulator configurations are caught during test setup.
| //Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS {_defaultiOSVersion}) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}' '{platformVersion}'. Follow the steps on the MAUI UI testing wiki."); | |
| Assert.Fail($"iOS visual tests should be run on iPhone Xs (iOS {_defaultiOSVersion}) or iPhone X (iOS 16.4) simulator images, but the current device is '{deviceName}' '{platformVersion}'. Follow the steps on the MAUI UI testing wiki."); |
| const string DefaultVersion = "18.0"; | ||
| const string DefaultTestDevice = $"ios-simulator-64_{DefaultVersion}"; | ||
| const string DefaultVersion = "18.4"; | ||
| const string DefaultTestDevice = $"ios-simulator-64"; |
There was a problem hiding this comment.
[nitpick] Dropping the version suffix from DefaultTestDevice may break scripts that expect a versioned identifier. Consider appending DefaultVersion or updating any downstream logic that parses this string.
| const string DefaultTestDevice = $"ios-simulator-64"; | |
| const string DefaultTestDevice = $"ios-simulator-64-{DefaultVersion}"; |
|
/backport to inflight/current |
|
Started backporting to inflight/current: https://github.com/dotnet/maui/actions/runs/16341556437 |
Description of Change
Try to pick the latest available iOS simulator based on Xcode select and not hardcoded