Skip to content

[Testing] Feature matrix UITest Cases for Entry Control #30033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bc4a168
added Feature Matrix for Entry Control
LogishaSelvarajSF4525 Mar 5, 2025
f3492f9
added a test cases for EntryControl
LogishaSelvarajSF4525 Mar 5, 2025
8517388
added a test cases for entry feature matrix
LogishaSelvarajSF4525 Mar 6, 2025
7a47acb
updated changes
LogishaSelvarajSF4525 May 29, 2025
5ed6663
updated changes
LogishaSelvarajSF4525 Jun 2, 2025
80c51ea
modified changes
LogishaSelvarajSF4525 Jun 5, 2025
c540454
updated
LogishaSelvarajSF4525 Jun 5, 2025
b6049c6
updated changes
LogishaSelvarajSF4525 Jun 5, 2025
57c90d7
added snapshots
LogishaSelvarajSF4525 Jun 10, 2025
e04dc6c
added snapshot
LogishaSelvarajSF4525 Jun 10, 2025
5508dd5
updated changes
LogishaSelvarajSF4525 Jun 11, 2025
beed61b
modified snapshots
LogishaSelvarajSF4525 Jun 12, 2025
a22e146
updated changes
LogishaSelvarajSF4525 Jun 12, 2025
6b8319c
Updated snaps and added event features
anandhan-rajagopal Jun 12, 2025
de716e8
Added tests
anandhan-rajagopal Jun 12, 2025
b212918
Added snapshots
anandhan-rajagopal Jun 13, 2025
221c5cd
modified changes
LogishaSelvarajSF4525 Jun 13, 2025
98927be
added modified snapshots
anandhan-rajagopal Jun 13, 2025
e9ac98c
Added changed snapshot
anandhan-rajagopal Jun 16, 2025
c9f5614
updated changes
LogishaSelvarajSF4525 Jun 17, 2025
8fc0b98
modified test case
LogishaSelvarajSF4525 Jun 17, 2025
551175b
Added snapshot
LogishaSelvarajSF4525 Jun 18, 2025
d313ddc
added snapshots for windows
LogishaSelvarajSF4525 Jun 18, 2025
783a84a
Added snapshots
LogishaSelvarajSF4525 Jun 20, 2025
f6e211d
Added snapshot from CI
LogishaSelvarajSF4525 Jun 20, 2025
219c43c
Merge branch 'inflight/current' into logi-entrycontrol
PureWeen Jun 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public override string ToString()
new GalleryPageFactory(() => new KeyboardScrollingGridGallery(), "Keyboard Scrolling Gallery - Grid with Star Row"),
new GalleryPageFactory(() => new KeyboardScrollingNonScrollingPageLargeTitlesGallery(), "Keyboard Scrolling Gallery - NonScrolling Page / Large Titles"),
new GalleryPageFactory(() => new KeyboardScrollingNonScrollingPageSmallTitlesGallery(), "Keyboard Scrolling Gallery - NonScrolling Page / Small Titles"),
new GalleryPageFactory(() => new KeyboardScrollingScrollingPageLargeTitlesGallery(), "Keyboard Scrolling Gallery - Scrolling Page / Large Titles"),
new GalleryPageFactory(() => new KeyboardScrollingScrollingPageLargeTitlesGallery(), "Keyboard Scrolling Gallery - Scrolling Page / Large Titles"),
new GalleryPageFactory(() => new KeyboardScrollingScrollingPageSmallTitlesGallery(), "Keyboard Scrolling Gallery - Scrolling Page / Small Titles"),
new GalleryPageFactory(() => new LabelCoreGalleryPage(), "Label Gallery"),
new GalleryPageFactory(() => new ListViewCoreGalleryPage(), "ListView Gallery"),
Expand All @@ -87,6 +87,7 @@ public override string ToString()
new GalleryPageFactory(() => new CollectionViewFeaturePage(), "CollectionView Feature Matrix"),
new GalleryPageFactory(() => new LabelControlPage(), "Label Feature Matrix"),
new GalleryPageFactory(() => new CarouselViewFeaturePage(), "CarouselView Feature Matrix"),
new GalleryPageFactory(() => new EntryControlPage(), "Entry Feature Matrix"),
new GalleryPageFactory(() => new ImageControlPage(), "Image Feature Matrix"),
new GalleryPageFactory(() => new ImageButtonControlPage(), "ImageButton Feature Matrix"),
new GalleryPageFactory(() => new BoxViewControlPage(), "BoxView Feature Matrix"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Maui.Controls.Sample"
x:DataType="local:EntryViewModel"
x:Class="Maui.Controls.Sample.EntryControlMainPage">
<VerticalStackLayout Padding="20"
Spacing="8">
<Label Text="Entry Control"
FontSize="20" Margin="0,0,0,50"
HorizontalOptions="Center"/>

<local:UITestEntry x:Name="EntryControl"
IsCursorVisible="False"
Text="{Binding Text}"
Placeholder="{Binding Placeholder}"
PlaceholderColor="{Binding PlaceholderColor}"
TextColor="{Binding TextColor}"
ClearButtonVisibility="{Binding ClearButtonVisibility}"
HorizontalTextAlignment="{Binding HorizontalTextAlignment}"
VerticalTextAlignment="{Binding VerticalTextAlignment}"
IsPassword="{Binding IsPassword}"
FontSize="{Binding FontSize}"
CharacterSpacing="{Binding CharacterSpacing}"
IsReadOnly="{Binding IsReadOnly}"
IsTextPredictionEnabled="{Binding IsTextPredictionEnabled}"
IsSpellCheckEnabled="{Binding IsSpellCheckEnabled}"
Shadow="{Binding EntryShadow}"
MaxLength="{Binding MaxLength}"
SelectionLength="{Binding SelectionLength}"
CursorPosition="{Binding CursorPosition, Mode=TwoWay}"
ReturnType="{Binding ReturnType}"
ReturnCommand="{Binding ReturnCommand}"
ReturnCommandParameter="{Binding Text}"
Keyboard="{Binding Keyboard}"
FontFamily="{Binding FontFamily}"
IsVisible="{Binding IsVisible}"
IsEnabled="{Binding IsEnabled}"
FlowDirection="{Binding FlowDirection}"
HeightRequest="{Binding HeightRequest}"
FontAttributes="{Binding FontAttributes}"
TextTransform="{Binding TextTransform}"
TextChanged="EntryControl_TextChanged"
Completed="EntryControl_Completed"
Focused="EntryControl_Focused"
Unfocused="EntryControl_Unfocused"
AutomationId="TestEntry"/>

<Grid HeightRequest="130"/>

<Grid ColumnSpacing="10" Margin="0,10,0,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<!-- Row 1: Labels -->
<Label Text="Selection Length:"
FontSize="11"
Grid.Row="0"
Grid.Column="0"/>
<Label Text="Cursor position:"
FontSize="11"
Grid.Row="0"
Grid.Column="1"/>

<!-- Row 2: Entries -->
<local:UITestEntry x:Name="SelectionLengthEntry"
Text="{Binding SelectionLength}"
AutomationId="SelectionLengthEntry"
IsCursorVisible="False"
TextChanged="SelectionLength_Clicked"
Grid.Row="1"
Grid.Column="0"/>
<local:UITestEntry x:Name="CursorPositionEntry"
Text="{Binding CursorPosition}"
AutomationId="CursorPositionEntry"
IsCursorVisible="False"
Grid.Row="1"
Grid.Column="1"/>
</Grid>

<Button Text="Update Cursor Selection"
FontSize="11"
Clicked="OnUpdateCursorAndSelectionClicked"
AutomationId="UpdateCursorAndSelectionButton"/>

<Label Text="Events:"
FontSize="11"/>
<Label x:Name="TextChangedLabel"
Text="{Binding TextChangedText}"
AutomationId="TextChangedLabel"
FontSize="11"/>
<Label x:Name="CompletedLabel"
Text="{Binding CompletedText}"
AutomationId="CompletedLabel"
FontSize="11"/>
<Label x:Name="FocusedLabel"
Text="{Binding FocusedText}"
AutomationId="FocusedLabel"
FontSize="11"/>
<Label x:Name="UnfocusedLabel"
Text="{Binding UnfocusedText}"
AutomationId="UnfocusedLabel"
FontSize="11"/>
</VerticalStackLayout>

<ContentPage.ToolbarItems>
<ToolbarItem Text="Options"
Clicked="NavigateToOptionsPage_Clicked"></ToolbarItem>
</ContentPage.ToolbarItems>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
using System.ComponentModel;
using Microsoft.Maui.Controls;

namespace Maui.Controls.Sample;

public class EntryControlPage : NavigationPage
{
private EntryViewModel _viewModel;

public EntryControlPage()
{
_viewModel = new EntryViewModel();
PushAsync(new EntryControlMainPage(_viewModel));
}
}

public partial class EntryControlMainPage : ContentPage
{
private EntryViewModel _viewModel;

public EntryControlMainPage(EntryViewModel viewModel)
{
InitializeComponent();
_viewModel = viewModel;
BindingContext = _viewModel;
EntryControl.PropertyChanged += UpdateEntryControl;
}

private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
{
BindingContext = _viewModel = new EntryViewModel();
_viewModel.Text = "Test Entry";
_viewModel.Placeholder = "Enter text here";
_viewModel.CursorPosition = 0;
_viewModel.SelectionLength = 0;
await Navigation.PushAsync(new EntryOptionsPage(_viewModel));
}

private void CursorPositionButton_Clicked(object sender, EventArgs e)
{
if (int.TryParse(CursorPositionEntry.Text, out int cursorPosition))
{
_viewModel.CursorPosition = cursorPosition;
}
}

private void SelectionLength_Clicked(object sender, EventArgs e)
{
if (int.TryParse(SelectionLengthEntry.Text, out int selectionLength))
{
_viewModel.SelectionLength = selectionLength;
}
}

private void OnUpdateCursorAndSelectionClicked(object sender, EventArgs e)
{
if (int.TryParse(CursorPositionEntry.Text, out int cursorPosition))
{
EntryControl.Focus();
EntryControl.CursorPosition = cursorPosition;

if (BindingContext is EntryViewModel vm)
vm.CursorPosition = cursorPosition;
}

if (int.TryParse(SelectionLengthEntry.Text, out int selectionLength))
{
EntryControl.Focus();
EntryControl.SelectionLength = selectionLength;

if (BindingContext is EntryViewModel vm)
vm.SelectionLength = selectionLength;
}
CursorPositionEntry.Text = EntryControl.CursorPosition.ToString();
SelectionLengthEntry.Text = EntryControl.SelectionLength.ToString();
}

void UpdateEntryControl(object sender, PropertyChangedEventArgs args)
{
if (args.PropertyName == Entry.CursorPositionProperty.PropertyName)
CursorPositionEntry.Text = EntryControl.CursorPosition.ToString();
else if (args.PropertyName == Entry.SelectionLengthProperty.PropertyName)
SelectionLengthEntry.Text = EntryControl.SelectionLength.ToString();
}

private void EntryControl_TextChanged(object sender, TextChangedEventArgs e)
{
string eventInfo = $"TextChanged: Old='{e.OldTextValue}', New='{e.NewTextValue}'";

if (BindingContext is EntryViewModel vm)
{
vm.TextChangedText = eventInfo;
}
}

private void EntryControl_Completed(object sender, EventArgs e)
{
string eventInfo = $"Completed: Event Triggered";

if (BindingContext is EntryViewModel vm)
{
vm.CompletedText = eventInfo;
}
}

private void EntryControl_Focused(object sender, FocusEventArgs e)
{
string eventInfo = $"Focused: Event Triggered";

if (BindingContext is EntryViewModel vm)
{
vm.FocusedText = eventInfo;
}
}

private void EntryControl_Unfocused(object sender, FocusEventArgs e)
{
string eventInfo = $"Unfocused: Event Triggered";

if (BindingContext is EntryViewModel vm)
{
vm.UnfocusedText = eventInfo;
}
}
}
Loading