-
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.
* Added a UI test (#19556) * [Android] Systemfonts fix (#19556) * Code review comments * [android] Add screenshot for UI test --------- Co-authored-by: Rui Marinho <me@ruimarinho.net>
- Loading branch information
Showing
5 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/Controls/samples/Controls.Sample.UITests/Issues/Issue19556.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,42 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue19556" | ||
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" | ||
ios:NavigationPage.PrefersLargeTitles="false" | ||
Title="Issue19556"> | ||
<StackLayout Padding="30,0" Spacing="0"> | ||
<Label Text="NET Multi-platform App UI monospace" | ||
FontFamily="monospace" | ||
AutomationId="label" | ||
SemanticProperties.HeadingLevel="Level1" /> | ||
<Label Text=".NET Multi-platform App UI sans-serif-condensed" | ||
FontFamily="sans-serif-condensed" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I sans-serif-condensed" /> | ||
<Label Text=".NET Multi-platform App UI sans-serif-condensed-light" | ||
FontFamily="sans-serif-condensed-light" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I sans-serif-condensed-light" /> | ||
<Label Text=".NET Multi-platform App UI serif" | ||
FontFamily="serif" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I serif " /> | ||
<Label Text=".NET Multi-platform App UI sans-serif" | ||
FontFamily="sans-serif" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I sans-serif" /> | ||
<Label Text=".NET Multi-platform App UI sans-serif-black" | ||
FontFamily="sans-serif-black" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I sans-serif-black" /> | ||
<Label Text=".NET Multi-platform App UI sans-serif-light" | ||
FontFamily="sans-serif-light" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I sans-serif-light" /> | ||
<Label Text=".NET Multi-platform App UI sans-serif-medium" | ||
FontFamily="sans-serif-medium" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I sans-serif-medium" /> | ||
</StackLayout> | ||
</ContentPage> |
14 changes: 14 additions & 0 deletions
14
src/Controls/samples/Controls.Sample.UITests/Issues/Issue19556.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,14 @@ | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 19556, "[Android] Systemfonts (light/black etc.) not working", PlatformAffected.Android)] | ||
|
||
public partial class Issue19556 : ContentPage | ||
{ | ||
public Issue19556() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
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 Issue19556 : _IssuesUITest | ||
{ | ||
public override string Issue => "[Android] Systemfonts (light/black etc.) not working"; | ||
|
||
public Issue19556(TestDevice device) | ||
: base(device) | ||
{ } | ||
|
||
[Test] | ||
public void SystemFontsShouldRenderCorrectly() | ||
{ | ||
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.iOS, TestDevice.Mac, TestDevice.Windows }); | ||
|
||
_ = App.WaitForElement("label"); | ||
|
||
// The test passes if fonts are correctly rendered | ||
VerifyScreenshot(); | ||
} | ||
} |
Binary file added
BIN
+83.6 KB
src/Controls/tests/UITests/snapshots/android/SystemFontsShouldRenderCorrectly.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