-
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] Tab Selected Icon Color not changing if using Font icons - fix (#…
…22437) * Added a UITest (#22032) * Fix #22032 * Added snapshots * Updated test * Fixed namespace * Pending Android snapshot * Update Issue22032.cs * UI test improvements --------- Co-authored-by: Javier Suárez <[email protected]>
- Loading branch information
1 parent
a7e3ff8
commit 4b8e604
Showing
7 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
Binary file added
BIN
+17.3 KB
.../TestCases.Android.Tests/snapshots/android/SelectedTabIconShouldChangeColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
src/Controls/tests/TestCases.HostApp/Issues/Issue22032.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,30 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue22032" | ||
SelectedTabColor="Red" | ||
UnselectedTabColor="Green"> | ||
<ContentPage Title="Tab1"> | ||
<ContentPage.IconImageSource> | ||
<FontImageSource | ||
FontFamily="OpenSansRegular" | ||
Glyph="₪" | ||
Size="15" /> | ||
</ContentPage.IconImageSource> | ||
<Button Text="Switch page" | ||
Clicked="Button_Clicked" | ||
AutomationId="button"/> | ||
</ContentPage> | ||
<ContentPage x:Name="tab2" Title="Tab2"> | ||
<ContentPage.IconImageSource> | ||
<FontImageSource | ||
FontFamily="OpenSansRegular" | ||
Glyph="¼" | ||
Size="15" /> | ||
</ContentPage.IconImageSource> | ||
<Label | ||
Text="Hello, Maui!" | ||
TextColor="White" | ||
AutomationId="label"/> | ||
</ContentPage> | ||
</TabbedPage> |
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.HostApp/Issues/Issue22032.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,22 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 22032, "Shell FlyoutItem Tab Selected Icon Color not changing if using Font icons", PlatformAffected.iOS)] | ||
public partial class Issue22032 : TabbedPage | ||
{ | ||
public Issue22032() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
void Button_Clicked(object sender, EventArgs e) | ||
{ | ||
CurrentPage = tab2; | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22032.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,25 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue22032 : _IssuesUITest | ||
{ | ||
public Issue22032(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "Shell FlyoutItem Tab Selected Icon Color not changing if using Font icons"; | ||
|
||
[Test] | ||
[Category(UITestCategories.TabbedPage)] | ||
public void SelectedTabIconShouldChangeColor() | ||
{ | ||
App.WaitForElement("button"); | ||
App.Click("button"); | ||
App.WaitForElement("label"); | ||
|
||
// The test passes if tab1 icon is green and tab2 red | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+5.62 KB
...ts/TestCases.WinUI.Tests/snapshots/windows/SelectedTabIconShouldChangeColor.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
+50.1 KB
...ls/tests/TestCases.iOS.Tests/snapshots/ios/SelectedTabIconShouldChangeColor.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