Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 24 additions & 0 deletions dev/MenuBar/MenuBar_InteractionTests/MenuBarTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,30 @@ public void TabTest()
}
}

[TestMethod]
public void EmptyMenuBarItemNoPopupTest()
{
if (PlatformConfiguration.IsDevice(DeviceType.Phone))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need that? I don't think we are doing any tests on Windows Mobile devices any longer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same. I think we should look at all test holistically at some point and remove obsolete checks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look like dead code. @kmahone to verify this codepath is not hit in any of the configurations we run tests in.

{
Log.Comment("Skipping tests on phone, because menubar is not supported.");
return;
}
using (var setup = new TestSetupHelper("MenuBar Tests"))
{
FindElement.ByName<Button>("NoChildrenFlyout").Click();
VerifyElement.NotFound("Popup",FindBy.Name);

FindElement.ByName<Button>("OneChildrenFlyout").Click();
VerifyElement.Found("Popup", FindBy.Name);

// Click twice to close flyout
FindElement.ByName<Button>("RemoveItemsFromOneChildrenItem").Click();
FindElement.ByName<Button>("RemoveItemsFromOneChildrenItem").Click();

FindElement.ByName<Button>("OneChildrenFlyout").Click();
VerifyElement.NotFound("Popup", FindBy.Name);
}
}

private T GetElement<T>(ref T element, string elementName) where T : UIObject
{
Expand Down
6 changes: 5 additions & 1 deletion dev/MenuBar/MenuBar_TestUI/MenuBarPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@
<MenuFlyoutItem Text="Font..."/>
</muxc:MenuBarItem>

<muxc:MenuBarItem Title="No children"/>
<muxc:MenuBarItem Title="No children" AutomationProperties.Name="NoChildrenFlyout"/>
<muxc:MenuBarItem Title="One children" AutomationProperties.Name="OneChildrenFlyout" x:Name="OneChildrenFlyoutMenuBarItem">
<MenuFlyoutItem Text="Sometext"/>
</muxc:MenuBarItem>
</muxc:MenuBar>

<TextBlock Text="Custom sized menu bar" Margin="0,6,0,0"/>
Expand All @@ -80,6 +83,7 @@
<Button x:Name="AddFlyoutItemButton" AutomationProperties.Name="AddFlyoutItemButton" Click="AddFlyoutItem_Click" Content="Add Flyout Item"/>
<Button x:Name="RemoveFlyoutItemButton" AutomationProperties.Name="RemoveFlyoutItemButton" Click="RemoveFlyoutItem_Click" Content="Remove Flyout Item"/>
<Button x:Name="AddItemsToEmptyMenuBar" AutomationProperties.Name="AddItemsToEmptyMenuBar" Click="AddMenuBarToEmptyMenuBarItem_Click" Content="Add a menu item to the empty menu bar"/>
<Button x:Name="RemoveItemsFromOneChildrenItem" AutomationProperties.Name="RemoveItemsFromOneChildrenItem" Click="RemoveItemsFromOneChildrenItem_Click" Content="Remove items from One Children item"/>
</StackPanel>
<StackPanel Grid.Row="3">
<TextBlock Text="Test output" Style="{ThemeResource StandardGroupHeader}"/>
Expand Down
4 changes: 4 additions & 0 deletions dev/MenuBar/MenuBar_TestUI/MenuBarPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,9 @@ private void AddMenuBarToEmptyMenuBarItem_Click(object sender, RoutedEventArgs e
EmptyMenuBar.Items.Add(mainMenuBarHelp);
}

private void RemoveItemsFromOneChildrenItem_Click(object sender, RoutedEventArgs e)
{
OneChildrenFlyoutMenuBarItem.Items.Clear();
}
}
}