Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/devices/ios.cake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#addin nuget:?package=Cake.AppleSimulator&version=0.2.0
#load "./uitests-shared.cake"

const string DefaultVersion = "18.4";
const string DefaultTestDevice = $"ios-simulator-64";
const string DefaultVersion = "18.0";
const string DefaultTestDevice = $"ios-simulator-64_{DefaultVersion}";

// Required arguments
string DEFAULT_IOS_PROJECT = "../../src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj";
Expand Down
3 changes: 0 additions & 3 deletions eng/pipelines/common/device-tests-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ jobs:
${{ if contains(version, 'device') }}:
device: ios-device
apiVersion: ${{ replace(version, 'device-', '') }}
${{ if contains(version, 'latest') }}:
device: ios-simulator-64
apiVersion: 18.4
${{ else }}:
device: ios-simulator-64_${{ replace(version, 'simulator-', '') }}
apiVersion: ${{ replace(version, 'simulator-', '') }}
Expand Down
10 changes: 5 additions & 5 deletions eng/pipelines/common/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ stages:
parameters:
platform: ios
${{ if eq(version, 'latest') }}:
version: 18.4
version: 16.4
${{ if ne(version, 'latest') }}:
version: ${{ version }}
path: ${{ project.ios }}
Expand Down Expand Up @@ -194,7 +194,7 @@ stages:
parameters:
platform: ios
${{ if eq(version, 'latest') }}:
version: 18.4
version: 16.4
${{ if ne(version, 'latest') }}:
version: ${{ version }}
path: ${{ project.ios }}
Expand Down Expand Up @@ -232,7 +232,7 @@ stages:
parameters:
platform: ios
${{ if eq(version, 'latest') }}:
version: 18.4
version: 16.4
${{ if ne(version, 'latest') }}:
version: ${{ version }}
path: ${{ project.ios }}
Expand Down Expand Up @@ -276,7 +276,7 @@ stages:
parameters:
platform: ios
${{ if eq(version, 'latest') }}:
version: 18.4
version: 17.2
${{ if ne(version, 'latest') }}:
version: ${{ version }}
path: ${{ project.ios }}
Expand Down Expand Up @@ -347,7 +347,7 @@ stages:
- template: ui-tests-steps.yml
parameters:
platform: catalyst
version: "15.3"
version: "13.1"
device: mac
path: ${{ project.mac }}
app: ${{ project.app }}
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ stages:
targetFrameworkVersion: ${{ targetFrameworkVersion }}
${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}:
androidApiLevels: [ 33, 30, 29, 28, 27, 26, 25, 24, 23 ]
iosVersions: [ 'latest']
iosVersions: [ 'simulator-18.0']
catalystVersions: [ 'latest' ]
windowsVersions: ['packaged', 'unpackaged']
provisionatorChannel: ${{ parameters.provisionatorChannel }}
skipProvisioning: ${{ or(not(parameters.UseProvisionator), false) }}
${{ else }}:
androidApiLevels: [ 33, 23 ]
iosVersions: [ 'latest' ]
iosVersions: [ 'simulator-18.0' ]
catalystVersions: [ 'latest' ]
windowsVersions: ['packaged', 'unpackaged']
provisionatorChannel: ${{ parameters.provisionatorChannel }}
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ stages:
agentPoolAccessToken: $(AgentPoolAccessToken)
${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}:
androidApiLevels: [ 30 ]
iosVersions: [ 'latest' ]
iosVersions: [ '18.0' ]
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ else }}:
androidApiLevels: [ 30 ]
iosVersions: [ 'latest' ]
iosVersions: [ '18.0' ]
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ if parameters.CompatibilityTests }}:
runCompatibilityTests: true
Expand Down
10 changes: 3 additions & 7 deletions src/Controls/tests/TestCases.Shared.Tests/UITest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ namespace Microsoft.Maui.TestCases.Tests
#if ANDROID
[TestFixture(TestDevice.Android)]
#elif IOSUITEST
[TestFixture(TestDevice.iOS)]
[TestFixture(TestDevice.iOS)]
#elif MACUITEST
[TestFixture(TestDevice.Mac)]
#elif WINTEST
[TestFixture(TestDevice.Windows)]
#endif
public abstract class UITest : UITestBase
{
string _defaultiOSVersion = "18.4";

protected const int SetupMaxRetries = 1;
readonly VisualRegressionTester _visualRegressionTester;
readonly IImageEditorFactory _imageEditorFactory;
Expand Down Expand Up @@ -243,9 +241,7 @@ but both can happen.
var device = (string?)((AppiumApp)App).Driver.Capabilities.GetCapability("deviceName")
?? throw new InvalidOperationException("deviceName capability is missing or null.");

environmentName = "ios";

if (device.Contains(" Xs", StringComparison.OrdinalIgnoreCase) && platformVersion == _defaultiOSVersion)
if (device.Contains(" Xs", StringComparison.OrdinalIgnoreCase) && platformVersion == "18.0")
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding the iOS version "18.0" directly in the condition creates a magic number that will need to be updated in multiple places when versions change. Consider using a constant to make future version updates easier to maintain.

Suggested change
if (device.Contains(" Xs", StringComparison.OrdinalIgnoreCase) && platformVersion == "18.0")
if (device.Contains(" Xs", StringComparison.OrdinalIgnoreCase) && platformVersion == IOS_VERSION_18_0)

Copilot uses AI. Check for mistakes.
{
environmentName = "ios";
}
Expand All @@ -259,7 +255,7 @@ but both can happen.
}
else
{
//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 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.");
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message contains hardcoded iOS versions (17.2 and 16.4) that may become inconsistent with the actual version check above (18.0). This creates a maintenance burden where multiple version references need to be kept in sync.

Copilot uses AI. Check for mistakes.
}
break;

Expand Down
Loading