-
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.
[iOS][Regression] Fix ToolbarItem color when used with IconImageSourc…
…e is always default color (#26048) * fix added * unwanted method removed * ToPlatform method added * UITest added * Modified the UITest * ios and android snap added * Revert "ios and android snap added" This reverts commit 7fef108. * ios and android snap added * Windows platform restricted * comment added * test case modified * modified the test case * new snaps added for android and ios * Update Issue25912.xaml.cs --------- Co-authored-by: Rui Marinho <me@ruimarinho.net>
- Loading branch information
1 parent
b479513
commit 23e1522
Showing
6 changed files
with
85 additions
and
0 deletions.
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
Binary file added
BIN
+17.7 KB
.../tests/TestCases.Android.Tests/snapshots/android/VerifyToolbarItemIconColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
src/Controls/tests/TestCases.HostApp/Issues/Issue25912.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,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<controls:TestContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:controls="clr-namespace:Maui.Controls.Sample.Issues" | ||
x:Class="Maui.Controls.Sample.Issues.Issue25912MainPage"> | ||
|
||
<ContentPage.ToolbarItems> | ||
<ToolbarItem x:Name="toolbarItem" IconImageSource="{FontImage Glyph='+',Color=Red,Size=30}"/> | ||
</ContentPage.ToolbarItems> | ||
|
||
|
||
<ContentPage.Content> | ||
<Button Text="Change Icon" WidthRequest="150" HeightRequest="50" Clicked="Button_Clicked" AutomationId="Button"/> | ||
</ContentPage.Content> | ||
|
||
</controls:TestContentPage> |
35 changes: 35 additions & 0 deletions
35
src/Controls/tests/TestCases.HostApp/Issues/Issue25912.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,35 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 25912, "ToolbarItem color when used with IconImageSource is always white", PlatformAffected.iOS | PlatformAffected.macOS)] | ||
public class Issue25912 : NavigationPage | ||
{ | ||
public Issue25912() | ||
{ | ||
Navigation.PushAsync(new Issue25912MainPage()); | ||
} | ||
} | ||
|
||
public partial class Issue25912MainPage : TestContentPage | ||
{ | ||
|
||
public Issue25912MainPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
} | ||
|
||
void Button_Clicked(object sender, EventArgs e) | ||
{ | ||
toolbarItem.IconImageSource = new FontImageSource | ||
{ | ||
Glyph ="+", | ||
Color = Colors.Green | ||
}; | ||
} | ||
|
||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25912.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 @@ | ||
#if TEST_FAILS_ON_WINDOWS //The images generated from the CI do not display the toolbar on the Windows platform. However, the icon color issue does not exist on Windows. Therefore, the test is restricted to exclude the Windows platform. | ||
using NUnit.Framework; | ||
using NUnit.Framework.Legacy; | ||
using OpenQA.Selenium; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue25912 : _IssuesUITest | ||
{ | ||
public Issue25912(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
public override string Issue => "ToolbarItem color when used with IconImageSource is always white"; | ||
|
||
[Test] | ||
[Category(UITestCategories.ToolbarItem)] | ||
public void VerifyToolbarItemIconColor() | ||
{ | ||
App.WaitForElement("Button"); | ||
App.Tap("Button"); | ||
VerifyScreenshot(); | ||
} | ||
|
||
} | ||
} | ||
#endif |
Binary file added
BIN
+18.5 KB
...Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyToolbarItemIconColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.