-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Testing] Feature matrix UITest Cases for Horizontal and Vertical Stack Layout #31393
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
PureWeen
merged 8 commits into
dotnet:inflight/current
from
anandhan-rajagopal:feature_matrix_horizontalStackLayout
Sep 12, 2025
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9abffdf
Added snapshots
HarishKumarSF4517 8a40475
Updated tests
HarishKumarSF4517 c436a2d
Removed snapshots
HarishKumarSF4517 eabc65a
Added Snapshots
HarishKumarSF4517 e2fc113
Added base images
HarishKumarSF4517 07e7cd1
Updated the suggestions
HarishKumarSF4517 87e44af
Added the Snapshots
HarishKumarSF4517 b607c22
Merge branch 'inflight/current' into feature_matrix_horizontalStackLa…
PureWeen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+54.9 KB
...ases.Android.Tests/snapshots/android/HorizontalStackLayout_RTLFlowDirection.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
+54.9 KB
....Tests/snapshots/android/HorizontalStackLayout_RTLFlowDirection_With_Height.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
+54.9 KB
...napshots/android/HorizontalStackLayout_RTLFlowDirection_With_HeightAndWidth.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
+54.9 KB
...d.Tests/snapshots/android/HorizontalStackLayout_RTLFlowDirection_With_Width.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
+43.4 KB
...Android.Tests/snapshots/android/HorizontalStackLayout_Spacing_WithLandscape.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
+43.4 KB
...Android.Tests/snapshots/android/HorizontalStackLayout_Spacing_WithLandspace.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
+54.9 KB
...s.Android.Tests/snapshots/android/HorizontalStackLayout_Spacing_With_Height.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
+54.9 KB
...d.Tests/snapshots/android/HorizontalStackLayout_Spacing_With_HeightAndWidth.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
+54.9 KB
...ases.Android.Tests/snapshots/android/HorizontalStackLayout_Spacing_With_RTL.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
+54.9 KB
...es.Android.Tests/snapshots/android/HorizontalStackLayout_Spacing_With_Width.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
+59.7 KB
...tCases.Android.Tests/snapshots/android/VerticalStackLayout_RTLFlowDirection.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
+59.7 KB
...id.Tests/snapshots/android/VerticalStackLayout_RTLFlowDirection_With_Height.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
+59.7 KB
.../snapshots/android/VerticalStackLayout_RTLFlowDirection_With_HeightAndWidth.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
+59.7 KB
...oid.Tests/snapshots/android/VerticalStackLayout_RTLFlowDirection_With_Width.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
+55.2 KB
...s.Android.Tests/snapshots/android/VerticalStackLayout_Spacing_WithLandscape.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
+55.2 KB
...s.Android.Tests/snapshots/android/VerticalStackLayout_Spacing_WithLandspace.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
+60.1 KB
...ses.Android.Tests/snapshots/android/VerticalStackLayout_Spacing_With_Height.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
+60.1 KB
...oid.Tests/snapshots/android/VerticalStackLayout_Spacing_With_HeightAndWidth.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
+60.1 KB
...tCases.Android.Tests/snapshots/android/VerticalStackLayout_Spacing_With_RTL.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
+60.1 KB
...ases.Android.Tests/snapshots/android/VerticalStackLayout_Spacing_With_Width.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 hidden or 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
144 changes: 144 additions & 0 deletions
144
...s/tests/TestCases.HostApp/FeatureMatrix/HorizontalStackLayout/StackLayoutControlPage.xaml
This file contains hidden or 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,144 @@ | ||
| <?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" | ||
| xmlns:local="clr-namespace:Maui.Controls.Sample" | ||
| x:Class="Maui.Controls.Sample.StackLayoutControlMainPage" | ||
| x:DataType="local:StackLayoutViewModel" | ||
| Title="StackLayoutControlPage"> | ||
| <ContentPage.ToolbarItems> | ||
| <ToolbarItem Text="Options" | ||
| Clicked="NavigateToOptionsPage_Clicked" | ||
| AutomationId="Options"/> | ||
| </ContentPage.ToolbarItems> | ||
|
|
||
| <VerticalStackLayout Padding="10" | ||
| Spacing="15"> | ||
| <!-- Show only HorizontalStackLayout examples when horizontal is selected --> | ||
| <VerticalStackLayout IsVisible="{Binding IsHorizontalVisible}"> | ||
| <!-- Heading for spacing example --> | ||
| <Label Text="Space between child views" | ||
| FontAttributes="Bold" | ||
| FontSize="14" | ||
| AutomationId="LabelSpacing" | ||
| Margin="0,10,0,0"/> | ||
| <HorizontalStackLayout | ||
| FlowDirection="{Binding FlowDirection}" | ||
| Margin="20" | ||
| HeightRequest="200" | ||
| Spacing="{Binding Spacing}"> | ||
| <Label Text="Start" | ||
| BackgroundColor="Gray" | ||
| VerticalOptions="Start"/> | ||
| <Label Text="Center" | ||
| BackgroundColor="Gray" | ||
| VerticalOptions="Center"/> | ||
| <Label Text="End" | ||
| BackgroundColor="Gray" | ||
| VerticalOptions="End"/> | ||
| <Label Text="Fill" | ||
| BackgroundColor="Gray" | ||
| VerticalOptions="Fill"/> | ||
| </HorizontalStackLayout> | ||
| <!-- Heading for nested horizontal stack example --> | ||
| <Label Text="Nest HorizontalStackLayout objects" | ||
| FontAttributes="Bold" | ||
| FontSize="14" | ||
| Margin="0,10,0,0"/> | ||
| <HorizontalStackLayout FlowDirection="{Binding FlowDirection}" | ||
| Margin="20" | ||
| Spacing="{Binding Spacing}"> | ||
| <!-- Nested VerticalStackLayouts (Primary/Secondary colors) --> | ||
| <Label Text="Primary colors:"/> | ||
| <VerticalStackLayout Spacing="{Binding Spacing}"> | ||
| <Rectangle Fill="Red" | ||
| WidthRequest="{Binding RectWidth}" | ||
| HeightRequest="{Binding RectHeight}"/> | ||
| <Rectangle Fill="Yellow" | ||
| WidthRequest="{Binding RectWidth}" | ||
| HeightRequest="{Binding RectHeight}"/> | ||
| <Rectangle Fill="Blue" | ||
| WidthRequest="{Binding RectWidth}" | ||
| HeightRequest="{Binding RectHeight}"/> | ||
| </VerticalStackLayout> | ||
| <Label Text="Secondary colors:"/> | ||
| <VerticalStackLayout Spacing="{Binding Spacing}"> | ||
| <Rectangle Fill="Green" | ||
| WidthRequest="{Binding RectWidth}" | ||
| HeightRequest="{Binding RectHeight}"/> | ||
| <Rectangle Fill="Orange" | ||
| WidthRequest="{Binding RectWidth}" | ||
| HeightRequest="{Binding RectHeight}"/> | ||
| <Rectangle Fill="Purple" | ||
| WidthRequest="{Binding RectWidth}" | ||
| HeightRequest="{Binding RectHeight}"/> | ||
| </VerticalStackLayout> | ||
| </HorizontalStackLayout> | ||
| </VerticalStackLayout> | ||
| <!-- Show only VerticalStackLayout examples when vertical is selected --> | ||
| <VerticalStackLayout IsVisible="{Binding IsVerticalVisible}"> | ||
| <!-- Heading for spacing example --> | ||
| <Label Text="Space between child views" | ||
| FontAttributes="Bold" | ||
| FontSize="14" | ||
| Margin="0,10,0,0"/> | ||
| <VerticalStackLayout FlowDirection="{Binding FlowDirection}" | ||
| Margin="20" | ||
| Spacing="{Binding Spacing}"> | ||
| <!-- Original Microsoft Docs Example --> | ||
| <Label Text="Start" | ||
| BackgroundColor="Gray" | ||
| HorizontalOptions="Start"/> | ||
| <Label Text="Center" | ||
| BackgroundColor="Gray" | ||
| HorizontalOptions="Center"/> | ||
| <Label Text="End" | ||
| BackgroundColor="Gray" | ||
| HorizontalOptions="End"/> | ||
| <Label Text="Fill" | ||
| BackgroundColor="Gray" | ||
| HorizontalOptions="Fill"/> | ||
| </VerticalStackLayout> | ||
| <!-- Heading for nested vertical stack example --> | ||
| <Label Text="Nest VerticalStackLayout objects" | ||
| FontAttributes="Bold" | ||
| FontSize="14" | ||
| Margin="0,10,0,0"/> | ||
| <VerticalStackLayout FlowDirection="{Binding FlowDirection}" | ||
| Margin="20" | ||
| Spacing="{Binding Spacing}"> | ||
| <!-- Nested HorizontalStackLayouts (Primary colors with Borders) --> | ||
| <Label Text="Primary colors"/> | ||
| <Border Stroke="Black" | ||
| Padding="5"> | ||
| <HorizontalStackLayout Spacing="{Binding Spacing}"> | ||
| <Rectangle Fill="Red" | ||
| HeightRequest="{Binding RectHeight}" | ||
| WidthRequest="{Binding RectWidth}"/> | ||
| <Label Text="Red" | ||
| FontSize="18"/> | ||
| </HorizontalStackLayout> | ||
| </Border> | ||
| <Border Stroke="Black" | ||
| Padding="5"> | ||
| <HorizontalStackLayout Spacing="{Binding Spacing}"> | ||
| <Rectangle Fill="Yellow" | ||
| HeightRequest="{Binding RectHeight}" | ||
| WidthRequest="{Binding RectWidth}"/> | ||
| <Label Text="Yellow" | ||
| FontSize="18"/> | ||
| </HorizontalStackLayout> | ||
| </Border> | ||
| <Border Stroke="Black" | ||
| Padding="5"> | ||
| <HorizontalStackLayout Spacing="{Binding Spacing}"> | ||
| <Rectangle Fill="Blue" | ||
| HeightRequest="{Binding RectHeight}" | ||
| WidthRequest="{Binding RectWidth}"/> | ||
| <Label Text="Blue" | ||
| FontSize="18"/> | ||
| </HorizontalStackLayout> | ||
| </Border> | ||
| </VerticalStackLayout> | ||
| </VerticalStackLayout> | ||
| </VerticalStackLayout> | ||
| </ContentPage> |
28 changes: 28 additions & 0 deletions
28
...ests/TestCases.HostApp/FeatureMatrix/HorizontalStackLayout/StackLayoutControlPage.xaml.cs
This file contains hidden or 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,28 @@ | ||
| namespace Maui.Controls.Sample; | ||
| public partial class StackLayoutControlPage : NavigationPage | ||
| { | ||
| private StackLayoutViewModel _viewModel; | ||
|
|
||
| public StackLayoutControlPage() | ||
| { | ||
| _viewModel = new StackLayoutViewModel(); | ||
| PushAsync(new StackLayoutControlMainPage(_viewModel)); | ||
| } | ||
| } | ||
| public partial class StackLayoutControlMainPage : ContentPage | ||
| { | ||
| private StackLayoutViewModel _viewModel; | ||
|
|
||
| public StackLayoutControlMainPage(StackLayoutViewModel viewModel) | ||
| { | ||
| InitializeComponent(); | ||
| _viewModel = viewModel; | ||
| BindingContext = _viewModel; | ||
| } | ||
|
|
||
| private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e) | ||
| { | ||
| BindingContext = _viewModel = new StackLayoutViewModel(); | ||
| await Navigation.PushAsync(new StackLayoutOptionsPage(_viewModel)); | ||
| } | ||
| } | ||
82 changes: 82 additions & 0 deletions
82
...s/tests/TestCases.HostApp/FeatureMatrix/HorizontalStackLayout/StackLayoutOptionsPage.xaml
This file contains hidden or 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,82 @@ | ||
| <?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" | ||
| xmlns:local="clr-namespace:Maui.Controls.Sample" | ||
| x:Class="Maui.Controls.Sample.StackLayoutOptionsPage" | ||
| x:DataType="local:StackLayoutViewModel" | ||
| Title="StackLayoutOptionsPage"> | ||
| <ContentPage.ToolbarItems> | ||
| <ToolbarItem Text="Apply" | ||
| Clicked="ApplyButton_Clicked" | ||
| AutomationId="Apply"/> | ||
| </ContentPage.ToolbarItems> | ||
|
|
||
| <VerticalStackLayout Padding="10" | ||
| Spacing="5"> | ||
| <Label Text="Choose Layout Orientation:" | ||
| FontAttributes="Bold" | ||
| FontSize="16"/> | ||
| <HorizontalStackLayout> | ||
| <RadioButton Content="Horizontal" | ||
| IsChecked="{Binding IsHorizontal, Mode=TwoWay}" | ||
| GroupName="OrientationGroup" | ||
| AutomationId="RadioHorizontal"/> | ||
| <RadioButton Content="Vertical" | ||
| IsChecked="{Binding IsVertical, Mode=TwoWay}" | ||
| GroupName="OrientationGroup" | ||
| Margin="20,0,0,0" | ||
| AutomationId="RadioVertical"/> | ||
| </HorizontalStackLayout> | ||
|
|
||
| <!-- IsVisible Option --> | ||
| <HorizontalStackLayout Spacing="10" | ||
| VerticalOptions="Center"> | ||
| <Label Text="IsVisible" | ||
| VerticalOptions="Center"/> | ||
| <CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay}" | ||
| AutomationId="CheckBoxIsVisible"/> | ||
| </HorizontalStackLayout> | ||
|
|
||
| <!-- RTL FlowDirection Option --> | ||
| <HorizontalStackLayout Spacing="10" | ||
| VerticalOptions="Center"> | ||
| <Label Text="RTL" | ||
| VerticalOptions="Center"/> | ||
| <CheckBox IsChecked="{Binding IsRtl, Mode=TwoWay}" | ||
| AutomationId="CheckBoxIsRtl"/> | ||
| </HorizontalStackLayout> | ||
|
|
||
| <!-- Spacing Option --> | ||
| <HorizontalStackLayout Spacing="10" | ||
| VerticalOptions="Center"> | ||
| <Label Text="Spacing" | ||
| VerticalOptions="Center"/> | ||
| <Entry Text="{Binding Spacing, Mode=TwoWay}" | ||
| Keyboard="Numeric" | ||
| WidthRequest="80" | ||
| AutomationId="EntrySpacing"/> | ||
| </HorizontalStackLayout> | ||
|
|
||
| <!-- Rectangle Height Option --> | ||
| <HorizontalStackLayout Spacing="10" | ||
| VerticalOptions="Center"> | ||
| <Label Text="Height" | ||
| VerticalOptions="Center"/> | ||
| <Entry Text="{Binding RectHeight, Mode=TwoWay}" | ||
| Keyboard="Numeric" | ||
| WidthRequest="80" | ||
| AutomationId="EntryHeight"/> | ||
| </HorizontalStackLayout> | ||
|
|
||
| <!-- Rectangle Width Option --> | ||
| <HorizontalStackLayout Spacing="10" | ||
| VerticalOptions="Center"> | ||
| <Label Text="Width" | ||
| VerticalOptions="Center"/> | ||
| <Entry Text="{Binding RectWidth, Mode=TwoWay}" | ||
| Keyboard="Numeric" | ||
| WidthRequest="80" | ||
| AutomationId="EntryWidth"/> | ||
| </HorizontalStackLayout> | ||
| </VerticalStackLayout> | ||
| </ContentPage> |
20 changes: 20 additions & 0 deletions
20
...ests/TestCases.HostApp/FeatureMatrix/HorizontalStackLayout/StackLayoutOptionsPage.xaml.cs
This file contains hidden or 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,20 @@ | ||
| using Microsoft.Maui.Controls; | ||
|
|
||
| namespace Maui.Controls.Sample; | ||
|
|
||
| public partial class StackLayoutOptionsPage : ContentPage | ||
| { | ||
| private StackLayoutViewModel _viewModel; | ||
|
|
||
| public StackLayoutOptionsPage(StackLayoutViewModel viewModel) | ||
| { | ||
| InitializeComponent(); | ||
| _viewModel = viewModel; | ||
| BindingContext = _viewModel; | ||
| } | ||
|
|
||
| private void ApplyButton_Clicked(object sender, EventArgs e) | ||
| { | ||
| Navigation.PopAsync(); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a new StackLayoutViewModel instance discards any changes made in the current view model. This should retain the existing _viewModel state instead of creating a new instance.