-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed shell pages with top bar #20337
Closed
+103
−1
Closed
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/Controls/samples/Controls.Sample.UITests/Issues/Issue19159.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,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> |
30 changes: 30 additions & 0 deletions
30
src/Controls/samples/Controls.Sample.UITests/Issues/Issue19159.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,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) | ||
}; | ||
} | ||
} | ||
} |
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,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(); | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use here
App.VerifyScreenshot
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!. Should I change it in all my UI tests? I think I wrote
App.Screenshot();
instead ofVerifyScreenshot
in all my PRs 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends. If there are checks validating properties such as text, sizes, etc. is a correct additional validation. But if we are going to validate something (colors, sizes, etc.) with a screenshot,
VerifyScreenshot
is the correct one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!