forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows] - Fix for Shell Section Visibility changes not reflected un…
…til Tab switch (dotnet#26130) * Shell section visibility fix. * Added test case. * Windows ShellSectionHandler changes. * Windows test script changes * snapshot for Windows
- Loading branch information
1 parent
b7069ed
commit 37a2d9d
Showing
7 changed files
with
143 additions
and
1 deletion.
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
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
+32.6 KB
...tests/TestCases.Android.Tests/snapshots/android/DynamicTabSectionVisibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,99 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 25913, "Top Tab Visibility Changes Not Reflected Until Tab Switch", PlatformAffected.UWP)] | ||
public partial class Issue25913 : Shell | ||
{ | ||
public Issue25913() | ||
{ | ||
InitializeShell(); | ||
} | ||
|
||
private void InitializeShell() | ||
{ | ||
var tabBar = new TabBar(); | ||
|
||
var tab1 = new Tab { Title = "Tab 1" }; | ||
var topTab1Content = new ContentPage | ||
{ | ||
Title = "TopTab1", | ||
Content = CreateControlPanel() | ||
}; | ||
|
||
var topTab2Content = new ContentPage | ||
{ | ||
Title = "TopTab2", | ||
Content = CreateControlPanel() | ||
}; | ||
|
||
var topTab3Content = new ContentPage | ||
{ | ||
Title = "TopTab3", | ||
Content = CreateControlPanel() | ||
}; | ||
|
||
tab1.Items.Add(topTab1Content); | ||
tab1.Items.Add(topTab2Content); | ||
tab1.Items.Add(topTab3Content); | ||
|
||
var tab2 = new Tab | ||
{ | ||
Title = "Tab 2", | ||
Items = | ||
{ | ||
new ShellContent | ||
{ | ||
Content = new ContentPage | ||
{ | ||
Content = new Label { Text = "Tab 2 Content" } | ||
} | ||
} | ||
} | ||
}; | ||
|
||
var tab3 = new Tab | ||
{ | ||
Title = "Tab 3", | ||
Items = | ||
{ | ||
new ShellContent | ||
{ | ||
Content = new ContentPage | ||
{ | ||
Content = new Label { Text = "Tab 3 Content" } | ||
} | ||
} | ||
} | ||
}; | ||
|
||
tabBar.Items.Add(tab1); | ||
tabBar.Items.Add(tab2); | ||
tabBar.Items.Add(tab3); | ||
|
||
Items.Add(tabBar); | ||
} | ||
|
||
private View CreateControlPanel() | ||
{ | ||
return new ScrollView | ||
{ | ||
Content = new StackLayout | ||
{ | ||
Spacing = 10, | ||
Padding = new Thickness(20), | ||
Children = | ||
{ | ||
new Button | ||
{ | ||
Text = "Hide Top Tab 3", | ||
Command = new Command(() => | ||
{ | ||
Items[0].Items[0].Items[2].IsVisible = false; | ||
}), | ||
AutomationId = "HideTop3" | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25913.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 NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue25913 : _IssuesUITest | ||
{ | ||
public override string Issue => "Top Tab Visibility Changes Not Reflected Until Tab Switch"; | ||
|
||
public Issue25913(TestDevice device) | ||
: base(device) | ||
{ } | ||
|
||
[Test] | ||
[Category(UITestCategories.Shell)] | ||
public void DynamicTabSectionVisibility() | ||
{ | ||
App.WaitForElement("HideTop3"); | ||
App.Tap("HideTop3"); | ||
#if WINDOWS | ||
App.Tap("Tab 1"); | ||
#endif | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+10.5 KB
...s/tests/TestCases.WinUI.Tests/snapshots/windows/DynamicTabSectionVisibility.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
+28.8 KB
...ontrols/tests/TestCases.iOS.Tests/snapshots/ios/DynamicTabSectionVisibility.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.