-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NavigationBar properties not updating - fix (#23076)
* Title not updated after OnAppearing for TabbedPage - fix (#22899) * Added a test category * Update Issues22899.xaml * Added snapshots
- Loading branch information
Showing
7 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+27.4 KB
src/Controls/tests/TestCases.Android.Tests/snapshots/android/Issue22899Test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
src/Controls/tests/TestCases.HostApp/Issues/Issues22899.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue22899"> | ||
<ContentPage Title="Title"> | ||
<VerticalStackLayout> | ||
<Button | ||
Text="Update title" | ||
AutomationId="button" | ||
Clicked="Button_Clicked"/> | ||
<Label | ||
Text="Button clicked" | ||
AutomationId="label" | ||
IsVisible="False" | ||
x:Name="label"/> | ||
</VerticalStackLayout> | ||
</ContentPage> | ||
</TabbedPage> |
27 changes: 27 additions & 0 deletions
27
src/Controls/tests/TestCases.HostApp/Issues/Issues22899.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 22899, "Title not updated after OnAppearing for TabbedPage in NavigationPage", PlatformAffected.All)] | ||
public class Issue22899NavPage : NavigationPage | ||
{ | ||
public Issue22899NavPage() : base(new Issue22899()){ } | ||
} | ||
|
||
public partial class Issue22899 : TabbedPage | ||
{ | ||
public Issue22899() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
void Button_Clicked(object sender, EventArgs e) | ||
{ | ||
Title = "Title has changed"; | ||
label.IsVisible = true; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22899.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue22899 : _IssuesUITest | ||
{ | ||
public override string Issue => "Title not updated after OnAppearing for TabbedPage in NavigationPage"; | ||
|
||
public Issue22899(TestDevice device) : base(device) { } | ||
|
||
[Test] | ||
[Category(UITestCategories.TabbedPage)] | ||
public void Issue22899Test() | ||
{ | ||
_ = App.WaitForElement("button"); | ||
App.Click("button"); | ||
_ = App.WaitForElement("label"); | ||
|
||
// The test passes if the text in the navigation bar has changed | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+7.64 KB
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/Issue22899Test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+62.7 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Issue22899Test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.