diff --git a/dev/TabView/InteractionTests/TabViewTests.cs b/dev/TabView/InteractionTests/TabViewTests.cs index 8c7336c0cf..f4fb8a8160 100644 --- a/dev/TabView/InteractionTests/TabViewTests.cs +++ b/dev/TabView/InteractionTests/TabViewTests.cs @@ -130,7 +130,9 @@ public void CloseSelectionTest() Verify.AreEqual(selectedIndexTextBlock.DocumentText, "0"); Log.Comment("When the selected tab is closed, selection should move to the next one."); + // Use Tab's close button: closeButton.InvokeAndWait(); + VerifyElement.NotFound("FirstTab", FindBy.Name); Verify.AreEqual(selectedIndexTextBlock.DocumentText, "0"); Log.Comment("Select last tab."); @@ -140,9 +142,11 @@ public void CloseSelectionTest() Verify.AreEqual(selectedIndexTextBlock.DocumentText, "3"); Log.Comment("When the selected tab is last and is closed, selection should move to the previous item."); - closeButton = FindCloseButton(lastTab); - Verify.IsNotNull(closeButton); - closeButton.InvokeAndWait(); + + // Use Middle Click to close the tab: + lastTab.Click(PointerButtons.Middle); + Wait.ForIdle(); + VerifyElement.NotFound("LastTab", FindBy.Name); Verify.AreEqual(selectedIndexTextBlock.DocumentText, "2"); } } @@ -264,27 +268,108 @@ public void AddButtonTest() [TestMethod] public void KeyboardTest() { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone3)) - { - Log.Warning("This test requires RS3+ functionality (specifically, KeyboardAccelerators)"); - return; - } - using (var setup = new TestSetupHelper("TabView Tests")) { Log.Comment("Set focus inside the TabView"); UIObject tabContent = FindElement.ByName("FirstTabContent"); tabContent.SetFocus(); + TabItem firstTab = FindElement.ByName("FirstTab"); + TabItem secondTab = FindElement.ByName("SecondTab"); + TabItem lastTab = FindElement.ByName("LastTab"); + + Button addButton = FindElement.ById