From bd2371cf4cacda8feb13a60bc116fc5e036e2027 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 22 Mar 2021 09:00:55 -0400 Subject: [PATCH] feat(swipecontrol): Add source commit id in headers --- .../UITests.Shared/UITests.Shared.projitems | 7 - .../SwipeControlClearPage.xaml.cs | 8 +- .../SwipeControlPage.xaml.cs | 30 +- .../SwipeControlPage2.xaml.cs | 19 +- .../SwipeControlTests/SwipePage.xaml | 33 - .../SwipeControlTests/SwipePage.xaml.cs | 44 - .../SwipeControlTests/TestCommand.cs | 3 + .../SwipeControl/SwipeControl_APITests.cs | 15 +- .../SwipeControl_InteractionTests.cs | 4073 +++++++++-------- .../Controls/SwipeControl/SwipeControl.cs | 3 + .../Controls/SwipeControl/SwipeControl.h.cs | 3 + .../SwipeControl/SwipeControl.properties.cs | 3 + .../SwipeControl/SwipeControl.properties.h.cs | 4 +- .../Xaml/Controls/SwipeControl/SwipeItem.cs | 5 +- .../Xaml/Controls/SwipeControl/SwipeItem.h.cs | 3 + .../SwipeControl/SwipeItem.properties.cs | 3 + .../SwipeControl/SwipeItem.properties.h.cs | 4 + .../SwipeControl/SwipeItemInvokedEventArgs.cs | 3 + .../SwipeItemInvokedEventArgs.h.cs | 3 + .../Xaml/Controls/SwipeControl/SwipeItems.cs | 3 + .../Controls/SwipeControl/SwipeItems.h.cs | 3 + .../SwipeControl/SwipeItems.properties.cs | 3 + .../SwipeControl/SwipeItems.properties.h.cs | 3 + .../Controls/SwipeControl/SwipeTestHooks.cs | 3 + .../Controls/SwipeControl/SwipeTestHooks.h.cs | 5 +- .../SwipeControl/SwipeTestHooks.properties.cs | 3 + .../SwipeControl/SwipeTestHooksFactory.cs | 3 +- .../SwipeControl/SwipeTestHooksFactory.h.cs | 3 +- 28 files changed, 2141 insertions(+), 2154 deletions(-) delete mode 100644 src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml delete mode 100644 src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml.cs diff --git a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems index 87f5812c2800..4c6775d7861a 100644 --- a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems +++ b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems @@ -1501,10 +1501,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -5069,9 +5065,6 @@ SwipeControlPage2.xaml - - SwipePage.xaml - SymbolIcon_Generic.xaml diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlClearPage.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlClearPage.xaml.cs index 0417f1eea4d1..70b6fa0a217d 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlClearPage.xaml.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlClearPage.xaml.cs @@ -1,15 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl_TestUI/SwipeControlClearPage.xaml.cs + using System; using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; namespace MUXControlsTestApp { /// /// Test page used for clearing existing SwipeControls /// - public sealed partial class SwipeControlClearPage : TestPage + public sealed partial class SwipeControlClearPage : Page //: TestPage { private string[] items = new string[] { "some text" }; @@ -29,7 +33,7 @@ public void AddSwipeItemsButton_Click(object sender, RoutedEventArgs e) DefaultSwipeItemsHorizontal.Clear(); DefaultSwipeItemsVertical.Clear(); - DefaultSwipeItemsHorizontal.Mode = Microsoft.UI.Xaml.Controls.SwipeMode.Reveal; + DefaultSwipeItemsHorizontal.Mode = SwipeMode.Reveal; DefaultSwipeItemsHorizontal.Add(DefaultSwipeItemHorizontal); // Using swipecontrol inside datatemplate prevents us from setting that: diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage.xaml.cs index 0e8933026536..c57e0565c434 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage.xaml.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage.xaml.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl_TestUI/SwipeControlPage.xaml.cs + using System; using System.Collections.Generic; using System.Numerics; @@ -15,18 +18,18 @@ using Windows.UI.Xaml.Navigation; using SwipeControl_TestUI; -using IconSource = Microsoft.UI.Xaml.Controls.IconSource; -using SwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem; -using SwipeControl = Microsoft.UI.Xaml.Controls.SwipeControl; -using SwipeItemInvokedEventArgs = Microsoft.UI.Xaml.Controls.SwipeItemInvokedEventArgs; -using MaterialHelperTestApi = Microsoft.UI.Private.Media.MaterialHelperTestApi; -using SwipeTestHooks = Microsoft.UI.Private.Controls.SwipeTestHooks; -using MUXControlsTestHooks = Microsoft.UI.Private.Controls.MUXControlsTestHooks; -using MUXControlsTestHooksLoggingMessageEventArgs = Microsoft.UI.Private.Controls.MUXControlsTestHooksLoggingMessageEventArgs; +//using IconSource = Microsoft.UI.Xaml.Controls.IconSource; +//using SwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem; +//using SwipeControl = Microsoft.UI.Xaml.Controls.SwipeControl; +//using SwipeItemInvokedEventArgs = Microsoft.UI.Xaml.Controls.SwipeItemInvokedEventArgs; +//using MaterialHelperTestApi = Microsoft.UI.Private.Media.MaterialHelperTestApi; +//using SwipeTestHooks = Microsoft.UI.Private.Controls.SwipeTestHooks; +//using MUXControlsTestHooks = Microsoft.UI.Private.Controls.MUXControlsTestHooks; +//using MUXControlsTestHooksLoggingMessageEventArgs = Microsoft.UI.Private.Controls.MUXControlsTestHooksLoggingMessageEventArgs; namespace MUXControlsTestApp { - public sealed partial class SwipeControlPage : TestPage + public sealed partial class SwipeControlPage : Page //: TestPage { object asyncEventReportingLock = new object(); List lstAsyncEventMessage = new List(); @@ -44,7 +47,7 @@ public SwipeControlPage() this.InitializeComponent(); Container.SizeChanged += ContainerSizeChangedHandler; - SwipeTestHooks.LastInteractedWithSwipeControlChanged += SwipeTestHooks_LastInteractedWithSwipeControlChanged; + SwipeTestHooks.LastInteractedWithSwipeControlChanged += SwipeTestHooks_LastInteractedWithSwipeControlChanged; MaterialHelperTestApiSetup(); if (ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) @@ -66,8 +69,9 @@ public SwipeControlPage() if (chkLogSwipeControlMessages.IsChecked == true) { - MUXControlsTestHooks.SetLoggingLevelForType("SwipeControl", isLoggingInfoLevel: true, isLoggingVerboseLevel: true); - MUXControlsTestHooks.LoggingMessage += MUXControlsTestHooks_LoggingMessage; + // TODO UNO + //MUXControlsTestHooks.SetLoggingLevelForType("SwipeControl", isLoggingInfoLevel: true, isLoggingVerboseLevel: true); + //MUXControlsTestHooks.LoggingMessage += MUXControlsTestHooks_LoggingMessage; } } @@ -797,4 +801,4 @@ private void BtnClearFullLog_Click(object sender, RoutedEventArgs e) cmbFullLog.Items.Clear(); } } -} \ No newline at end of file +} diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage2.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage2.xaml.cs index 0e5b29e96522..7717ac2b12b0 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage2.xaml.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipeControlPage2.xaml.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl_TestUI/SwipeControlPage2.xaml.cs + using System; using System.Collections.Generic; using System.IO; @@ -18,17 +21,17 @@ using Windows.UI.Xaml.Automation.Peers; using Windows.UI; -using IconSource = Microsoft.UI.Xaml.Controls.IconSource; -using SwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem; -using SwipeItems = Microsoft.UI.Xaml.Controls.SwipeItems; -using SwipeMode = Microsoft.UI.Xaml.Controls.SwipeMode; -using SwipeBehaviorOnInvoked = Microsoft.UI.Xaml.Controls.SwipeBehaviorOnInvoked; -using SwipeItemInvokedEventArgs = Microsoft.UI.Xaml.Controls.SwipeItemInvokedEventArgs; -using MaterialHelperTestApi = Microsoft.UI.Private.Media.MaterialHelperTestApi; +//using IconSource = Microsoft.UI.Xaml.Controls.IconSource; +//using SwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem; +//using SwipeItems = Microsoft.UI.Xaml.Controls.SwipeItems; +//using SwipeMode = Microsoft.UI.Xaml.Controls.SwipeMode; +//using SwipeBehaviorOnInvoked = Microsoft.UI.Xaml.Controls.SwipeBehaviorOnInvoked; +//using SwipeItemInvokedEventArgs = Microsoft.UI.Xaml.Controls.SwipeItemInvokedEventArgs; +//using MaterialHelperTestApi = Microsoft.UI.Private.Media.MaterialHelperTestApi; namespace MUXControlsTestApp { - public sealed partial class SwipeControlPage2 : TestPage + public sealed partial class SwipeControlPage2 : Page //: TestPage { SwipeItem pastSender; public SwipeControlPage2() diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml deleted file mode 100644 index 5d518bf02d8f..000000000000 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - None - Info - Verbose - - - - diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml.cs deleted file mode 100644 index d2df243533a7..000000000000 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/SwipePage.xaml.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Common; - -#if USING_TAEF -using WEX.TestExecution; -using WEX.TestExecution.Markup; -using WEX.Logging.Interop; -#else -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting.Logging; -#endif - -using MUXControlsTestHooks = Microsoft.UI.Private.Controls.MUXControlsTestHooks; - -namespace MUXControlsTestApp -{ - [TopLevelTestPage(Name = "SwipeControl", Icon = "Swipe.png")] - public sealed partial class SwipePage : TestPage - { - public SwipePage() - { - LogController.InitializeLogging(); - - this.InitializeComponent(); - - navigateToSimpleContents.Click += delegate { Frame.NavigateWithoutAnimation(typeof(SwipeControlPage), 0); }; - navigateToDynamic.Click += delegate { Frame.NavigateWithoutAnimation(typeof(SwipeControlPage2), 0); }; - navigateToClear.Click += delegate { Frame.NavigateWithoutAnimation(typeof(SwipeControlClearPage), 0); }; - } - - private void CmbSwipeControlOutputDebugStringLevel_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - MUXControlsTestHooks.SetOutputDebugStringLevelForType( - "SwipeControl", - cmbSwipeControlOutputDebugStringLevel.SelectedIndex == 1 || cmbSwipeControlOutputDebugStringLevel.SelectedIndex == 2, - cmbSwipeControlOutputDebugStringLevel.SelectedIndex == 2); - } - } -} diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/TestCommand.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/TestCommand.cs index 4098b4e5919b..103a26c7d9be 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/TestCommand.cs +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/SwipeControlTests/TestCommand.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl_TestUI/TestCommand.cs + using MUXControlsTestApp; using System; using System.Collections.Generic; diff --git a/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_APITests.cs b/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_APITests.cs index 179a968e67b0..3a208d93d977 100644 --- a/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_APITests.cs +++ b/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_APITests.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl_APITests/SwipeControlTests.cs + using MUXControlsTestApp.Utilities; using System; using System.Threading; @@ -19,16 +22,16 @@ using Microsoft.VisualStudio.TestTools.UnitTesting.Logging; #endif -using SwipeMode = Microsoft.UI.Xaml.Controls.SwipeMode; -using SwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem; -using SwipeItems = Microsoft.UI.Xaml.Controls.SwipeItems; -using SwipeControl = Microsoft.UI.Xaml.Controls.SwipeControl; -using FontIconSource = Microsoft.UI.Xaml.Controls.FontIconSource; +//using SwipeMode = Microsoft.UI.Xaml.Controls.SwipeMode; +//using SwipeItem = Microsoft.UI.Xaml.Controls.SwipeItem; +//using SwipeItems = Microsoft.UI.Xaml.Controls.SwipeItems; +//using SwipeControl = Microsoft.UI.Xaml.Controls.SwipeControl; +//using FontIconSource = Microsoft.UI.Xaml.Controls.FontIconSource; namespace Windows.UI.Xaml.Tests.MUXControls.ApiTests { [TestClass] - public class SwipeControlTests : ApiTestBase + public class SwipeControlTests : MUXApiTestBase { [TestMethod] public void SwipeItemTest() diff --git a/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_InteractionTests.cs b/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_InteractionTests.cs index 18d59af443ef..6f6f8ac232ef 100644 --- a/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_InteractionTests.cs +++ b/src/Uno.UI.RuntimeTests/MUX/Windows_UI_Xaml_Controls/SwipeControl/SwipeControl_InteractionTests.cs @@ -1,2046 +1,2049 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using Windows.UI.Xaml.Tests.MUXControls.InteractionTests.Infra; -using Windows.UI.Xaml.Tests.MUXControls.InteractionTests.Common; -using Windows.System.Threading; -using Windows.Foundation; -using Windows.Foundation.Metadata; -using Common; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -#if USING_TAEF -using WEX.TestExecution; -using WEX.TestExecution.Markup; -using WEX.Logging.Interop; -#else -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VisualStudio.TestTools.UnitTesting.Logging; -#endif - -using Microsoft.Windows.Apps.Test.Automation; -using Microsoft.Windows.Apps.Test.Foundation; -using Microsoft.Windows.Apps.Test.Foundation.Controls; -using Microsoft.Windows.Apps.Test.Foundation.Patterns; -using Microsoft.Windows.Apps.Test.Foundation.Waiters; - -namespace Windows.UI.Xaml.Tests.MUXControls.InteractionTests -{ - using Window = Microsoft.Windows.Apps.Test.Foundation.Controls.Window; - - [TestClass] - public class SwipeControlTests - { - [ClassInitialize] - [TestProperty("RunAs", "User")] - [TestProperty("Classification", "Integration")] - [TestProperty("TestPass:IncludeOnlyOn", "Desktop")] - public static void ClassInitialize(TestContext testContext) - { - TestEnvironment.Initialize(testContext); - } - - [TestCleanup] - public void TestCleanup() - { - TestCleanupHelper.Cleanup(); - } - - [TestMethod] - public void CanSwipeToExecuteHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl1"); - var SwipeControl1 = FindElement.ByName("SwipeControl1"); - Verify.IsNotNull(SwipeControl1); - Log.Comment("Find the SwipeItem1IdleCheckBox"); - CheckBox SwipeItem1IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem1IdleCheckBox")); - Verify.IsNotNull(SwipeItem1IdleCheckBox, "Verifying that SwipeItem1IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem1OpenCheckBox"); - CheckBox SwipeItem1OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem1OpenCheckBox")); - Verify.IsNotNull(SwipeItem1OpenCheckBox, "Verifying that SwipeItem1OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl1, Direction.West); - WaitForChecked(SwipeItem1OpenCheckBox); - WaitForChecked(SwipeItem1IdleCheckBox); - WaitForUnchecked(SwipeItem1OpenCheckBox); - WaitForChecked(SwipeItem1IdleCheckBox); - Verify.AreEqual("command's text", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanSwipeToExecuteVertical() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) - { - Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl8"); - var SwipeControl8 = FindElement.ByName("SwipeControl8"); - Verify.IsNotNull(SwipeControl8); - Log.Comment("Find the SwipeItem8IdleCheckBox"); - CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); - Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem8OpenCheckBox"); - CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); - Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl8, Direction.North); - WaitForChecked(SwipeItem8OpenCheckBox); - WaitForChecked(SwipeItem8IdleCheckBox); - WaitForUnchecked(SwipeItem8OpenCheckBox); - WaitForChecked(SwipeItem8IdleCheckBox); - Verify.AreEqual("ExecuteItem", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanClearItemsWithoutCrashing() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) - { - Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); - return; - } - - - Log.Comment("Navigating to clear items test page"); - UIObject navigateToClearPageObject = FindElement.ByName("navigateToClear"); - Verify.IsNotNull(navigateToClearPageObject, "Verifying that navigateToClear Button was found"); - - Button navigateToClearPageButton = new Button(navigateToClearPageObject); - navigateToClearPageButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find FindItemsSum textblock"); - TextBlock sumOfSwipeItemsCount = new TextBlock(FindElement.ByName("SwipeItemsChildSum")); - Verify.IsNotNull(sumOfSwipeItemsCount); - Verify.AreEqual("2", sumOfSwipeItemsCount.GetText()); - - Log.Comment("Find clear SwipeItems button"); - Button clearItemsButton = new Button(FindElement.ByName("ClearItemsButton")); - Verify.IsNotNull(clearItemsButton); - clearItemsButton.Invoke(); - Wait.ForIdle(); - Verify.AreEqual("0", sumOfSwipeItemsCount.GetText()); - - - Log.Comment("Find add SwipeItem button"); - Button addItemsButton = new Button(FindElement.ByName("AddItemsButton")); - Verify.IsNotNull(addItemsButton); - addItemsButton.Invoke(); - Wait.ForIdle(); - // Only adds horizontal items, see test app for explanation - Verify.AreEqual("1", sumOfSwipeItemsCount.GetText()); - - Log.Comment("clearing items again"); - clearItemsButton.Invoke(); - Wait.ForIdle(); - Verify.AreEqual("0", sumOfSwipeItemsCount.GetText()); - - - } - } - - - [TestMethod] - public void CanSwipeAndTapFirstRevealedItemHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanSwipeAndTapSecondtRevealedItemHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem2"); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - Verify.AreEqual("RevealItem2", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanSwipeAndTapFirstRevealedItemVertical() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) - { - Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl8"); - var SwipeControl8 = FindElement.ByName("SwipeControl8"); - Verify.IsNotNull(SwipeControl8); - Log.Comment("Find the SwipeItem8IdleCheckBox"); - CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); - Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem8OpenCheckBox"); - CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); - Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl8, Direction.South); - WaitForChecked(SwipeItem8OpenCheckBox); - WaitForChecked(SwipeItem8IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem8OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem8IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } +//// Copyright (c) Microsoft Corporation. All rights reserved. +//// Licensed under the MIT License. See LICENSE in the project root for license information. + +//// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +//// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl_InteractionTests/SwipeControlTests.cs + +//using Windows.UI.Xaml.Tests.MUXControls.InteractionTests.Infra; +//using Windows.UI.Xaml.Tests.MUXControls.InteractionTests.Common; +//using Windows.System.Threading; +//using Windows.Foundation; +//using Windows.Foundation.Metadata; +//using Common; +//using System; +//using System.Collections.Generic; +//using System.Threading; +//using System.Threading.Tasks; + +//#if USING_TAEF +//using WEX.TestExecution; +//using WEX.TestExecution.Markup; +//using WEX.Logging.Interop; +//#else +//using Microsoft.VisualStudio.TestTools.UnitTesting; +//using Microsoft.VisualStudio.TestTools.UnitTesting.Logging; +//#endif + +//using Microsoft.Windows.Apps.Test.Automation; +//using Microsoft.Windows.Apps.Test.Foundation; +//using Microsoft.Windows.Apps.Test.Foundation.Controls; +//using Microsoft.Windows.Apps.Test.Foundation.Patterns; +//using Microsoft.Windows.Apps.Test.Foundation.Waiters; + +//namespace Windows.UI.Xaml.Tests.MUXControls.InteractionTests +//{ +// using Window = Microsoft.Windows.Apps.Test.Foundation.Controls.Window; + +// [TestClass] +// public class SwipeControlTests +// { +// [ClassInitialize] +// [TestProperty("RunAs", "User")] +// [TestProperty("Classification", "Integration")] +// [TestProperty("TestPass:IncludeOnlyOn", "Desktop")] +// public static void ClassInitialize(TestContext testContext) +// { +// TestEnvironment.Initialize(testContext); +// } + +// [TestCleanup] +// public void TestCleanup() +// { +// TestCleanupHelper.Cleanup(); +// } + +// [TestMethod] +// public void CanSwipeToExecuteHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl1"); +// var SwipeControl1 = FindElement.ByName("SwipeControl1"); +// Verify.IsNotNull(SwipeControl1); +// Log.Comment("Find the SwipeItem1IdleCheckBox"); +// CheckBox SwipeItem1IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem1IdleCheckBox")); +// Verify.IsNotNull(SwipeItem1IdleCheckBox, "Verifying that SwipeItem1IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem1OpenCheckBox"); +// CheckBox SwipeItem1OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem1OpenCheckBox")); +// Verify.IsNotNull(SwipeItem1OpenCheckBox, "Verifying that SwipeItem1OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl1, Direction.West); +// WaitForChecked(SwipeItem1OpenCheckBox); +// WaitForChecked(SwipeItem1IdleCheckBox); +// WaitForUnchecked(SwipeItem1OpenCheckBox); +// WaitForChecked(SwipeItem1IdleCheckBox); +// Verify.AreEqual("command's text", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanSwipeToExecuteVertical() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) +// { +// Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl8"); +// var SwipeControl8 = FindElement.ByName("SwipeControl8"); +// Verify.IsNotNull(SwipeControl8); +// Log.Comment("Find the SwipeItem8IdleCheckBox"); +// CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); +// Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem8OpenCheckBox"); +// CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); +// Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl8, Direction.North); +// WaitForChecked(SwipeItem8OpenCheckBox); +// WaitForChecked(SwipeItem8IdleCheckBox); +// WaitForUnchecked(SwipeItem8OpenCheckBox); +// WaitForChecked(SwipeItem8IdleCheckBox); +// Verify.AreEqual("ExecuteItem", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanClearItemsWithoutCrashing() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) +// { +// Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); +// return; +// } + + +// Log.Comment("Navigating to clear items test page"); +// UIObject navigateToClearPageObject = FindElement.ByName("navigateToClear"); +// Verify.IsNotNull(navigateToClearPageObject, "Verifying that navigateToClear Button was found"); + +// Button navigateToClearPageButton = new Button(navigateToClearPageObject); +// navigateToClearPageButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find FindItemsSum textblock"); +// TextBlock sumOfSwipeItemsCount = new TextBlock(FindElement.ByName("SwipeItemsChildSum")); +// Verify.IsNotNull(sumOfSwipeItemsCount); +// Verify.AreEqual("2", sumOfSwipeItemsCount.GetText()); + +// Log.Comment("Find clear SwipeItems button"); +// Button clearItemsButton = new Button(FindElement.ByName("ClearItemsButton")); +// Verify.IsNotNull(clearItemsButton); +// clearItemsButton.Invoke(); +// Wait.ForIdle(); +// Verify.AreEqual("0", sumOfSwipeItemsCount.GetText()); + + +// Log.Comment("Find add SwipeItem button"); +// Button addItemsButton = new Button(FindElement.ByName("AddItemsButton")); +// Verify.IsNotNull(addItemsButton); +// addItemsButton.Invoke(); +// Wait.ForIdle(); +// // Only adds horizontal items, see test app for explanation +// Verify.AreEqual("1", sumOfSwipeItemsCount.GetText()); + +// Log.Comment("clearing items again"); +// clearItemsButton.Invoke(); +// Wait.ForIdle(); +// Verify.AreEqual("0", sumOfSwipeItemsCount.GetText()); + + +// } +// } + + +// [TestMethod] +// public void CanSwipeAndTapFirstRevealedItemHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { + +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanSwipeAndTapSecondtRevealedItemHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem2"); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// Verify.AreEqual("RevealItem2", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanSwipeAndTapFirstRevealedItemVertical() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) +// { +// Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl8"); +// var SwipeControl8 = FindElement.ByName("SwipeControl8"); +// Verify.IsNotNull(SwipeControl8); +// Log.Comment("Find the SwipeItem8IdleCheckBox"); +// CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); +// Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem8OpenCheckBox"); +// CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); +// Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl8, Direction.South); +// WaitForChecked(SwipeItem8OpenCheckBox); +// WaitForChecked(SwipeItem8IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem8OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem8IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } - [TestMethod] - public void CanSwipeAndTapSecondRevealedItemVertical() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl8"); - var SwipeControl8 = FindElement.ByName("SwipeControl8"); - Verify.IsNotNull(SwipeControl8); - Log.Comment("Find the SwipeItem8IdleCheckBox"); - CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); - Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem8OpenCheckBox"); - CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); - Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl8, Direction.South); - WaitForChecked(SwipeItem8OpenCheckBox); - WaitForChecked(SwipeItem8IdleCheckBox); - TapItem("RevealItem2"); - WaitForUnchecked(SwipeItem8OpenCheckBox); - WaitForChecked(SwipeItem8IdleCheckBox); - Verify.AreEqual("RevealItem2", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod]// replace with Dmitry's more reliable method - [TestProperty("Ignore", "True")] // Disabled as per tracking issue #3125 - public void SwipeDoesntJumpWhenItReverts() - { - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - var XPosition = new TextBlock(FindElement.ByName("PositionX")); - Verify.IsNotNull(XPosition); - //SwipeTapAndVerify("SwipeControl4", Direction.East, "RevealItem1", "RevealItem1"); - Verify.AreEqual("146", XPosition.DocumentText); - KeyboardHelper.PressKey(Key.PageDown); - - bool pass = false; - while (XPosition.DocumentText != 0.ToString()) - { - double xPoistion = 0; - Double.TryParse(XPosition.DocumentText.ToString(), out xPoistion); - - // ensures that we get an intermediate value at least once. - if (xPoistion < 146 && xPoistion > 0) - { - pass = true; - } - } - - Verify.AreEqual(true, pass); - //EnsureAllSwipesAreDismissed(); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - - [TestMethod] - public void CanSwipeAndTapBothItemsHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - TapItem("RevealItem2"); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - Verify.AreEqual("RevealItem2", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanSwipeMultipleItemsWithSameSwipeService() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl2"); - var SwipeControl2 = FindElement.ByName("SwipeControl2"); - Verify.IsNotNull(SwipeControl2); - Log.Comment("Find the SwipeItem2IdleCheckBox"); - CheckBox SwipeItem2IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")); - Verify.IsNotNull(SwipeItem2IdleCheckBox, "Verifying that SwipeItem2IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem2OpenCheckBox"); - CheckBox SwipeItem2OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")); - Verify.IsNotNull(SwipeItem2OpenCheckBox, "Verifying that SwipeItem2OpenCheckBox Button was found"); - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - PerformSwipe(SwipeControl2, Direction.East); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - WaitForChecked(SwipeItem2OpenCheckBox); - WaitForChecked(SwipeItem2IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem2OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem2IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanAddSameSwipeItemsInBothSidesHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem2"); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - Verify.AreEqual("RevealItem2", textblock.DocumentText); - - PerformSwipe(SwipeControl4, Direction.West); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } +// [TestMethod] +// public void CanSwipeAndTapSecondRevealedItemVertical() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl8"); +// var SwipeControl8 = FindElement.ByName("SwipeControl8"); +// Verify.IsNotNull(SwipeControl8); +// Log.Comment("Find the SwipeItem8IdleCheckBox"); +// CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); +// Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem8OpenCheckBox"); +// CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); +// Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl8, Direction.South); +// WaitForChecked(SwipeItem8OpenCheckBox); +// WaitForChecked(SwipeItem8IdleCheckBox); +// TapItem("RevealItem2"); +// WaitForUnchecked(SwipeItem8OpenCheckBox); +// WaitForChecked(SwipeItem8IdleCheckBox); +// Verify.AreEqual("RevealItem2", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod]// replace with Dmitry's more reliable method +// [TestProperty("Ignore", "True")] // Disabled as per tracking issue #3125 +// public void SwipeDoesntJumpWhenItReverts() +// { +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// var XPosition = new TextBlock(FindElement.ByName("PositionX")); +// Verify.IsNotNull(XPosition); +// //SwipeTapAndVerify("SwipeControl4", Direction.East, "RevealItem1", "RevealItem1"); +// Verify.AreEqual("146", XPosition.DocumentText); +// KeyboardHelper.PressKey(Key.PageDown); + +// bool pass = false; +// while (XPosition.DocumentText != 0.ToString()) +// { +// double xPoistion = 0; +// Double.TryParse(XPosition.DocumentText.ToString(), out xPoistion); + +// // ensures that we get an intermediate value at least once. +// if (xPoistion < 146 && xPoistion > 0) +// { +// pass = true; +// } +// } + +// Verify.AreEqual(true, pass); +// //EnsureAllSwipesAreDismissed(); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + + +// [TestMethod] +// public void CanSwipeAndTapBothItemsHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); +// TapItem("RevealItem2"); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// Verify.AreEqual("RevealItem2", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanSwipeMultipleItemsWithSameSwipeService() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl2"); +// var SwipeControl2 = FindElement.ByName("SwipeControl2"); +// Verify.IsNotNull(SwipeControl2); +// Log.Comment("Find the SwipeItem2IdleCheckBox"); +// CheckBox SwipeItem2IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")); +// Verify.IsNotNull(SwipeItem2IdleCheckBox, "Verifying that SwipeItem2IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem2OpenCheckBox"); +// CheckBox SwipeItem2OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")); +// Verify.IsNotNull(SwipeItem2OpenCheckBox, "Verifying that SwipeItem2OpenCheckBox Button was found"); +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); +// PerformSwipe(SwipeControl2, Direction.East); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// WaitForChecked(SwipeItem2OpenCheckBox); +// WaitForChecked(SwipeItem2IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem2OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem2IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanAddSameSwipeItemsInBothSidesHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem2"); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// Verify.AreEqual("RevealItem2", textblock.DocumentText); + +// PerformSwipe(SwipeControl4, Direction.West); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } - [TestMethod] - public void ValidateItemsLessThanThresholdDontRevertHorizontal() // add a vertical equivalent - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl2"); - var SwipeControl2 = FindElement.ByName("SwipeControl2"); - Verify.IsNotNull(SwipeControl2); - Log.Comment("Find the SwipeItem2IdleCheckBox"); - CheckBox SwipeItem2IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")); - Verify.IsNotNull(SwipeItem2IdleCheckBox, "Verifying that SwipeItem2IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem2OpenCheckBox"); - CheckBox SwipeItem2OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")); - Verify.IsNotNull(SwipeItem2OpenCheckBox, "Verifying that SwipeItem2OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl2, Direction.East); - WaitForChecked(SwipeItem2OpenCheckBox); - WaitForChecked(SwipeItem2IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem2OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem2IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void ValidateSwipeDoesntCrashOnAddingMoreItemsThanItsSizeHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl3"); - var SwipeControl3 = FindElement.ByName("SwipeControl3"); - Verify.IsNotNull(SwipeControl3); - Log.Comment("Find the SwipeItem3IdleCheckBox"); - CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); - Verify.IsNotNull(SwipeItem3IdleCheckBox, "Verifying that SwipeItem3IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem3OpenCheckBox"); - CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); - Verify.IsNotNull(SwipeItem3OpenCheckBox, "Verifying that SwipeItem3OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl3, Direction.East); - WaitForChecked(SwipeItem3OpenCheckBox); - WaitForChecked(SwipeItem3IdleCheckBox); - TapItem("RevealItem3"); - Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem3", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - [TestProperty("Description", "When swiping items not set on one side, the main content shouldn't move, and it shouldn't throw an access violation exception.")] - public void ValidateSwipeCanHaveNoItemsOnASideHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Get the two swipe controls."); - var swipeControl8 = FindElement.ByName("SwipeControl8"); - - Verify.IsNotNull(swipeControl8); - - Log.Comment("Get the two swipe controls."); - var swipeControl9 = FindElement.ByName("SwipeControl9"); - - Verify.IsNotNull(swipeControl8); - Verify.IsNotNull(swipeControl9); - - // Verifying it doesn't crash - // same note as before, it might not open, and we still pass the test. - PerformSwipe(swipeControl8, Direction.East); - PerformSwipe(swipeControl9, Direction.West); +// [TestMethod] +// public void ValidateItemsLessThanThresholdDontRevertHorizontal() // add a vertical equivalent +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl2"); +// var SwipeControl2 = FindElement.ByName("SwipeControl2"); +// Verify.IsNotNull(SwipeControl2); +// Log.Comment("Find the SwipeItem2IdleCheckBox"); +// CheckBox SwipeItem2IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")); +// Verify.IsNotNull(SwipeItem2IdleCheckBox, "Verifying that SwipeItem2IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem2OpenCheckBox"); +// CheckBox SwipeItem2OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")); +// Verify.IsNotNull(SwipeItem2OpenCheckBox, "Verifying that SwipeItem2OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl2, Direction.East); +// WaitForChecked(SwipeItem2OpenCheckBox); +// WaitForChecked(SwipeItem2IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem2OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem2IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void ValidateSwipeDoesntCrashOnAddingMoreItemsThanItsSizeHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl3"); +// var SwipeControl3 = FindElement.ByName("SwipeControl3"); +// Verify.IsNotNull(SwipeControl3); +// Log.Comment("Find the SwipeItem3IdleCheckBox"); +// CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); +// Verify.IsNotNull(SwipeItem3IdleCheckBox, "Verifying that SwipeItem3IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem3OpenCheckBox"); +// CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); +// Verify.IsNotNull(SwipeItem3OpenCheckBox, "Verifying that SwipeItem3OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl3, Direction.East); +// WaitForChecked(SwipeItem3OpenCheckBox); +// WaitForChecked(SwipeItem3IdleCheckBox); +// TapItem("RevealItem3"); +// Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem3", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// [TestProperty("Description", "When swiping items not set on one side, the main content shouldn't move, and it shouldn't throw an access violation exception.")] +// public void ValidateSwipeCanHaveNoItemsOnASideHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Get the two swipe controls."); +// var swipeControl8 = FindElement.ByName("SwipeControl8"); + +// Verify.IsNotNull(swipeControl8); + +// Log.Comment("Get the two swipe controls."); +// var swipeControl9 = FindElement.ByName("SwipeControl9"); + +// Verify.IsNotNull(swipeControl8); +// Verify.IsNotNull(swipeControl9); + +// // Verifying it doesn't crash +// // same note as before, it might not open, and we still pass the test. +// PerformSwipe(swipeControl8, Direction.East); +// PerformSwipe(swipeControl9, Direction.West); - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void PressingAnyKeyDismissesSwipe() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - KeyboardHelper.PressKey(Key.PageDown); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void TogglingTheWindowStateDismissesSwipe() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void PressingAnyKeyDismissesSwipe() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); +// KeyboardHelper.PressKey(Key.PageDown); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void TogglingTheWindowStateDismissesSwipe() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - Window window = new Window(TestEnvironment.Application.ApplicationFrameWindow); - WindowVisualState initialVisualState = window.WindowVisualState; - WindowVisualState desiredVisualState; - - if(initialVisualState == WindowVisualState.Normal) - { - desiredVisualState = WindowVisualState.Maximized; - } - else - { - desiredVisualState = WindowVisualState.Normal; - } - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - // Maximize the app, which will also trigger it to supsend. Wait for Suspending event from app. - Log.Comment("Toggling the window's state..."); - window.SetWindowVisualState(desiredVisualState); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - - - window.SetWindowVisualState(WindowVisualState.Maximized); - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void SwipeIsNotTabStop() - { - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Getting swipe controls."); - var swipeControl1 = FindElement.ByName("SwipeControl1"); - var swipeControl2 = FindElement.ByName("SwipeControl2"); - Verify.IsNotNull(swipeControl1); - Verify.IsNotNull(swipeControl2); - - FocusHelper.SetFocus(swipeControl1); - Verify.IsTrue(swipeControl1.HasKeyboardFocus); - KeyboardHelper.PressKey(Key.Tab); - Verify.IsTrue(swipeControl2.HasKeyboardFocus); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void AdditionalGridDoesntOverExtendHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - var textbox = new TextBlock(FindElement.ByName("TextBox")); - Verify.IsNotNull(textbox); - - PerformSwipe(FindElement.ByName("SwipeControl3"), Direction.West); - - Verify.AreEqual("376, 284", textbox.DocumentText); - TapItem("Scale Up"); - Verify.AreEqual("676, 284", textbox.DocumentText); - TapItem("Scale Down"); - Verify.AreEqual("376, 284", textbox.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void ContentGridDoesntOverExtendHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl1"); - var SwipeControl1 = FindElement.ByName("SwipeControl1"); - Verify.IsNotNull(SwipeControl1); - Log.Comment("Find the SwipeItem1IdleCheckBox"); - CheckBox SwipeItem1IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem1IdleCheckBox")); - Verify.IsNotNull(SwipeItem1IdleCheckBox, "Verifying that SwipeItem1IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem1OpenCheckBox"); - CheckBox SwipeItem1OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem1OpenCheckBox")); - Verify.IsNotNull(SwipeItem1OpenCheckBox, "Verifying that SwipeItem1OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl1, Direction.East); - WaitForChecked(SwipeItem1OpenCheckBox); - WaitForChecked(SwipeItem1IdleCheckBox); - WaitForUnchecked(SwipeItem1OpenCheckBox); - WaitForChecked(SwipeItem1IdleCheckBox); - Verify.AreEqual("Scale Up", textblock.DocumentText); - - var textbox = new TextBlock(FindElement.ByName("TextBox")); - Verify.IsNotNull(textbox); - - Verify.AreEqual("676, 676", textbox.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CantOverSwipeToTheOtherSideWhenSwipeItemsAreRevealedHorizontal() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// Window window = new Window(TestEnvironment.Application.ApplicationFrameWindow); +// WindowVisualState initialVisualState = window.WindowVisualState; +// WindowVisualState desiredVisualState; + +// if(initialVisualState == WindowVisualState.Normal) +// { +// desiredVisualState = WindowVisualState.Maximized; +// } +// else +// { +// desiredVisualState = WindowVisualState.Normal; +// } + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); +// // Maximize the app, which will also trigger it to supsend. Wait for Suspending event from app. +// Log.Comment("Toggling the window's state..."); +// window.SetWindowVisualState(desiredVisualState); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); + + +// window.SetWindowVisualState(WindowVisualState.Maximized); +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void SwipeIsNotTabStop() +// { +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Getting swipe controls."); +// var swipeControl1 = FindElement.ByName("SwipeControl1"); +// var swipeControl2 = FindElement.ByName("SwipeControl2"); +// Verify.IsNotNull(swipeControl1); +// Verify.IsNotNull(swipeControl2); + +// FocusHelper.SetFocus(swipeControl1); +// Verify.IsTrue(swipeControl1.HasKeyboardFocus); +// KeyboardHelper.PressKey(Key.Tab); +// Verify.IsTrue(swipeControl2.HasKeyboardFocus); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void AdditionalGridDoesntOverExtendHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// var textbox = new TextBlock(FindElement.ByName("TextBox")); +// Verify.IsNotNull(textbox); + +// PerformSwipe(FindElement.ByName("SwipeControl3"), Direction.West); + +// Verify.AreEqual("376, 284", textbox.DocumentText); +// TapItem("Scale Up"); +// Verify.AreEqual("676, 284", textbox.DocumentText); +// TapItem("Scale Down"); +// Verify.AreEqual("376, 284", textbox.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void ContentGridDoesntOverExtendHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl1"); +// var SwipeControl1 = FindElement.ByName("SwipeControl1"); +// Verify.IsNotNull(SwipeControl1); +// Log.Comment("Find the SwipeItem1IdleCheckBox"); +// CheckBox SwipeItem1IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem1IdleCheckBox")); +// Verify.IsNotNull(SwipeItem1IdleCheckBox, "Verifying that SwipeItem1IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem1OpenCheckBox"); +// CheckBox SwipeItem1OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem1OpenCheckBox")); +// Verify.IsNotNull(SwipeItem1OpenCheckBox, "Verifying that SwipeItem1OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl1, Direction.East); +// WaitForChecked(SwipeItem1OpenCheckBox); +// WaitForChecked(SwipeItem1IdleCheckBox); +// WaitForUnchecked(SwipeItem1OpenCheckBox); +// WaitForChecked(SwipeItem1IdleCheckBox); +// Verify.AreEqual("Scale Up", textblock.DocumentText); + +// var textbox = new TextBlock(FindElement.ByName("TextBox")); +// Verify.IsNotNull(textbox); + +// Verify.AreEqual("676, 676", textbox.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CantOverSwipeToTheOtherSideWhenSwipeItemsAreRevealedHorizontal() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); - Log.Comment("Find the SwipeControl2"); - var SwipeControl2 = FindElement.ByName("SwipeControl2"); - Verify.IsNotNull(SwipeControl2); - Log.Comment("Find the SwipeItem2IdleCheckBox"); - CheckBox SwipeItem2IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")); - Verify.IsNotNull(SwipeItem2IdleCheckBox, "Verifying that SwipeItem2IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem2OpenCheckBox"); - CheckBox SwipeItem2OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")); - Verify.IsNotNull(SwipeItem2OpenCheckBox, "Verifying that SwipeItem2OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl2, Direction.East); - WaitForChecked(SwipeItem2OpenCheckBox); - WaitForChecked(SwipeItem2IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem2OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem2IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - PerformSwipe(SwipeControl2, Direction.West); - WaitForUnchecked(SwipeItem2OpenCheckBox); - WaitForChecked(SwipeItem2IdleCheckBox); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CantOverSwipeToTheOtherSideWhenSwipeItemsAreRevealedVertical() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl8"); - var SwipeControl8 = FindElement.ByName("SwipeControl8"); - Verify.IsNotNull(SwipeControl8); - Log.Comment("Find the SwipeItem8IdleCheckBox"); - CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); - Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem8OpenCheckBox"); - CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); - Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl8, Direction.South); - WaitForChecked(SwipeItem8OpenCheckBox); - WaitForChecked(SwipeItem8IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem8OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem8IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - PerformSwipe(SwipeControl8, Direction.North); - WaitForUnchecked(SwipeItem8OpenCheckBox); - WaitForChecked(SwipeItem8IdleCheckBox); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void SwipeDismissThenSwipe() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - TapItem("ResetButton"); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem2"); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - Verify.AreEqual("RevealItem2", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanSwipeBackFromAnOpenedSwipe() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - PerformSwipe(SwipeControl4, Direction.West); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CanSwipeOtherDirectionAfterClosingAnOpenedSwipe() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); - - TapItem("ResetButton"); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - - PerformSwipe(SwipeControl4, Direction.West); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem2"); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - Verify.AreEqual("RevealItem2", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void SwipingDoesntModifyTheSizeOfSwipeControl() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - var resetButton = new Button(FindElement.ByName("ResetButton")); - Verify.IsNotNull(resetButton); - - // Horizontal, and Vertical - var swipes = new[] { FindElement.ByName("SwipeControl2"), FindElement.ByName("SwipeControl8") }; - var directions = new[] { Direction.West, Direction.North }; - var idleCheckBoxes = new[] { new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")), new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")) }; - var openCheckBoxes = new[] { new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")), new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")) }; - for (int i = 0; i < swipes.Length; i++) - { - var swipe = swipes[i]; - var direction = directions[i]; - var idleCheckBox = idleCheckBoxes[i]; - var openCheckBox = openCheckBoxes[i]; - Verify.IsNotNull(swipe); - int widthBefore = swipe.BoundingRectangle.Width; - int heightBefore = swipe.BoundingRectangle.Height; - PerformSwipe(swipe, direction); - int widthDuring = swipe.BoundingRectangle.Width; - int heightDuring = swipe.BoundingRectangle.Height; - WaitForChecked(openCheckBox); - WaitForChecked(idleCheckBox); - WaitForUnchecked(openCheckBox); - WaitForChecked(idleCheckBox); - - int widthAfter = swipe.BoundingRectangle.Width; - int heightAfter = swipe.BoundingRectangle.Height; - Verify.AreEqual("ExecuteItem", textblock.DocumentText); - Verify.AreEqual(widthBefore, widthDuring); - Verify.AreEqual(heightBefore, heightDuring); - Verify.AreEqual(widthBefore, widthAfter); - Verify.AreEqual(heightBefore, heightAfter); - resetButton.Invoke(); - } - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } +// Log.Comment("Find the SwipeControl2"); +// var SwipeControl2 = FindElement.ByName("SwipeControl2"); +// Verify.IsNotNull(SwipeControl2); +// Log.Comment("Find the SwipeItem2IdleCheckBox"); +// CheckBox SwipeItem2IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")); +// Verify.IsNotNull(SwipeItem2IdleCheckBox, "Verifying that SwipeItem2IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem2OpenCheckBox"); +// CheckBox SwipeItem2OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")); +// Verify.IsNotNull(SwipeItem2OpenCheckBox, "Verifying that SwipeItem2OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl2, Direction.East); +// WaitForChecked(SwipeItem2OpenCheckBox); +// WaitForChecked(SwipeItem2IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem2OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem2IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); +// PerformSwipe(SwipeControl2, Direction.West); +// WaitForUnchecked(SwipeItem2OpenCheckBox); +// WaitForChecked(SwipeItem2IdleCheckBox); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CantOverSwipeToTheOtherSideWhenSwipeItemsAreRevealedVertical() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl8"); +// var SwipeControl8 = FindElement.ByName("SwipeControl8"); +// Verify.IsNotNull(SwipeControl8); +// Log.Comment("Find the SwipeItem8IdleCheckBox"); +// CheckBox SwipeItem8IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")); +// Verify.IsNotNull(SwipeItem8IdleCheckBox, "Verifying that SwipeItem8IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem8OpenCheckBox"); +// CheckBox SwipeItem8OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")); +// Verify.IsNotNull(SwipeItem8OpenCheckBox, "Verifying that SwipeItem8OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl8, Direction.South); +// WaitForChecked(SwipeItem8OpenCheckBox); +// WaitForChecked(SwipeItem8IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem8OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem8IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); +// PerformSwipe(SwipeControl8, Direction.North); +// WaitForUnchecked(SwipeItem8OpenCheckBox); +// WaitForChecked(SwipeItem8IdleCheckBox); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void SwipeDismissThenSwipe() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// TapItem("ResetButton"); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem2"); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// Verify.AreEqual("RevealItem2", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanSwipeBackFromAnOpenedSwipe() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); +// PerformSwipe(SwipeControl4, Direction.West); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CanSwipeOtherDirectionAfterClosingAnOpenedSwipe() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); + +// TapItem("ResetButton"); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); + +// PerformSwipe(SwipeControl4, Direction.West); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem2"); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// Verify.AreEqual("RevealItem2", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void SwipingDoesntModifyTheSizeOfSwipeControl() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// var resetButton = new Button(FindElement.ByName("ResetButton")); +// Verify.IsNotNull(resetButton); + +// // Horizontal, and Vertical +// var swipes = new[] { FindElement.ByName("SwipeControl2"), FindElement.ByName("SwipeControl8") }; +// var directions = new[] { Direction.West, Direction.North }; +// var idleCheckBoxes = new[] { new CheckBox(FindElement.ByName("SwipeItem2IdleCheckBox")), new CheckBox(FindElement.ByName("SwipeItem8IdleCheckBox")) }; +// var openCheckBoxes = new[] { new CheckBox(FindElement.ByName("SwipeItem2OpenCheckBox")), new CheckBox(FindElement.ByName("SwipeItem8OpenCheckBox")) }; +// for (int i = 0; i < swipes.Length; i++) +// { +// var swipe = swipes[i]; +// var direction = directions[i]; +// var idleCheckBox = idleCheckBoxes[i]; +// var openCheckBox = openCheckBoxes[i]; +// Verify.IsNotNull(swipe); +// int widthBefore = swipe.BoundingRectangle.Width; +// int heightBefore = swipe.BoundingRectangle.Height; +// PerformSwipe(swipe, direction); +// int widthDuring = swipe.BoundingRectangle.Width; +// int heightDuring = swipe.BoundingRectangle.Height; +// WaitForChecked(openCheckBox); +// WaitForChecked(idleCheckBox); +// WaitForUnchecked(openCheckBox); +// WaitForChecked(idleCheckBox); + +// int widthAfter = swipe.BoundingRectangle.Width; +// int heightAfter = swipe.BoundingRectangle.Height; +// Verify.AreEqual("ExecuteItem", textblock.DocumentText); +// Verify.AreEqual(widthBefore, widthDuring); +// Verify.AreEqual(heightBefore, heightDuring); +// Verify.AreEqual(widthBefore, widthAfter); +// Verify.AreEqual(heightBefore, heightAfter); +// resetButton.Invoke(); +// } + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } - [TestMethod] - public void SwipeItemsAreNullifiedWhenTheAnimationIsDone() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - // Bug: 12734833 - if (PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - return; - } - - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) - { - Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - - using (Context.RawContext.Activate()) - { - var item1 = FindElement.ByName("RevealItem1"); - var firstChild = SwipeControl4.FirstChild; - - Verify.IsNotNull(item1); - Verify.IsNotNull(firstChild); - Verify.AreEqual(item1, firstChild); - - PerformSwipe(SwipeControl4, Direction.West); - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - - firstChild = SwipeControl4.FirstChild; - // The first child becomes the text block - Verify.AreNotEqual(item1, firstChild); - } - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - [Description("Regression test for MSFT:9096017 - Validates that after an initial swipe, SwipeControl doesn't offset to the point where you first released your finger on the start of the new interaction.")] - public void SwipingDoesntChangeTheBoundsOfSwipeControl() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } +// [TestMethod] +// public void SwipeItemsAreNullifiedWhenTheAnimationIsDone() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// // Bug: 12734833 +// if (PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// return; +// } + +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2)) +// { +// Log.Warning("Test is disabled because RS1 doesn't have the right interaction tracker APIs."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); + +// using (Context.RawContext.Activate()) +// { +// var item1 = FindElement.ByName("RevealItem1"); +// var firstChild = SwipeControl4.FirstChild; + +// Verify.IsNotNull(item1); +// Verify.IsNotNull(firstChild); +// Verify.AreEqual(item1, firstChild); + +// PerformSwipe(SwipeControl4, Direction.West); +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); + +// firstChild = SwipeControl4.FirstChild; +// // The first child becomes the text block +// Verify.AreNotEqual(item1, firstChild); +// } + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// [Description("Regression test for MSFT:9096017 - Validates that after an initial swipe, SwipeControl doesn't offset to the point where you first released your finger on the start of the new interaction.")] +// public void SwipingDoesntChangeTheBoundsOfSwipeControl() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - var SwipeControl6 = FindElement.ByName("SwipeControl6"); - - // Save off the original bounding rectangle so that we can validate that the - // swipe container did not offset on the next interaction. - var originalBounds = SwipeControl6.BoundingRectangle; - - Log.Comment("Initiate the first interaction (a swipe)."); - - Verify.IsNotNull(SwipeControl6); - PerformSwipe(SwipeControl6, Direction.West); - - AutoResetEvent autoEvent = new AutoResetEvent(false); - - // Execute the TapAndHold call on an off thread so that we can validate - // the bounds hasn't changed during the hold. - var op = System.Threading.ThreadPool.RunAsync(new WorkItemHandler((IAsyncAction result) => - { - Log.Comment("Initiate a long tap and validate that the bounding rectangle doesn't change."); - Verify.IsNotNull(SwipeControl6); - InputHelper.TapAndHold(SwipeControl6, 5000); - autoEvent.Set(); - })); - - Log.Comment("Main thread start to validate the bounds"); - - while (!autoEvent.WaitOne(250)) - { - Verify.AreEqual(originalBounds.X, SwipeControl6.BoundingRectangle.X); - Verify.AreEqual(originalBounds.Y, SwipeControl6.BoundingRectangle.Y); - } - - Log.Comment("Main thread stop the validation"); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void TappingOutsideARevealedSwipeDismissesIt() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - DismissRevealedSwipe(true); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void ClickingOutsideARevealedSwipeDismissesIt() - { - if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) - { - Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); - return; - } - - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - DismissRevealedSwipe(false); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void SwipeItemInheritsICommand2Properties() - { - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) - { - Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); - return; - } +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// var SwipeControl6 = FindElement.ByName("SwipeControl6"); + +// // Save off the original bounding rectangle so that we can validate that the +// // swipe container did not offset on the next interaction. +// var originalBounds = SwipeControl6.BoundingRectangle; + +// Log.Comment("Initiate the first interaction (a swipe)."); + +// Verify.IsNotNull(SwipeControl6); +// PerformSwipe(SwipeControl6, Direction.West); + +// AutoResetEvent autoEvent = new AutoResetEvent(false); + +// // Execute the TapAndHold call on an off thread so that we can validate +// // the bounds hasn't changed during the hold. +// var op = System.Threading.ThreadPool.RunAsync(new WorkItemHandler((IAsyncAction result) => +// { +// Log.Comment("Initiate a long tap and validate that the bounding rectangle doesn't change."); +// Verify.IsNotNull(SwipeControl6); +// InputHelper.TapAndHold(SwipeControl6, 5000); +// autoEvent.Set(); +// })); + +// Log.Comment("Main thread start to validate the bounds"); + +// while (!autoEvent.WaitOne(250)) +// { +// Verify.AreEqual(originalBounds.X, SwipeControl6.BoundingRectangle.X); +// Verify.AreEqual(originalBounds.Y, SwipeControl6.BoundingRectangle.Y); +// } + +// Log.Comment("Main thread stop the validation"); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void TappingOutsideARevealedSwipeDismissesIt() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// DismissRevealedSwipe(true); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void ClickingOutsideARevealedSwipeDismissesIt() +// { +// if (PlatformConfiguration.IsOSVersionLessThan(OSVersion.Redstone5)) +// { +// Log.Warning("This test relies on touch input, the injection of which is only supported in RS5 and up. Test is disabled."); +// return; +// } + +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// DismissRevealedSwipe(false); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void SwipeItemInheritsICommand2Properties() +// { +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) +// { +// Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); +// return; +// } - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl10"); - var SwipeControl10 = FindElement.ByName("SwipeControl10"); - Verify.IsNotNull(SwipeControl10); - Log.Comment("Find the SwipeItem10IdleCheckBox"); - CheckBox SwipeItem10IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem10IdleCheckBox")); - Verify.IsNotNull(SwipeItem10IdleCheckBox, "Verifying that SwipeItem10IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem10OpenCheckBox"); - CheckBox SwipeItem10OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem10OpenCheckBox")); - Verify.IsNotNull(SwipeItem10OpenCheckBox, "Verifying that SwipeItem10OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl10, Direction.East); - WaitForChecked(SwipeItem10OpenCheckBox); - WaitForChecked(SwipeItem10IdleCheckBox); - TapItem("UICommand Label"); - Verify.AreEqual(ToggleState.On, SwipeItem10OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem10IdleCheckBox.ToggleState); - Verify.AreEqual("UICommand Label", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void CloseOnOpenedAndClosedSwipeItemsWorks() - { - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) - { - Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl3"); - var SwipeControl3 = FindElement.ByName("SwipeControl3"); - Verify.IsNotNull(SwipeControl3); - Log.Comment("Find the SwipeItem3IdleCheckBox"); - CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); - Verify.IsNotNull(SwipeItem3IdleCheckBox, "Verifying that SwipeItem3IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem3OpenCheckBox"); - CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); - Verify.IsNotNull(SwipeItem3OpenCheckBox, "Verifying that SwipeItem3OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl3, Direction.East); - WaitForChecked(SwipeItem3OpenCheckBox); - WaitForChecked(SwipeItem3IdleCheckBox); - TapItem("RevealItem5"); - Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); - Verify.AreEqual("sc11.Close()", textblock.DocumentText); - TapItem("RevealItem4"); - WaitForUnchecked(SwipeItem3OpenCheckBox); - WaitForChecked(SwipeItem3IdleCheckBox); - Verify.AreEqual("sc3.Close()", textblock.DocumentText); - - Log.Comment("Find the SwipeControl9"); - var SwipeControl9 = FindElement.ByName("SwipeControl9"); - Verify.IsNotNull(SwipeControl9); - Log.Comment("Find the SwipeItem9IdleCheckBox"); - CheckBox SwipeItem9IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem9IdleCheckBox")); - Verify.IsNotNull(SwipeItem9IdleCheckBox, "Verifying that SwipeItem9IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem9OpenCheckBox"); - CheckBox SwipeItem9OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem9OpenCheckBox")); - Verify.IsNotNull(SwipeItem9OpenCheckBox, "Verifying that SwipeItem9OpenCheckBox Button was found"); - - PerformSwipe(SwipeControl9, Direction.South); - WaitForChecked(SwipeItem9OpenCheckBox); - WaitForChecked(SwipeItem9IdleCheckBox); - WaitForUnchecked(SwipeItem9OpenCheckBox); - WaitForChecked(SwipeItem9IdleCheckBox); - Verify.AreEqual("sc9.Close()", textblock.DocumentText); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void OnlyProgramaticCloseWillCloseRemainOpenExecuteItems() - { - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) - { - Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); - return; - } - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - Log.Comment("Find the SwipeControl11"); - var SwipeControl11 = FindElement.ByName("SwipeControl11"); - Verify.IsNotNull(SwipeControl11); - Log.Comment("Find the SwipeItem11IdleCheckBox"); - CheckBox SwipeItem11IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem11IdleCheckBox")); - Verify.IsNotNull(SwipeItem11IdleCheckBox, "Verifying that SwipeItem11IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem11OpenCheckBox"); - CheckBox SwipeItem11OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem11OpenCheckBox")); - Verify.IsNotNull(SwipeItem11OpenCheckBox, "Verifying that SwipeItem11OpenCheckBox Button was found"); - - Log.Comment("Find the SwipeControl3"); - var SwipeControl3 = FindElement.ByName("SwipeControl3"); - Verify.IsNotNull(SwipeControl3); - Log.Comment("Find the SwipeItem3IdleCheckBox"); - CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); - Verify.IsNotNull(SwipeItem3IdleCheckBox, "Verifying that SwipeItem3IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem3OpenCheckBox"); - CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); - Verify.IsNotNull(SwipeItem3OpenCheckBox, "Verifying that SwipeItem3OpenCheckBox Button was found"); - - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - Window window = new Window(TestEnvironment.Application.ApplicationFrameWindow); - - PerformSwipe(SwipeControl11, Direction.East); - WaitForChecked(SwipeItem11OpenCheckBox); - WaitForChecked(SwipeItem11IdleCheckBox); - Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); - PerformSwipe(SwipeControl11, Direction.West); - Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); - Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); - window.SetWindowVisualState(WindowVisualState.Normal); - window.SetWindowVisualState(WindowVisualState.Maximized); - Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); - Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); - TapItem("ExecuteRemainOpen"); - Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); - Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); - PerformSwipe(SwipeControl3, Direction.East); - WaitForChecked(SwipeItem3OpenCheckBox); - WaitForChecked(SwipeItem3IdleCheckBox); - Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); - Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); - TapItem("RevealItem5"); - WaitForUnchecked(SwipeItem11OpenCheckBox); - WaitForChecked(SwipeItem11IdleCheckBox); - Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); - Verify.AreEqual("sc11.Close()", textblock.DocumentText); +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl10"); +// var SwipeControl10 = FindElement.ByName("SwipeControl10"); +// Verify.IsNotNull(SwipeControl10); +// Log.Comment("Find the SwipeItem10IdleCheckBox"); +// CheckBox SwipeItem10IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem10IdleCheckBox")); +// Verify.IsNotNull(SwipeItem10IdleCheckBox, "Verifying that SwipeItem10IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem10OpenCheckBox"); +// CheckBox SwipeItem10OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem10OpenCheckBox")); +// Verify.IsNotNull(SwipeItem10OpenCheckBox, "Verifying that SwipeItem10OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl10, Direction.East); +// WaitForChecked(SwipeItem10OpenCheckBox); +// WaitForChecked(SwipeItem10IdleCheckBox); +// TapItem("UICommand Label"); +// Verify.AreEqual(ToggleState.On, SwipeItem10OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem10IdleCheckBox.ToggleState); +// Verify.AreEqual("UICommand Label", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void CloseOnOpenedAndClosedSwipeItemsWorks() +// { +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) +// { +// Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl3"); +// var SwipeControl3 = FindElement.ByName("SwipeControl3"); +// Verify.IsNotNull(SwipeControl3); +// Log.Comment("Find the SwipeItem3IdleCheckBox"); +// CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); +// Verify.IsNotNull(SwipeItem3IdleCheckBox, "Verifying that SwipeItem3IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem3OpenCheckBox"); +// CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); +// Verify.IsNotNull(SwipeItem3OpenCheckBox, "Verifying that SwipeItem3OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl3, Direction.East); +// WaitForChecked(SwipeItem3OpenCheckBox); +// WaitForChecked(SwipeItem3IdleCheckBox); +// TapItem("RevealItem5"); +// Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); +// Verify.AreEqual("sc11.Close()", textblock.DocumentText); +// TapItem("RevealItem4"); +// WaitForUnchecked(SwipeItem3OpenCheckBox); +// WaitForChecked(SwipeItem3IdleCheckBox); +// Verify.AreEqual("sc3.Close()", textblock.DocumentText); + +// Log.Comment("Find the SwipeControl9"); +// var SwipeControl9 = FindElement.ByName("SwipeControl9"); +// Verify.IsNotNull(SwipeControl9); +// Log.Comment("Find the SwipeItem9IdleCheckBox"); +// CheckBox SwipeItem9IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem9IdleCheckBox")); +// Verify.IsNotNull(SwipeItem9IdleCheckBox, "Verifying that SwipeItem9IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem9OpenCheckBox"); +// CheckBox SwipeItem9OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem9OpenCheckBox")); +// Verify.IsNotNull(SwipeItem9OpenCheckBox, "Verifying that SwipeItem9OpenCheckBox Button was found"); + +// PerformSwipe(SwipeControl9, Direction.South); +// WaitForChecked(SwipeItem9OpenCheckBox); +// WaitForChecked(SwipeItem9IdleCheckBox); +// WaitForUnchecked(SwipeItem9OpenCheckBox); +// WaitForChecked(SwipeItem9IdleCheckBox); +// Verify.AreEqual("sc9.Close()", textblock.DocumentText); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void OnlyProgramaticCloseWillCloseRemainOpenExecuteItems() +// { +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) +// { +// Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); +// return; +// } + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// Log.Comment("Find the SwipeControl11"); +// var SwipeControl11 = FindElement.ByName("SwipeControl11"); +// Verify.IsNotNull(SwipeControl11); +// Log.Comment("Find the SwipeItem11IdleCheckBox"); +// CheckBox SwipeItem11IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem11IdleCheckBox")); +// Verify.IsNotNull(SwipeItem11IdleCheckBox, "Verifying that SwipeItem11IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem11OpenCheckBox"); +// CheckBox SwipeItem11OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem11OpenCheckBox")); +// Verify.IsNotNull(SwipeItem11OpenCheckBox, "Verifying that SwipeItem11OpenCheckBox Button was found"); + +// Log.Comment("Find the SwipeControl3"); +// var SwipeControl3 = FindElement.ByName("SwipeControl3"); +// Verify.IsNotNull(SwipeControl3); +// Log.Comment("Find the SwipeItem3IdleCheckBox"); +// CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); +// Verify.IsNotNull(SwipeItem3IdleCheckBox, "Verifying that SwipeItem3IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem3OpenCheckBox"); +// CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); +// Verify.IsNotNull(SwipeItem3OpenCheckBox, "Verifying that SwipeItem3OpenCheckBox Button was found"); + +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// Window window = new Window(TestEnvironment.Application.ApplicationFrameWindow); + +// PerformSwipe(SwipeControl11, Direction.East); +// WaitForChecked(SwipeItem11OpenCheckBox); +// WaitForChecked(SwipeItem11IdleCheckBox); +// Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); +// PerformSwipe(SwipeControl11, Direction.West); +// Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); +// Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); +// window.SetWindowVisualState(WindowVisualState.Normal); +// window.SetWindowVisualState(WindowVisualState.Maximized); +// Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); +// Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); +// TapItem("ExecuteRemainOpen"); +// Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); +// Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); +// PerformSwipe(SwipeControl3, Direction.East); +// WaitForChecked(SwipeItem3OpenCheckBox); +// WaitForChecked(SwipeItem3IdleCheckBox); +// Verify.AreEqual(ToggleState.On, SwipeItem11OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem11IdleCheckBox.ToggleState); +// Verify.AreEqual("ExecuteRemainOpen", textblock.DocumentText); +// TapItem("RevealItem5"); +// WaitForUnchecked(SwipeItem11OpenCheckBox); +// WaitForChecked(SwipeItem11IdleCheckBox); +// Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); +// Verify.AreEqual("sc11.Close()", textblock.DocumentText); - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - [TestMethod] - public void SwipeContentBackgroundResetsOnClose() - { - using (var setup = new TestSetupHelper("SwipeControl Tests")) - { - if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) - { - Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); - return; - } - - SetOutputDebugStringLevel("Info"); - - Log.Comment("Navigating to List Items with simple swipe items"); - UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); - Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); - - Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); - navigateToSimpleContentsButton.Invoke(); - Wait.ForIdle(); - - SetLoggingLevel(isPrivateLoggingEnabled: true); - - Log.Comment("Find the SwipeControl3"); - var SwipeControl3 = FindElement.ByName("SwipeControl3"); - Verify.IsNotNull(SwipeControl3); - Log.Comment("Find the SwipeItem3IdleCheckBox"); - CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); - Log.Comment("Find the SwipeItem3OpenCheckBox"); - CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); - - Log.Comment("Getting the Swipe3BackgroundColorTextBlock"); - var textblock = new TextBlock(FindElement.ByName("Swipe3BackgroundColorTextBlock")); +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// [TestMethod] +// public void SwipeContentBackgroundResetsOnClose() +// { +// using (var setup = new TestSetupHelper("SwipeControl Tests")) +// { +// if (!ApiInformation.IsTypePresent("Windows.UI.Xaml.Input.XamlUICommand")) +// { +// Log.Warning("Test is disabled because UICommand doesn't exist as a type on this build."); +// return; +// } + +// SetOutputDebugStringLevel("Info"); + +// Log.Comment("Navigating to List Items with simple swipe items"); +// UIObject navigateToSimpleContentsUIObject = FindElement.ByName("navigateToSimpleContents"); +// Verify.IsNotNull(navigateToSimpleContentsUIObject, "Verifying that navigateToSimpleContents Button was found"); + +// Button navigateToSimpleContentsButton = new Button(navigateToSimpleContentsUIObject); +// navigateToSimpleContentsButton.Invoke(); +// Wait.ForIdle(); + +// SetLoggingLevel(isPrivateLoggingEnabled: true); + +// Log.Comment("Find the SwipeControl3"); +// var SwipeControl3 = FindElement.ByName("SwipeControl3"); +// Verify.IsNotNull(SwipeControl3); +// Log.Comment("Find the SwipeItem3IdleCheckBox"); +// CheckBox SwipeItem3IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem3IdleCheckBox")); +// Log.Comment("Find the SwipeItem3OpenCheckBox"); +// CheckBox SwipeItem3OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem3OpenCheckBox")); + +// Log.Comment("Getting the Swipe3BackgroundColorTextBlock"); +// var textblock = new TextBlock(FindElement.ByName("Swipe3BackgroundColorTextBlock")); - PerformSwipe(SwipeControl3, Direction.East); - WaitForChecked(SwipeItem3OpenCheckBox); - WaitForChecked(SwipeItem3IdleCheckBox); - Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); - Verify.AreEqual("#FF008000", textblock.DocumentText); - - TapItem("RevealItem2"); - WaitForUnchecked(SwipeItem3OpenCheckBox); - WaitForChecked(SwipeItem3IdleCheckBox); - Verify.AreEqual(ToggleState.Off, SwipeItem3OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); - Verify.AreEqual("null", textblock.DocumentText); - - SetLoggingLevel(isPrivateLoggingEnabled: false); - LogTraces(); - - Log.Comment("Returning to the main Swipe test page"); - TestSetupHelper.GoBack(); - } - } - - private void DismissRevealedSwipe(bool withOutsideTap) - { - if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) - { - Log.Warning("Test is disabled on RS1 and phone."); - return; - } - - Log.Comment("Find the SwipeControl4"); - var SwipeControl4 = FindElement.ByName("SwipeControl4"); - Verify.IsNotNull(SwipeControl4); - Log.Comment("Find the SwipeItem4IdleCheckBox"); - CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); - Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); - Log.Comment("Find the SwipeItem4OpenCheckBox"); - CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); - Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); - Log.Comment("Getting the textblock"); - var textblock = new TextBlock(FindElement.ByName("TextBlock")); - Verify.IsNotNull(textblock); - - PerformSwipe(SwipeControl4, Direction.East); - WaitForChecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - TapItem("RevealItem1"); - Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); - Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); - Verify.AreEqual("RevealItem1", textblock.DocumentText); +// PerformSwipe(SwipeControl3, Direction.East); +// WaitForChecked(SwipeItem3OpenCheckBox); +// WaitForChecked(SwipeItem3IdleCheckBox); +// Verify.AreEqual(ToggleState.On, SwipeItem3OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); +// Verify.AreEqual("#FF008000", textblock.DocumentText); + +// TapItem("RevealItem2"); +// WaitForUnchecked(SwipeItem3OpenCheckBox); +// WaitForChecked(SwipeItem3IdleCheckBox); +// Verify.AreEqual(ToggleState.Off, SwipeItem3OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem3IdleCheckBox.ToggleState); +// Verify.AreEqual("null", textblock.DocumentText); + +// SetLoggingLevel(isPrivateLoggingEnabled: false); +// LogTraces(); + +// Log.Comment("Returning to the main Swipe test page"); +// TestSetupHelper.GoBack(); +// } +// } + +// private void DismissRevealedSwipe(bool withOutsideTap) +// { +// if (!PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone2) || PlatformConfiguration.IsDevice(DeviceType.Phone)) +// { +// Log.Warning("Test is disabled on RS1 and phone."); +// return; +// } + +// Log.Comment("Find the SwipeControl4"); +// var SwipeControl4 = FindElement.ByName("SwipeControl4"); +// Verify.IsNotNull(SwipeControl4); +// Log.Comment("Find the SwipeItem4IdleCheckBox"); +// CheckBox SwipeItem4IdleCheckBox = new CheckBox(FindElement.ByName("SwipeItem4IdleCheckBox")); +// Verify.IsNotNull(SwipeItem4IdleCheckBox, "Verifying that SwipeItem4IdleCheckBox Button was found"); +// Log.Comment("Find the SwipeItem4OpenCheckBox"); +// CheckBox SwipeItem4OpenCheckBox = new CheckBox(FindElement.ByName("SwipeItem4OpenCheckBox")); +// Verify.IsNotNull(SwipeItem4OpenCheckBox, "Verifying that SwipeItem4OpenCheckBox Button was found"); +// Log.Comment("Getting the textblock"); +// var textblock = new TextBlock(FindElement.ByName("TextBlock")); +// Verify.IsNotNull(textblock); + +// PerformSwipe(SwipeControl4, Direction.East); +// WaitForChecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// TapItem("RevealItem1"); +// Verify.AreEqual(ToggleState.On, SwipeItem4OpenCheckBox.ToggleState); +// Verify.AreEqual(ToggleState.On, SwipeItem4IdleCheckBox.ToggleState); +// Verify.AreEqual("RevealItem1", textblock.DocumentText); - var swipePage = FindElement.ByName("SwipePage"); - - if (withOutsideTap) - { - InputHelper.Tap(swipePage, 20, 20); - } - else - { - InputHelper.LeftClick(swipePage, 20, 20); - } - - WaitForUnchecked(SwipeItem4OpenCheckBox); - WaitForChecked(SwipeItem4IdleCheckBox); - } - - private void PerformSwipe(UIObject element, Direction direction) - { - int distance = 150; - InputHelper.Pan(element, distance, direction, 1500, 0.001f, 100, false); - Log.Comment("PerformSwipe completed."); - } - - private bool WaitForChecked(CheckBox checkBox) - { - return WaitForCheckBoxUpdated(checkBox, ToggleState.On); - } - - private bool WaitForUnchecked(CheckBox checkBox) - { - return WaitForCheckBoxUpdated(checkBox, ToggleState.Off); - } - - // Swipe operation takes 100ms(wipe) + 1500ms(hold) = 1600ms to complete. - // For IdleCheckbox, we also need to wait the for the released item to go back to its original position and trigger IdleStatusChanged event. - // Made the default timeout limit 4000ms to give it enough time to finish. - private bool WaitForCheckBoxUpdated(CheckBox checkBox, ToggleState state, double millisecondsTimeout = 4000, bool throwOnError = true) - { - Log.Comment(checkBox.Name + " Checked: " + checkBox.ToggleState); - if (checkBox.ToggleState == state) - { - return true; - } - else - { - Log.Comment("Waiting for toggle state to change"); - checkBox.GetToggledWaiter().TryWait(TimeSpan.FromMilliseconds(millisecondsTimeout)); - } - if (checkBox.ToggleState != state) - { - Log.Warning(checkBox.Name + " value never changed"); - if (throwOnError) - { - throw new WaiterException(); - } - else - { - return false; - } - } - return true; - } - - private void TapItem(String item) - { - ElementCache.Clear(); - using (Context.RawContext.Activate()) - { - Log.Comment("Tapping on " + item); - var uiItem = FindElement.ByName(item); - Verify.IsNotNull(uiItem); - - if (String.IsNullOrEmpty(uiItem.Name) || String.IsNullOrEmpty(uiItem.AutomationId)) - { - Log.Warning("Item {0} isn't null but doesn't exist anymore.", item); - } - - InputHelper.Tap(uiItem); - } - } - - // outputDebugStringLevel can be "None", "Info" or "Verbose" - private void SetOutputDebugStringLevel(string outputDebugStringLevel) - { - Log.Comment("Retrieving cmbSwipeControlOutputDebugStringLevel"); - ComboBox cmbSwipeControlOutputDebugStringLevel = new ComboBox(FindElement.ByName("cmbSwipeControlOutputDebugStringLevel")); - Verify.IsNotNull(cmbSwipeControlOutputDebugStringLevel, "Verifying that cmbSwipeControlOutputDebugStringLevel was found"); - - Log.Comment("Changing output-debug-string-level selection to " + outputDebugStringLevel); - cmbSwipeControlOutputDebugStringLevel.SelectItemByName(outputDebugStringLevel); - Log.Comment("Selection is now {0}", cmbSwipeControlOutputDebugStringLevel.Selection[0].Name); - } - - private void SetLoggingLevel(bool isPrivateLoggingEnabled) - { - Log.Comment("Retrieving chkLogSwipeControlMessages"); - CheckBox chkLogSwipeControlMessages = new CheckBox(FindElement.ById("chkLogSwipeControlMessages")); - Verify.IsNotNull(chkLogSwipeControlMessages, "Verifying that chkLogSwipeControlMessages was found"); - - if (isPrivateLoggingEnabled && chkLogSwipeControlMessages.ToggleState != ToggleState.On || - !isPrivateLoggingEnabled && chkLogSwipeControlMessages.ToggleState != ToggleState.Off) - { - Log.Comment("Toggling chkLogSwipeControlMessages.IsChecked to " + isPrivateLoggingEnabled); - chkLogSwipeControlMessages.Toggle(); - Wait.ForIdle(); - } - } - - private void LogTraces() - { - LogTraces(recordWarning: false); - } - - private void LogTraces(bool recordWarning) - { - List traces = recordWarning ? new List() : null; - - Log.Comment("Reading full log:"); - - UIObject fullLogUIObject = FindElement.ById("cmbFullLog"); - Verify.IsNotNull(fullLogUIObject); - ComboBox cmbFullLog = new ComboBox(fullLogUIObject); - Verify.IsNotNull(cmbFullLog); - - UIObject getFullLogUIObject = FindElement.ById("btnGetFullLog"); - Verify.IsNotNull(getFullLogUIObject); - Button getFullLogButton = new Button(getFullLogUIObject); - Verify.IsNotNull(getFullLogButton); - - getFullLogButton.Invoke(); - Wait.ForIdle(); - - foreach (ComboBoxItem item in cmbFullLog.AllItems) - { - string trace = item.Name; - - if (recordWarning) - { - traces.Add(trace); - } - Log.Comment(trace); - } - - if (recordWarning) - { - string warning = "Non-final test pass failed."; - Log.Warning(warning); - - WarningReportHelper.Record(warning, traces); - } - } - - private void ClearTraces() - { - Log.Comment("Clearing full log."); - - UIObject clearFullLogUIObject = FindElement.ById("btnClearFullLog"); - Verify.IsNotNull(clearFullLogUIObject); - Button clearFullLogButton = new Button(clearFullLogUIObject); - Verify.IsNotNull(clearFullLogButton); - - clearFullLogButton.Invoke(); - Wait.ForIdle(); - } - - private void LogAndClearTraces() - { - LogAndClearTraces(recordWarning: false); - } - - private void LogAndClearTraces(bool recordWarning) - { - LogTraces(recordWarning); - ClearTraces(); - } - } -} +// var swipePage = FindElement.ByName("SwipePage"); + +// if (withOutsideTap) +// { +// InputHelper.Tap(swipePage, 20, 20); +// } +// else +// { +// InputHelper.LeftClick(swipePage, 20, 20); +// } + +// WaitForUnchecked(SwipeItem4OpenCheckBox); +// WaitForChecked(SwipeItem4IdleCheckBox); +// } + +// private void PerformSwipe(UIObject element, Direction direction) +// { +// int distance = 150; +// InputHelper.Pan(element, distance, direction, 1500, 0.001f, 100, false); +// Log.Comment("PerformSwipe completed."); +// } + +// private bool WaitForChecked(CheckBox checkBox) +// { +// return WaitForCheckBoxUpdated(checkBox, ToggleState.On); +// } + +// private bool WaitForUnchecked(CheckBox checkBox) +// { +// return WaitForCheckBoxUpdated(checkBox, ToggleState.Off); +// } + +// // Swipe operation takes 100ms(wipe) + 1500ms(hold) = 1600ms to complete. +// // For IdleCheckbox, we also need to wait the for the released item to go back to its original position and trigger IdleStatusChanged event. +// // Made the default timeout limit 4000ms to give it enough time to finish. +// private bool WaitForCheckBoxUpdated(CheckBox checkBox, ToggleState state, double millisecondsTimeout = 4000, bool throwOnError = true) +// { +// Log.Comment(checkBox.Name + " Checked: " + checkBox.ToggleState); +// if (checkBox.ToggleState == state) +// { +// return true; +// } +// else +// { +// Log.Comment("Waiting for toggle state to change"); +// checkBox.GetToggledWaiter().TryWait(TimeSpan.FromMilliseconds(millisecondsTimeout)); +// } +// if (checkBox.ToggleState != state) +// { +// Log.Warning(checkBox.Name + " value never changed"); +// if (throwOnError) +// { +// throw new WaiterException(); +// } +// else +// { +// return false; +// } +// } +// return true; +// } + +// private void TapItem(String item) +// { +// ElementCache.Clear(); +// using (Context.RawContext.Activate()) +// { +// Log.Comment("Tapping on " + item); +// var uiItem = FindElement.ByName(item); +// Verify.IsNotNull(uiItem); + +// if (String.IsNullOrEmpty(uiItem.Name) || String.IsNullOrEmpty(uiItem.AutomationId)) +// { +// Log.Warning("Item {0} isn't null but doesn't exist anymore.", item); +// } + +// InputHelper.Tap(uiItem); +// } +// } + +// // outputDebugStringLevel can be "None", "Info" or "Verbose" +// private void SetOutputDebugStringLevel(string outputDebugStringLevel) +// { +// Log.Comment("Retrieving cmbSwipeControlOutputDebugStringLevel"); +// ComboBox cmbSwipeControlOutputDebugStringLevel = new ComboBox(FindElement.ByName("cmbSwipeControlOutputDebugStringLevel")); +// Verify.IsNotNull(cmbSwipeControlOutputDebugStringLevel, "Verifying that cmbSwipeControlOutputDebugStringLevel was found"); + +// Log.Comment("Changing output-debug-string-level selection to " + outputDebugStringLevel); +// cmbSwipeControlOutputDebugStringLevel.SelectItemByName(outputDebugStringLevel); +// Log.Comment("Selection is now {0}", cmbSwipeControlOutputDebugStringLevel.Selection[0].Name); +// } + +// private void SetLoggingLevel(bool isPrivateLoggingEnabled) +// { +// Log.Comment("Retrieving chkLogSwipeControlMessages"); +// CheckBox chkLogSwipeControlMessages = new CheckBox(FindElement.ById("chkLogSwipeControlMessages")); +// Verify.IsNotNull(chkLogSwipeControlMessages, "Verifying that chkLogSwipeControlMessages was found"); + +// if (isPrivateLoggingEnabled && chkLogSwipeControlMessages.ToggleState != ToggleState.On || +// !isPrivateLoggingEnabled && chkLogSwipeControlMessages.ToggleState != ToggleState.Off) +// { +// Log.Comment("Toggling chkLogSwipeControlMessages.IsChecked to " + isPrivateLoggingEnabled); +// chkLogSwipeControlMessages.Toggle(); +// Wait.ForIdle(); +// } +// } + +// private void LogTraces() +// { +// LogTraces(recordWarning: false); +// } + +// private void LogTraces(bool recordWarning) +// { +// List traces = recordWarning ? new List() : null; + +// Log.Comment("Reading full log:"); + +// UIObject fullLogUIObject = FindElement.ById("cmbFullLog"); +// Verify.IsNotNull(fullLogUIObject); +// ComboBox cmbFullLog = new ComboBox(fullLogUIObject); +// Verify.IsNotNull(cmbFullLog); + +// UIObject getFullLogUIObject = FindElement.ById("btnGetFullLog"); +// Verify.IsNotNull(getFullLogUIObject); +// Button getFullLogButton = new Button(getFullLogUIObject); +// Verify.IsNotNull(getFullLogButton); + +// getFullLogButton.Invoke(); +// Wait.ForIdle(); + +// foreach (ComboBoxItem item in cmbFullLog.AllItems) +// { +// string trace = item.Name; + +// if (recordWarning) +// { +// traces.Add(trace); +// } +// Log.Comment(trace); +// } + +// if (recordWarning) +// { +// string warning = "Non-final test pass failed."; +// Log.Warning(warning); + +// WarningReportHelper.Record(warning, traces); +// } +// } + +// private void ClearTraces() +// { +// Log.Comment("Clearing full log."); + +// UIObject clearFullLogUIObject = FindElement.ById("btnClearFullLog"); +// Verify.IsNotNull(clearFullLogUIObject); +// Button clearFullLogButton = new Button(clearFullLogUIObject); +// Verify.IsNotNull(clearFullLogButton); + +// clearFullLogButton.Invoke(); +// Wait.ForIdle(); +// } + +// private void LogAndClearTraces() +// { +// LogAndClearTraces(recordWarning: false); +// } + +// private void LogAndClearTraces(bool recordWarning) +// { +// LogTraces(recordWarning); +// ClearTraces(); +// } +// } +//} diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.cs index 918cf47d3ccf..908fb5467b9d 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl.cpp + using System; using System.Numerics; using Windows.Foundation; diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.h.cs index b7ea77b7adbe..6e439670958a 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.h.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeControl.h + using System; using Windows.UI.Composition; using Windows.UI.Composition.Interactions; diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.cs index 111eada2b2bb..616cd74fd138 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.cs @@ -3,6 +3,9 @@ // DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/Generated/SwipeControl.properties.cpp + namespace Windows.UI.Xaml.Controls { public partial class SwipeControl diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.h.cs index 994b5013573a..f723417efe57 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeControl.properties.h.cs @@ -2,7 +2,9 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. // DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen -#pragma once + +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/Generated/SwipeControl.properties.cpp namespace Windows.UI.Xaml.Controls { diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.cs index 367c0ad7a071..c5a42ffb7951 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.cs @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. - // IconSource is implemented in WUX in the OS repo, so we don't need to // include IconSource.h on that side. + +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeItem.cpp + using System; using System.Windows.Input; using Windows.UI.Xaml.Input; diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.h.cs index 4d7945a89bad..eb1935a99eef 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.h.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeItem.h + namespace Windows.UI.Xaml.Controls { public partial class SwipeItem diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.cs index 801e7ddd9efd..4428288f4bff 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.cs @@ -3,6 +3,9 @@ // DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/Generated/SwipeItem.properties.cpp + using System.Windows.Input; using Windows.Foundation; using Windows.UI.Xaml.Media; diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.h.cs index 9d9345176eaf..855b49194632 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItem.properties.h.cs @@ -2,6 +2,10 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. // DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen + +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/Generated/SwipeItem.properties.h + using Windows.Foundation; #pragma once diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.cs index 9f5051fbc178..4ed87f433825 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeItemInvokedEventArgs.cpp + namespace Windows.UI.Xaml.Controls { public partial class SwipeItemInvokedEventArgs diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.h.cs index 27a070fd37de..f9a524f11897 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItemInvokedEventArgs.h.cs @@ -1,6 +1,9 @@ //// Copyright (c) Microsoft Corporation. All rights reserved. //// Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeItemInvokedEventArgs.h + //#pragma once diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs index d66871c5ec41..d1ce65748cd7 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeItems.cpp + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs index 746cdf92d0ec..898ee8e9d30e 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.h.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeItem.h + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs index b4e43d270276..85b2078f4f6c 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.cs @@ -3,6 +3,9 @@ // DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/Generated/SwipeItems.properties.cpp + namespace Windows.UI.Xaml.Controls { public partial class SwipeItems diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs index 85966faa62c3..f9f36497ebef 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeItems.properties.h.cs @@ -3,6 +3,9 @@ // DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/Generated/SwipeItems.properties.h + namespace Windows.UI.Xaml.Controls { public partial class SwipeItems diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.cs index 8d26d8c6438e..fc8c30a3c9fd 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.cs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeTestHooks.cpp + using Windows.Foundation; using Windows.UI.Xaml.Controls; diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.h.cs index 4f7f6653957e..d9ef156bce47 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.h.cs @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using Windows.Foundation; +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeTestHooks.h -#pragma once +using Windows.Foundation; namespace Windows.UI.Xaml.Controls { diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.properties.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.properties.cs index 889ff1d0ea8b..26eb07990e56 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.properties.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooks.properties.cs @@ -3,6 +3,9 @@ //// DO NOT EDIT! This file was generated by CustomTasks.DependencyPropertyCodeGen +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/Generated/SwipeTestHooks.properties.h + //namespace winrt.Microsoft.UI.Private.Controls //{ // CppWinRTActivatableClassWithBasicFactory(SwipeTestHooks) diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.cs index 19b56fbf5172..66b00e195358 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.cs @@ -1,4 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. - +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeTestHooksFactory.cpp diff --git a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.h.cs b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.h.cs index 3639af6eeabb..b95afbe4f9bf 100644 --- a/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.h.cs +++ b/src/Uno.UI/UI/Xaml/Controls/SwipeControl/SwipeTestHooksFactory.h.cs @@ -1,6 +1,7 @@ //// Copyright (c) Microsoft Corporation. All rights reserved. //// Licensed under the MIT License. See LICENSE in the project root for license information. -//#pragma once +// Imported in uno on 2021/03/21 from commit 307bd99682cccaa128483036b764c0b7c862d666 +// https://github.com/microsoft/microsoft-ui-xaml/blob/307bd99682cccaa128483036b764c0b7c862d666/dev/SwipeControl/SwipeTestHooksFactory.h