-
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.
Title not updated after OnAppearing for TabbedPage - fix (#22899)
- Loading branch information
Showing
4 changed files
with
88 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
24 changes: 24 additions & 0 deletions
24
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,24 @@ | ||
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] | ||
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(); | ||
} | ||
} | ||
} |
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,17 @@ | ||
<?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" | ||
IsVisible="False" | ||
x:Name="label"/> | ||
</VerticalStackLayout> | ||
</ContentPage> | ||
</TabbedPage> |
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; | ||
} | ||
} | ||
} |