-
Notifications
You must be signed in to change notification settings - Fork 759
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: assert phone vertical alignment
- Loading branch information
Showing
3 changed files
with
218 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
187 changes: 187 additions & 0 deletions
187
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/FontTests/FontAlignmentTests.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,187 @@ | ||
<Page | ||
x:Class="UITests.Shared.Windows_UI_Xaml.Font.FontAlignmentTests" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<StackPanel HorizontalAlignment="Left"> | ||
<CheckBox Margin="0,24" | ||
VerticalContentAlignment="Center" | ||
Content="CheckBox with the missing vertical alignment" /> | ||
|
||
<CheckBox Margin="0,24"> | ||
<TextBlock | ||
Margin="0,4,0,0" | ||
Text="Checkbox with a TextBlock with a custom margin" /> | ||
</CheckBox> | ||
|
||
<CheckBox Margin="0,24"> | ||
<TextBlock | ||
Margin="0,4,0,0" | ||
Text="Checkbox with a TextBlock with VerticalAlignment=Center" | ||
VerticalAlignment="Center"/> | ||
</CheckBox> | ||
|
||
<TextBox PlaceholderText="Enter your name123456:" | ||
Text="{Binding Name, Mode=TwoWay}" /> | ||
|
||
<StackPanel Orientation="Horizontal"> | ||
<TextBox Text="Test" | ||
Background="Blue" | ||
Foreground="White" /> | ||
<Button Background="Blue" | ||
Foreground="White" | ||
AutomationProperties.AutomationId="SecondPageButton" | ||
Content="Go to Second Page" /> | ||
</StackPanel> | ||
|
||
<!-- Dialog Information --> | ||
<StackPanel CornerRadius="5" | ||
Margin="0,15"> | ||
<TextBlock | ||
FontSize="18" | ||
FontWeight="Bold" | ||
Text="Configure TLCEV T1" /> | ||
<Grid | ||
x:Name="MainGrid" | ||
Margin="0,24,0,0"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition | ||
Width="Auto" /> | ||
<ColumnDefinition | ||
Width="48" /> | ||
<ColumnDefinition | ||
Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<StackPanel> | ||
<TextBlock | ||
Style="{StaticResource PropertyHeaderTextBlockStyle}" | ||
Text="Charge non-approved OEMs" /> | ||
<ToggleSwitch | ||
x:Name="Toggle" | ||
IsOn="True" | ||
Margin="0,4,0,0" | ||
OffContent="Block" | ||
OnContent="Allow" /> | ||
<Button | ||
Content="Help" | ||
Margin="0,4,0,0" /> | ||
<TeachingTip | ||
x:Name="ToggleThemeTeachingTip3" | ||
Title="What is a non-approved OEMs?" | ||
PreferredPlacement="LeftBottom" | ||
Target="{x:Bind Toggle}"> | ||
<TeachingTip.HeroContent> | ||
<Image | ||
Margin="24" | ||
Source="/Assets/Images/vehicule.png" /> | ||
</TeachingTip.HeroContent> | ||
<TeachingTip.Content> | ||
<TextBlock | ||
Margin="0,16,0,0" | ||
Text="Explanation here" | ||
TextWrapping="WrapWholeWords" /> | ||
</TeachingTip.Content> | ||
</TeachingTip> | ||
|
||
<TextBlock | ||
Margin="0,16,0,0" | ||
Style="{StaticResource PropertyHeaderTextBlockStyle}" | ||
Text="Maximum power" /> | ||
|
||
<StackPanel | ||
Margin="0,4,0,0" | ||
Orientation="Horizontal"> | ||
<NumberBox | ||
AutomationProperties.Name="NumberBox with spin button" | ||
LargeChange="100" | ||
SmallChange="10" | ||
SpinButtonPlacementMode="Inline" | ||
Width="160" | ||
Value="300" /> | ||
<TextBlock | ||
Margin="4,0,0,0" | ||
Text="kW" | ||
VerticalAlignment="Center" /> | ||
</StackPanel> | ||
|
||
<TextBlock | ||
Margin="0,16,0,0" | ||
Style="{StaticResource PropertyHeaderTextBlockStyle}" | ||
Text="Connection type" /> | ||
|
||
<ComboBox | ||
Margin="0,4,0,0" | ||
SelectedIndex="1" | ||
Width="160"> | ||
<ComboBoxItem>CCS</ComboBoxItem> | ||
<ComboBoxItem>NACS</ComboBoxItem> | ||
</ComboBox> | ||
|
||
<TextBlock | ||
Margin="0,16,0,0" | ||
Style="{StaticResource PropertyHeaderTextBlockStyle}" | ||
Text="Portal password" /> | ||
|
||
<PasswordBox | ||
HorizontalAlignment="Left" | ||
Margin="0,4,0,0" | ||
PlaceholderText="Enter your password" | ||
Width="160" /> | ||
<!-- Show TeachingTip --> | ||
</StackPanel> | ||
|
||
<StackPanel | ||
Grid.Column="2"> | ||
<CheckBox | ||
Checked="ToggleButton_OnChecked" | ||
Content="Is debug mode enabled" /> | ||
|
||
<TextBlock | ||
Margin="0,12,0,0" | ||
Style="{StaticResource PropertyHeaderTextBlockStyle}" | ||
Text="Debug level verbosity" /> | ||
|
||
<RadioButtons | ||
x:Name="MyRadioButtons" | ||
IsEnabled="False" | ||
SelectedIndex="1"> | ||
<x:String>Minimal</x:String> | ||
<x:String>Normal</x:String> | ||
<x:String>Detailed</x:String> | ||
</RadioButtons> | ||
<!-- Show TeachingTip --> | ||
</StackPanel> | ||
</Grid> | ||
|
||
<StackPanel | ||
x:Name="ProgressStackPanel" | ||
Margin="0,24,0,0" | ||
Orientation="Horizontal" | ||
Visibility="Collapsed"> | ||
<ProgressRing | ||
Foreground="Blue" | ||
Height="30" | ||
IsActive="True" | ||
Width="30" /> | ||
|
||
<TextBlock | ||
Margin="12,0,0,0" | ||
Text="Configuring TLCEV T1..." | ||
VerticalAlignment="Center" /> | ||
</StackPanel> | ||
|
||
<InfoBar | ||
x:Name="InfoBar" | ||
IsClosable="False" | ||
Margin="0,12,0,0" | ||
Message="TLCEV T1 configured successfully" | ||
Severity="Success" | ||
Visibility="Collapsed" /> | ||
</StackPanel> | ||
</StackPanel> | ||
</Page> |
22 changes: 22 additions & 0 deletions
22
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Media/FontTests/FontAlignmentTests.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 Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using Microsoft.UI.Xaml.Input; | ||
using Uno.UI.Samples.Controls; | ||
|
||
namespace UITests.Shared.Windows_UI_Xaml.Font; | ||
|
||
[SampleControlInfo("Fonts", "FontAlignmentTests", isManualTest: true, description: "Tests the alignment of text in different UI Controls")] | ||
public sealed partial class FontAlignmentTests : Page | ||
{ | ||
public FontAlignmentTests() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void ToggleButton_OnChecked(object sender, RoutedEventArgs e) | ||
{ | ||
var check = (CheckBox)sender; | ||
MyRadioButtons.IsEnabled = check.IsChecked.Value; | ||
} | ||
} | ||
|