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.0";
const string DefaultTestDevice = $"ios-simulator-64_{DefaultVersion}";
const string DefaultVersion = "18.4";
const string DefaultTestDevice = $"ios-simulator-64";
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

[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.

Suggested change
const string DefaultTestDevice = $"ios-simulator-64";
const string DefaultTestDevice = $"ios-simulator-64-{DefaultVersion}";

Copilot uses AI. Check for mistakes.

// Required arguments
string DEFAULT_IOS_PROJECT = "../../src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj";
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/common/device-tests-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ 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: 16.4
version: 18.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: 16.4
version: 18.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: 16.4
version: 18.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: 17.2
version: 18.4
${{ 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: "13.1"
version: "15.3"
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: [ 'simulator-18.0']
iosVersions: [ 'latest']
catalystVersions: [ 'latest' ]
windowsVersions: ['packaged', 'unpackaged']
provisionatorChannel: ${{ parameters.provisionatorChannel }}
skipProvisioning: ${{ or(not(parameters.UseProvisionator), false) }}
${{ else }}:
androidApiLevels: [ 33, 23 ]
iosVersions: [ 'simulator-18.0' ]
iosVersions: [ 'latest' ]
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: [ '18.0' ]
iosVersions: [ 'latest' ]
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ else }}:
androidApiLevels: [ 30 ]
iosVersions: [ '18.0' ]
iosVersions: [ 'latest' ]
provisionatorChannel: ${{ parameters.provisionatorChannel }}
${{ if parameters.CompatibilityTests }}:
runCompatibilityTests: true
Expand Down
10 changes: 7 additions & 3 deletions src/Controls/tests/TestCases.Shared.Tests/UITest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ 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 @@ -241,7 +243,9 @@ but both can happen.
var device = (string?)((AppiumApp)App).Driver.Capabilities.GetCapability("deviceName")
?? throw new InvalidOperationException("deviceName capability is missing or null.");

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

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
environmentName = "ios";

Copilot uses AI. Check for mistakes.

if (device.Contains(" Xs", StringComparison.OrdinalIgnoreCase) && platformVersion == _defaultiOSVersion)
{
environmentName = "ios";
}
Expand All @@ -255,7 +259,7 @@ but both can happen.
}
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.");
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

[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.

Suggested change
//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.");

Copilot uses AI. Check for mistakes.
}
break;

Expand Down
Loading