Skip to content

Commit

Permalink
Added a UiTest (dotnet#19159)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubaflo committed Feb 3, 2024
1 parent 8ba0551 commit fa20b8c
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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:local="clr-namespace:Maui.Controls.Sample.Issues"
x:Class="Maui.Controls.Sample.Issues.Issue19159">
<TabBar>
<Tab>
<ShellContent
Title="Page 1"
ContentTemplate="{x:DataTemplate local:Issue19159ContentPage}">
</ShellContent>
<ShellContent
Title="Page 2"
ContentTemplate="{x:DataTemplate local:Issue19159ContentPage}"/>
</Tab>
</TabBar>
</Shell>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;

namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 19159, "Top tab bar on Shell hides content", PlatformAffected.iOS)]
public partial class Issue19159 : Shell
{
public Issue19159()
{
InitializeComponent();
}
}

public class Issue19159ContentPage : ContentPage
{
public Issue19159ContentPage()
{
Content = new StackLayout()
{
AutomationId = "page",
HorizontalOptions = LayoutOptions.Fill,
VerticalOptions = LayoutOptions.Fill,
BackgroundColor = new Microsoft.Maui.Graphics.Color(255, 0, 0),
Margin = new Microsoft.Maui.Thickness(10)
};
}
}
}
25 changes: 25 additions & 0 deletions src/Controls/tests/UITests/Tests/Issues/Issue19159.cs
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.AppiumTests.Issues
{
public class Issue19159 : _IssuesUITest
{
public Issue19159(TestDevice device) : base(device)
{
}

public override string Issue => "Top tab bar on Shell hides content";

[Test]
public void ContentShouldNotBeOverlaidByTopBar()
{
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows | TestDevice.Android });
_ = App.WaitForElement("page1");

// The content should not be overlaid by top bar
App.Screenshot();
}
}
}

0 comments on commit fa20b8c

Please sign in to comment.