-
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.
* [iOS] Shell page title fix (#20199) * Added a UiTest (#20199) * Added pending snapshot * Shell page title fix --------- Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
- Loading branch information
1 parent
05e72cf
commit a2f1a89
Showing
5 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/Controls/samples/Controls.Sample.UITests/Issues/Issue20199.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,13 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues" | ||
x:Class="Maui.Controls.Sample.Issues.Issue20199"> | ||
<TabBar> | ||
<ShellContent | ||
Title="Home page" | ||
ContentTemplate="{DataTemplate ns:Issue20199Page}" | ||
Route="MainPage"> | ||
</ShellContent> | ||
</TabBar> | ||
</Shell> |
29 changes: 29 additions & 0 deletions
29
src/Controls/samples/Controls.Sample.UITests/Issues/Issue20199.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,29 @@ | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 20199, "[iOS] Page titles do not appear until navigating when pushing a modal page at startup", PlatformAffected.iOS)] | ||
public partial class Issue20199 : Shell | ||
{ | ||
public Issue20199() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
protected override async void OnAppearing() | ||
{ | ||
base.OnAppearing(); | ||
|
||
var closeModalPageButton = new Button() { Text = "Hide", AutomationId = "button" }; | ||
closeModalPageButton.Clicked += (s, e) => Navigation.PopAsync(); | ||
|
||
var modalPage = new ContentPage() { Content = closeModalPageButton }; | ||
|
||
await Navigation.PushModalAsync(modalPage); | ||
} | ||
} | ||
|
||
public class Issue20199Page : ContentPage { } | ||
} |
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
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 NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues | ||
{ | ||
public class Issue20199 : _IssuesUITest | ||
{ | ||
public override string Issue => "[iOS] Page titles do not appear until navigating when pushing a modal page at startup"; | ||
|
||
public Issue20199(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
[Test] | ||
public void TitleViewShouldBeVisible() | ||
{ | ||
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows }); | ||
|
||
_ = App.WaitForElement("button"); | ||
App.Click("button"); | ||
|
||
// The test passes if the 'Home Page' title is visible | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+10.8 KB
src/Controls/tests/UITests/snapshots/ios/TitleViewShouldBeVisible.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.