diff --git a/eng/pipelines/arcade/setup-test-env.yml b/eng/pipelines/arcade/setup-test-env.yml index 5ea9b6c34dd7..89ea71770f2b 100644 --- a/eng/pipelines/arcade/setup-test-env.yml +++ b/eng/pipelines/arcade/setup-test-env.yml @@ -3,6 +3,8 @@ parameters: buildConfig: Debug repoLogPath: $(Build.Arcade.LogsPath) installPackageArtifacts: true + buildMSBuildTasks: false + androidSdkRoot: $(ANDROID_SDK_ROOT) steps: - checkout: self @@ -11,6 +13,17 @@ steps: - template: /eng/pipelines/common/setup-jdk.yml +- script: | + sudo xcode-select -s /Applications/Xcode_$(REQUIRED_XCODE).app + xcrun xcode-select --print-path + xcodebuild -version + sudo xcodebuild -license accept + sudo xcodebuild -downloadPlatform iOS + sudo xcodebuild -runFirstLaunch + displayName: Select Xcode Version + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + timeoutInMinutes: 30 + - task: UseDotNet@2 displayName: 'Use .NET SDK $(DOTNET_VERSION)' inputs: @@ -18,7 +31,6 @@ steps: version: $(DOTNET_VERSION) includePreviewVersions: true - - ${{ if eq(parameters.installPackageArtifacts, true) }}: - task: DownloadPipelineArtifact@2 displayName: Download PackageArtifacts @@ -33,11 +45,23 @@ steps: projects: ${{ parameters.mauiSourcePath }}/src/DotNet/DotNet.csproj arguments: '-p:InstallWorkloadPacks=false -c ${{ parameters.buildConfig }} -bl:${{ parameters.repoLogPath }}/install-dotnet.binlog' - - task: DotNetCoreCLI@2 - displayName: Install dotnet preview workloads from PackageArtifacts - inputs: - projects: ${{ parameters.mauiSourcePath }}/src/DotNet/DotNet.csproj - arguments: '-t:Install -c ${{ parameters.buildConfig }} -bl:${{ parameters.repoLogPath }}/install-dotnet.binlog' + - template: /eng/pipelines/common/run-dotnet-preview.yml + parameters: + displayName: Install dotnet preview workloads from PackageArtifacts + mauiSourcePath: ${{ parameters.mauiSourcePath }} + project: ${{ parameters.mauiSourcePath }}/src/DotNet/DotNet.csproj + arguments: '-t:Install -c ${{ parameters.buildConfig }} -bl:${{ parameters.repoLogPath }}/install-dotnet-workload.binlog' + + - pwsh: | + Get-ChildItem artifacts -Filter 'Microsoft.Maui.Controls.*.nupkg' | Where-Object { $_.Name -match '^Microsoft\.Maui\.Controls\.([\d\.]+.*)\.nupkg$' } + $version = $Matches.1 + if (!$version) { + Write-Error "Failed to extract the version from the nupkgs" + exit 1 + } + Write-Host "Found .NET MAUI version (MAUI_PACKAGE_VERSION): $version" + Write-Host "##vso[task.setvariable variable=MAUI_PACKAGE_VERSION]$version" + displayName: Read the .NET MAUI version from the nugets - ${{ else }}: - task: DotNetCoreCLI@2 @@ -46,9 +70,23 @@ steps: projects: ${{ parameters.mauiSourcePath }}/src/DotNet/DotNet.csproj arguments: '-c ${{ parameters.buildConfig }} -bl:${{ parameters.repoLogPath }}/install-dotnet.binlog' +- template: /eng/pipelines/common/setup-android-dependencies.yml + parameters: + mauiSourcePath: ${{ parameters.mauiSourcePath }} + repoLogPath: ${{ parameters.repoLogPath }} + androidSdkRoot: ${{ parameters.androidSdkRoot }} + +- ${{ if eq(parameters.buildMSBuildTasks, true) }}: - template: /eng/pipelines/common/run-dotnet-preview.yml parameters: displayName: Build MSBuild Tasks mauiSourcePath: ${{ parameters.mauiSourcePath }} project: ${{ parameters.mauiSourcePath }}/Microsoft.Maui.BuildTasks.slnf arguments: '-c ${{ parameters.buildConfig }} -bl:${{ parameters.repoLogPath }}/Microsoft.Maui.BuildTasks.binlog' + +- template: /eng/pipelines/common/run-dotnet-preview.yml + parameters: + displayName: Restore dotnet preview tools + mauiSourcePath: ${{ parameters.mauiSourcePath }} + command: tool + arguments: restore diff --git a/eng/pipelines/arcade/stage-integration-tests.yml b/eng/pipelines/arcade/stage-integration-tests.yml new file mode 100644 index 000000000000..ad3d73f54f65 --- /dev/null +++ b/eng/pipelines/arcade/stage-integration-tests.yml @@ -0,0 +1,48 @@ +parameters: + stageDependsOn: [] + jobMatrix: [] # Should define jobMatrix.name, jobMatrix.displayName, jobMatrix.pool, jobMatrix.timeout, jobMatrix.testCategory + mauiSourcePath: $(Build.SourcesDirectory) + buildConfig: Debug + repoLogPath: $(Build.Arcade.LogsPath) + publishTaskPrefix: '1ES.' + +stages: +- stage: IntegrationTests + displayName: Run Integration Tests + dependsOn: ${{ parameters.stageDependsOn }} + jobs: + - ${{ each job in parameters.jobMatrix }}: + - job: ${{ job.name }} + displayName: ${{ job.testCategory }} ${{ job.pool.os }} + pool: ${{ job.pool }} + timeoutInMinutes: ${{ job.timeout }} + steps: + - template: /eng/pipelines/arcade/setup-test-env.yml + parameters: + mauiSourcePath: ${{ parameters.mauiSourcePath }} + buildConfig: ${{ parameters.buildConfig }} + repoLogPath: ${{ parameters.repoLogPath }} + + - template: /eng/pipelines/common/run-dotnet-preview.yml + parameters: + displayName: Run Integration Tests - ${{ job.testCategory }} ${{ job.pool.os }} + mauiSourcePath: ${{ parameters.mauiSourcePath }} + command: test + project: ${{ parameters.mauiSourcePath }}/src/TestUtils/src/Microsoft.Maui.IntegrationTests/Microsoft.Maui.IntegrationTests.csproj + arguments: '-c ${{ parameters.buildConfig }} --filter "Category=${{ job.testCategory }}" --logger trx --results-directory $(Agent.TempDirectory)/Microsoft.Maui.IntegrationTests' + useExitCodeForErrors: true + + - task: PublishTestResults@2 + inputs: + testResultsFormat: VSTest + testResultsFiles: $(Agent.TempDirectory)/Microsoft.Maui.IntegrationTests/*.trx + testRunTitle: Integration Tests - ${{ job.testCategory }} ${{ job.pool.os }} + + - task: ${{ parameters.publishTaskPrefix }}PublishPipelineArtifact@1 + displayName: Publish Logs + inputs: + targetPath: ${{ parameters.repoLogPath }} + artifact: Logs - Integration Tests ${{ job.testCategory }} ${{ job.pool.os }} $(System.JobAttempt) + condition: always() + + - template: /eng/pipelines/common/fail-on-issue.yml diff --git a/eng/pipelines/arcade/stage-pack.yml b/eng/pipelines/arcade/stage-pack.yml index 5ec8f809cc8a..749d384e38cc 100644 --- a/eng/pipelines/arcade/stage-pack.yml +++ b/eng/pipelines/arcade/stage-pack.yml @@ -11,9 +11,9 @@ parameters: - name: sourceIndexParams type: object default: [] -- name: publishTaskPrefix - type: string - default: '1ES.' +- name: runAsPublic + type: boolean + default: false stages: - stage: Pack @@ -57,7 +57,7 @@ stages: displayName: 🛠️ Build # Run on public pipeline - - ${{ if eq(variables['_RunAsPublic'], 'true') }}: + - ${{ if eq(parameters.runAsPublic, 'true') }}: - script: $(_buildScript) -restore -pack -publish $(_PublishArgs) @@ -67,7 +67,7 @@ stages: displayName: Pack & Publish # Run on internal pipeline - - ${{ if eq(variables['_RunAsInternal'], 'true') }}: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - script: $(_buildScript) -restore -pack -sign $(_SignArgs) @@ -88,7 +88,7 @@ stages: $(_OfficialBuildIdArgs) displayName: Build Workloads - - task: ${{ parameters.publishTaskPrefix }}PublishPipelineArtifact@1 + - task: 1ES.PublishPipelineArtifact@1 displayName: Publish VSDrop MSIs inputs: targetPath: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)' diff --git a/eng/pipelines/arcade/stage-unit-tests.yml b/eng/pipelines/arcade/stage-unit-tests.yml index d034ff51cebc..7b1933a481e5 100644 --- a/eng/pipelines/arcade/stage-unit-tests.yml +++ b/eng/pipelines/arcade/stage-unit-tests.yml @@ -22,6 +22,7 @@ stages: buildConfig: ${{ parameters.buildConfig }} repoLogPath: ${{ parameters.repoLogPath }} installPackageArtifacts: false + buildMSBuildTasks: true - template: /eng/pipelines/common/run-dotnet-preview.yml parameters: @@ -164,7 +165,7 @@ stages: displayName: Publish Logs inputs: targetPath: ${{ parameters.repoLogPath }} - artifact: Run Unit Tests - ${{ job.testOS }} Logs + artifact: Logs - Unit Tests ${{ job.testOS }} $(System.JobAttempt) condition: always() - template: /eng/pipelines/common/fail-on-issue.yml diff --git a/eng/pipelines/azure-pipelines-public.yml b/eng/pipelines/azure-pipelines-public.yml index c3ad8e5c048f..a47257fe51bd 100644 --- a/eng/pipelines/azure-pipelines-public.yml +++ b/eng/pipelines/azure-pipelines-public.yml @@ -51,18 +51,15 @@ stages: - template: /eng/pipelines/arcade/stage-pack.yml@self parameters: pool: ${{ parameters.VM_IMAGE_HOST }} - publishTaskPrefix: '' + runAsPublic: ${{ eq(variables['_RunAsPublic'], 'true') }} - template: /eng/pipelines/arcade/stage-unit-tests.yml@self parameters: jobMatrix: - name: win_unit_tests displayName: Windows Unit Tests - pool: - name: Azure Pipelines - vmImage: $(HostedWindowsImage) - os: windows - timeout: 120 + pool: ${{ parameters.VM_IMAGE_HOST }} + timeout: 90 testOS: Windows - name: mac_unit_tests displayName: macOS Unit Tests @@ -70,6 +67,89 @@ stages: name: Azure Pipelines vmImage: $(HostedMacImage) os: macOS - timeout: 120 + timeout: 90 testOS: macOS publishTaskPrefix: '' + +- template: /eng/pipelines/arcade/stage-integration-tests.yml@self + parameters: + stageDependsOn: Pack + publishTaskPrefix: '' + jobMatrix: + - name: win_sample_tests + pool: ${{ parameters.VM_IMAGE_HOST }} + timeout: 120 + testCategory: Samples + - name: mac_sample_tests + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeout: 120 + testCategory: Samples + + - name: win_wintemplate_tests + pool: ${{ parameters.VM_IMAGE_HOST }} + timeout: 120 + testCategory: WindowsTemplates + - name: mac_wintemplate_tests + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeout: 120 + testCategory: WindowsTemplates + + - name: win_buildtemplate_tests + pool: ${{ parameters.VM_IMAGE_HOST }} + timeout: 120 + testCategory: Build + - name: mac_buildtemplate_tests + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeout: 120 + testCategory: Build + + - name: win_blazortemplate_tests + pool: ${{ parameters.VM_IMAGE_HOST }} + timeout: 120 + testCategory: Blazor + - name: mac_blazortemplate_tests + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeout: 120 + testCategory: Blazor + + - name: win_multitemplate_tests + pool: ${{ parameters.VM_IMAGE_HOST }} + timeout: 120 + testCategory: MultiProject + - name: mac_multitemplate_tests + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeout: 120 + testCategory: MultiProject + + # TODO: macOSTemplates and AOT template categories + + - name: mac_runandroid_tests + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeout: 180 + testCategory: RunOnAndroid + + - name: mac_runios_tests + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeout: 180 + testCategory: RunOniOS diff --git a/eng/pipelines/common/provision.yml b/eng/pipelines/common/provision.yml index 738fcb93874a..9cacac3028a3 100644 --- a/eng/pipelines/common/provision.yml +++ b/eng/pipelines/common/provision.yml @@ -60,7 +60,7 @@ steps: xcrun xcode-select --print-path xcodebuild -version sudo xcodebuild -license accept - sudo xcodebuild -downloadAllPlatforms + sudo xcodebuild -downloadPlatform iOS sudo xcodebuild -runFirstLaunch displayName: Select Xcode Version condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) diff --git a/eng/pipelines/common/setup-android-dependencies.yml b/eng/pipelines/common/setup-android-dependencies.yml new file mode 100644 index 000000000000..61aa191d8e8b --- /dev/null +++ b/eng/pipelines/common/setup-android-dependencies.yml @@ -0,0 +1,20 @@ +parameters: + mauiSourcePath: $(Build.SourcesDirectory) + repoLogPath: $(Build.Arcade.LogsPath) + androidSdkRoot: $(ANDROID_SDK_ROOT) + +steps: +- template: /eng/pipelines/common/run-dotnet-preview.yml + parameters: + displayName: Create temporary android project + mauiSourcePath: ${{ parameters.mauiSourcePath }} + command: new + arguments: android -o $(Agent.TempDirectory)/TempDroid + +- template: /eng/pipelines/common/run-dotnet-preview.yml + parameters: + displayName: Install android dependencies + mauiSourcePath: ${{ parameters.mauiSourcePath }} + project: $(Agent.TempDirectory)/TempDroid/TempDroid.csproj + arguments: '-t:InstallAndroidDependencies -p:AndroidSdkDirectory=${{ parameters.androidSdkRoot }} -p:AcceptAndroidSdkLicenses=true -v:n -bl:${{ parameters.repoLogPath }}/install-android-dependencies.binlog' + retryCountOnTaskFailure: 3 diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index d32d4516ab21..b5b96e7fb3ac 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -36,7 +36,7 @@ variables: )] # Common Agent Pools in use - name: HostedMacImage - value: macOS-14 + value: macOS-15 - name: HostedWindowsImage value: windows-2022 - name: LogDirectory diff --git a/src/Compatibility/Core/src/iOS/ContextActionCell.cs b/src/Compatibility/Core/src/iOS/ContextActionCell.cs index e91587cd126b..784d79427244 100644 --- a/src/Compatibility/Core/src/iOS/ContextActionCell.cs +++ b/src/Compatibility/Core/src/iOS/ContextActionCell.cs @@ -345,15 +345,18 @@ void ActivateMore() if (controller == null) throw new InvalidOperationException("No UIViewController found to present."); - if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) + if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone || (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad && actionSheet.PopoverPresentationController == null)) { var cancel = UIAlertAction.Create(StringResources.Cancel, UIAlertActionStyle.Cancel, null); actionSheet.AddAction(cancel); } else { - actionSheet.PopoverPresentationController.SourceView = _tableView; - actionSheet.PopoverPresentationController.SourceRect = sourceRect; + if (actionSheet.PopoverPresentationController != null) + { + actionSheet.PopoverPresentationController.SourceView = _tableView; + actionSheet.PopoverPresentationController.SourceRect = sourceRect; + } } controller.PresentViewController(actionSheet, true, null); diff --git a/src/Compatibility/Core/src/iOS/Platform.cs b/src/Compatibility/Core/src/iOS/Platform.cs index 37ccdfe94be4..d1503c2929c2 100644 --- a/src/Compatibility/Core/src/iOS/Platform.cs +++ b/src/Compatibility/Core/src/iOS/Platform.cs @@ -518,7 +518,11 @@ static void PresentPopUp(UIWindow window, UIAlertController alert, ActionSheetAr { UIDevice.CurrentDevice.BeginGeneratingDeviceOrientationNotifications(); var observer = NSNotificationCenter.DefaultCenter.AddObserver(UIDevice.OrientationDidChangeNotification, - n => { alert.PopoverPresentationController.SourceRect = window.RootViewController.View.Bounds; }); + n => + { + if (alert.PopoverPresentationController != null) + alert.PopoverPresentationController.SourceRect = window.RootViewController.View.Bounds; + }); arguments.Result.Task.ContinueWith(t => { @@ -526,9 +530,12 @@ static void PresentPopUp(UIWindow window, UIAlertController alert, ActionSheetAr UIDevice.CurrentDevice.EndGeneratingDeviceOrientationNotifications(); }, TaskScheduler.FromCurrentSynchronizationContext()); - alert.PopoverPresentationController.SourceView = window.RootViewController.View; - alert.PopoverPresentationController.SourceRect = window.RootViewController.View.Bounds; - alert.PopoverPresentationController.PermittedArrowDirections = 0; // No arrow + if (alert.PopoverPresentationController != null) + { + alert.PopoverPresentationController.SourceView = window.RootViewController.View; + alert.PopoverPresentationController.SourceRect = window.RootViewController.View.Bounds; + alert.PopoverPresentationController.PermittedArrowDirections = 0; // No arrow + } } window.RootViewController.PresentViewController(alert, true, null); diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ContextActionCell.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ContextActionCell.cs index 47c16b8d96b4..589788cd4bfb 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ContextActionCell.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ContextActionCell.cs @@ -340,15 +340,18 @@ void ActivateMore() if (controller == null) throw new InvalidOperationException("No UIViewController found to present."); - if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) + if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone || (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad && actionSheet.PopoverPresentationController == null)) { var cancel = UIAlertAction.Create(StringResources.Cancel, UIAlertActionStyle.Cancel, null); actionSheet.AddAction(cancel); } else { - actionSheet.PopoverPresentationController.SourceView = _tableView; - actionSheet.PopoverPresentationController.SourceRect = sourceRect; + if (actionSheet.PopoverPresentationController != null) + { + actionSheet.PopoverPresentationController.SourceView = _tableView; + actionSheet.PopoverPresentationController.SourceRect = sourceRect; + } } controller.PresentViewController(actionSheet, true, null); diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs index 23bcf8336793..e7e6a2629bc5 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs @@ -134,6 +134,11 @@ protected virtual void OnPagePropertyChanged(object sender, PropertyChangedEvent protected virtual void UpdateTabBarVisible() { + if (ViewController is null || Page is null) + { + return; + } + var tabBarVisible = (Page.FindParentOfType() as IShellItemController)?.ShowTabs ?? Shell.GetTabBarIsVisible(Page); diff --git a/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs b/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs index 357ac93cc678..9d9ccb949617 100644 --- a/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs +++ b/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs @@ -140,14 +140,17 @@ internal void UpdateSelectionMode() case SelectionMode.None: CollectionView.AllowsSelection = false; CollectionView.AllowsMultipleSelection = false; + ClearsSelectionOnViewWillAppear = true; break; case SelectionMode.Single: CollectionView.AllowsSelection = true; CollectionView.AllowsMultipleSelection = false; + ClearsSelectionOnViewWillAppear = false; break; case SelectionMode.Multiple: CollectionView.AllowsSelection = true; CollectionView.AllowsMultipleSelection = true; + ClearsSelectionOnViewWillAppear = false; break; } diff --git a/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs b/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs index c66335d679cd..8d6e94c62f5c 100644 --- a/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs +++ b/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs @@ -137,14 +137,17 @@ internal void UpdateSelectionMode() case SelectionMode.None: CollectionView.AllowsSelection = false; CollectionView.AllowsMultipleSelection = false; + ClearsSelectionOnViewWillAppear = true; break; case SelectionMode.Single: CollectionView.AllowsSelection = true; CollectionView.AllowsMultipleSelection = false; + ClearsSelectionOnViewWillAppear = false; break; case SelectionMode.Multiple: CollectionView.AllowsSelection = true; CollectionView.AllowsMultipleSelection = true; + ClearsSelectionOnViewWillAppear = false; break; } diff --git a/src/Controls/src/Core/TabbedPage/TabbedPage.Windows.cs b/src/Controls/src/Core/TabbedPage/TabbedPage.Windows.cs index cd55a291e071..4e9e2bef1fc7 100644 --- a/src/Controls/src/Core/TabbedPage/TabbedPage.Windows.cs +++ b/src/Controls/src/Core/TabbedPage/TabbedPage.Windows.cs @@ -333,6 +333,7 @@ internal static void MapItemsSource(ITabbedViewHandler handler, TabbedPage view) vm.UnselectedTitleColor = view.BarTextColor?.AsPaint()?.ToPlatform(); vm.SelectedForeground = view.SelectedTabColor?.AsPaint()?.ToPlatform(); vm.UnselectedForeground = view.UnselectedTabColor?.AsPaint()?.ToPlatform(); + vm.IsSelected = page == view.CurrentPage; }); handler.UpdateValue(nameof(TabbedPage.CurrentPage)); diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android/CollectionViewSelectedItemBackgroundShouldPersistAfterModalNavigation.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/CollectionViewSelectedItemBackgroundShouldPersistAfterModalNavigation.png new file mode 100644 index 000000000000..18fed4c4a38f Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android/CollectionViewSelectedItemBackgroundShouldPersistAfterModalNavigation.png differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue1685.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue1685.cs index 67baaebbd34a..54ac61e65e73 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue1685.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue1685.cs @@ -6,7 +6,7 @@ namespace Maui.Controls.Sample.Issues { - [Issue(IssueTracker.Github, 1685, "Entry clears when upadting text from native with one-way binding", PlatformAffected.Android | PlatformAffected.iOS | PlatformAffected.WinPhone, NavigationBehavior.PushModalAsync)] + [Issue(IssueTracker.Github, 1685, "Entry clears when updating text from native with one-way binding", PlatformAffected.Android | PlatformAffected.iOS | PlatformAffected.WinPhone)] public class Issue1685 : TestContentPage { const string ButtonId = "Button1685"; @@ -46,7 +46,8 @@ protected override void Init() var entry = new Entry() { - Placeholder = "Entry" + Placeholder = "Entry", + AutomationId = "TestEntry", }; entry.SetBinding(Entry.TextProperty, "EntryValue", BindingMode.OneWay); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue1769.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue1769.cs index 06c55a13fa56..4ef7367ce985 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue1769.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue1769.cs @@ -43,28 +43,24 @@ public SwitchDemoPage() HorizontalOptions = LayoutOptions.Center }; -#pragma warning disable CS0618 // Type or member is obsolete + var switcher = new Switch { AutomationId = SwitchAutomatedId, HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand + VerticalOptions = LayoutOptions.Center }; -#pragma warning restore CS0618 // Type or member is obsolete + switcher.Toggled += switcher_Toggled; -#pragma warning disable CS0618 // Type or member is obsolete -#pragma warning disable CS0612 // Type or member is obsolete _label = new Label { - AutomationId = string.Format(SwitchIsNowLabelTextFormat, switcher.IsToggled), + AutomationId = "SwitchLabel", Text = string.Format(SwitchIsNowLabelTextFormat, switcher.IsToggled), - FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), + FontSize = 20, HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.CenterAndExpand + VerticalOptions = LayoutOptions.Center }; -#pragma warning restore CS0612 // Type or member is obsolete -#pragma warning restore CS0618 // Type or member is obsolete // Accomodate iPhone status bar. Padding = DeviceInfo.Platform == DevicePlatform.iOS ? new Thickness(10, 20, 10, 5) : new Thickness(10, 0, 10, 5); diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue22467.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue22467.xaml new file mode 100644 index 000000000000..24485b836722 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue22467.xaml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +