Skip to content

Commit 50f4656

Browse files
committed
Added a UiTest (#20372)
1 parent 5750c85 commit 50f4656

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
x:Class="Maui.Controls.Sample.Issues.Issue20372"
5+
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues">
6+
<ContentPage.Resources>
7+
<Style x:Key="PrimaryStyle"
8+
TargetType="Label">
9+
<Setter Property="FontSize" Value="22" />
10+
<Setter Property="TextColor" Value="MediumPurple" />
11+
</Style>
12+
</ContentPage.Resources>
13+
14+
<VerticalStackLayout Margin="20">
15+
16+
<Label TextType="Html"
17+
x:Name="label1"
18+
Style="{StaticResource PrimaryStyle}">
19+
<Label.Text>
20+
<![CDATA[
21+
<strong>Bold Text</strong><br>
22+
<em>italics</em><br>
23+
<ul>
24+
<li>Item 1</li>
25+
<li>Item 2</li>
26+
</ul>
27+
]]>
28+
</Label.Text>
29+
</Label>
30+
31+
<Label TextType="Html">
32+
<Label.Text>
33+
<![CDATA[
34+
<strong>Bold Text</strong><br>
35+
<em>italics</em><br>
36+
<ul>
37+
<li>Item 1</li>
38+
<li>Item 2</li>
39+
</ul>
40+
]]>
41+
</Label.Text>
42+
</Label>
43+
44+
</VerticalStackLayout>
45+
</ContentPage>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Microsoft.Maui.Controls;
2+
using Microsoft.Maui.Controls.Xaml;
3+
4+
namespace Maui.Controls.Sample.Issues
5+
{
6+
[XamlCompilation(XamlCompilationOptions.Compile)]
7+
[Issue(IssueTracker.Github, 20372, "[iOS] HTML Label not applying Bold or Italics on iOS", PlatformAffected.iOS)]
8+
public partial class Issue20372 : ContentPage
9+
{
10+
public Issue20372()
11+
{
12+
InitializeComponent();
13+
}
14+
}
15+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using NUnit.Framework;
2+
using UITest.Appium;
3+
using UITest.Core;
4+
5+
namespace Microsoft.Maui.AppiumTests.Issues
6+
{
7+
public class Issue20372 : _IssuesUITest
8+
{
9+
public override string Issue => "[iOS] HTML Label not applying Bold or Italics on iOS";
10+
11+
public Issue20372(TestDevice device) : base(device)
12+
{
13+
}
14+
15+
[Test]
16+
public void BothHtmlLabelsShouldApplyBoldAndItalicaProperties()
17+
{
18+
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Mac, TestDevice.Windows, TestDevice.Android });
19+
20+
_ = App.WaitForElement("label1");
21+
22+
// Both labels should have proper text attributes
23+
VerifyScreenshot();
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)