-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows][ Add correct menu bar item foreground resource override (#2…
…6413) * Add correct menu bar item foreground resource override * Fix screenshot validation * Add ref image --------- Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
- Loading branch information
Showing
4 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
src/Controls/tests/TestCases.HostApp/Issues/XFIssue/ShellMenuBarItems.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,48 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[Issue(IssueTracker.None, 0, "Shell MenuBarItems Test", | ||
PlatformAffected.WinRT)] | ||
public class ShellMenuBarItems : TestShell | ||
{ | ||
protected override void Init() | ||
{ | ||
var menuBarItem = new MenuBarItem() | ||
{ | ||
Text = "Title 1" | ||
}; | ||
|
||
var menuBarItem2 = new MenuBarItem() | ||
{ | ||
Text = "Title 2" | ||
}; | ||
|
||
menuBarItem.Add(new MenuFlyoutItem() | ||
{ | ||
Text = "Item 1" | ||
}); | ||
menuBarItem.Add(new MenuFlyoutItem() | ||
{ | ||
Text = "Item 2" | ||
}); | ||
menuBarItem.Add(new MenuFlyoutItem() | ||
{ | ||
Text = "Item 3" | ||
}); | ||
|
||
var contentPage = new ContentPage() | ||
{ | ||
Content = new Label() { Text = "Shell MenuBarItems Test" } | ||
}; | ||
|
||
contentPage.MenuBarItems.Add(menuBarItem); | ||
contentPage.MenuBarItems.Add(menuBarItem2); | ||
|
||
AddContentPage(contentPage); | ||
|
||
FlyoutBehavior = FlyoutBehavior.Disabled; | ||
|
||
// Set menu bar and menu bar item foreground color | ||
SetBackgroundColor(this, Colors.Purple); | ||
SetTitleColor(this, Colors.White); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/ShellMenuIBarItemsTest.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,26 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
#if WINDOWS | ||
public class ShellMenuIBarItemsTest : _IssuesUITest | ||
{ | ||
public ShellMenuIBarItemsTest(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "Shell MenuBarItems Test"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Shell)] | ||
public void SettingMenuBarItemColorsWork() | ||
{ | ||
Task.Delay(millisecondsDelay: 100).Wait(); | ||
|
||
VerifyScreenshot("VerifyMenuBarItemColorsWork"); | ||
} | ||
} | ||
#endif | ||
} |
Binary file added
BIN
+6.55 KB
...s/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyMenuBarItemColorsWork.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