Skip to content
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

chore: add chefs FavoriteRecipes failing navigation scenario to the TestHarness #2554

Merged
merged 4 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace TestHarness.UITest;

public class Given_Apps_Chefs : NavigationTestBase
{
[Test]
public async Task When_Chefs_FavoriteRecipes_RecipeDetails()
{
InitTestSection(TestSections.Apps_Chefs);

App.WaitThenTap("ShowAppButton");
App.WaitThenTap("NextButton");
App.WaitThenTap("LoginButton");
App.WaitThenTap("FavoriteRecipesButton");
App.WaitThenTap("RecipeDetailsButton");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,47 @@
xmlns:local="using:TestHarness.Ext.Navigation.Apps.Chefs"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uen="using:Uno.Extensions.Navigation.UI"
xmlns:utu="using:Uno.Toolkit.UI"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">

<Grid>
<TextBlock Text="ChefsFavoriteRecipes" />
<Button Command="{Binding NavigateToRecipeDetail}" Content="Recipe Details" />

<utu:AutoLayout Padding="16"
uen:Region.Attached="True"
Spacing="16">
<utu:TabBar uen:Region.Attached="True">
<utu:TabBarItem uen:Region.Name="MyRecipes"
IsSelectable="True"
Content="My Recipes" />

<utu:TabBarItem uen:Region.Name="MyCookbooks"
IsSelectable="True"
Content="My Cookbooks" />
</utu:TabBar>


<Grid uen:Region.Attached="True"
uen:Region.Navigator="Visibility"
utu:AutoLayout.CounterAlignment="Stretch"
utu:AutoLayout.PrimaryAlignment="Stretch">
<Grid uen:Region.Name="MyRecipes">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="All my recipes" />
<Button AutomationProperties.AutomationId="RecipeDetailsButton"
uen:Navigation.Request="ChefsFavoriteRecipes/ChefsRecipeDetails"
Content="Recipe Details" />
</Grid>
<Grid uen:Region.Name="MyCookbooks"
Visibility="Collapsed">

<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="All my cookbooks" />
</Grid>
</Grid>
</utu:AutoLayout>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public async ValueTask NavigateToRecipeDetail()
await navigator.NavigateRouteAsync(this, "ChefsRecipeDetails", data: new ChefsRecipe { Name = "Home Page" });
}

public async ValueTask NavigateToFavoriteRecipes()
{
await navigator.NavigateRouteAsync(this, "ChefsFavoriteRecipes");
}
}

public static class ChefsNavigationExtensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Button Command="{Binding ShowCurrentProfile}" Content="Profile" />
<Button Command="{Binding ShowCurrentProfileNew}" Content="Profile (New)" />
<Button Command="{Binding NavigateToRecipeDetail}" Content="Recipe Details" />
<Button AutomationProperties.AutomationId="FavoriteRecipesButton" Command="{Binding NavigateToFavoriteRecipes}" Content="Favorite Recipes" />
<Button uen:Navigation.Request="ChefsSearch" Content="Search" />
<Button uen:Navigation.Request="ChefsNotifications" Content="Notifications" />
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ protected override void RegisterRoutes(IViewRegistry views, IRouteRegistry route
#region Main Tabs
new RouteMap("ChefsHome", View: views.FindByViewModel<ChefsHomeModel>(), IsDefault: true),
new RouteMap("ChefsSearch", View: views.FindByViewModel<ChefsSearchModel>()),
new RouteMap("ChefsFavoriteRecipes", View: views.FindByViewModel<ChefsFavoriteRecipesModel>(), Nested: new[]
{
new RouteMap("ChefsMyRecipes"),
new RouteMap("ChefsCookbooks")
}),
new RouteMap("ChefsFavoriteRecipes", View: views.FindByViewModel<ChefsFavoriteRecipesModel>()),
#endregion

#region Cookbooks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

<StackPanel>
<TextBlock Text="ChefsLogin" />
<Button Content="Login"
Command="{Binding DoLogin}"/>
<Button AutomationProperties.AutomationId="LoginButton"
Content="Login"
Command="{Binding DoLogin}" />
</StackPanel>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

<StackPanel>
<TextBlock Text="ChefsWelcome" />
<Button Content="Next"
<Button AutomationProperties.AutomationId="NextButton"
Content="Next"
uen:Navigation.Request="ChefsLogin" />
</StackPanel>
</Page>
Loading