diff --git a/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml/DragAndDropTests/DragDrop_TreeView_Reorder_Automated.cs b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml/DragAndDropTests/DragDrop_TreeView_Reorder_Automated.cs index 6f45c7aef470..38af39b9120a 100644 --- a/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml/DragAndDropTests/DragDrop_TreeView_Reorder_Automated.cs +++ b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml/DragAndDropTests/DragDrop_TreeView_Reorder_Automated.cs @@ -5,6 +5,7 @@ using Uno.UITest.Helpers.Queries; using System.Linq; using System; +using System.Threading.Tasks; namespace SamplesApp.UITests.Windows_UI_Xaml.DragAndDropTests { @@ -25,6 +26,10 @@ public void When_Dragging_TreeView_Item() var bt2 = _app.Marked("bt2"); var bt3 = _app.Marked("bt3"); var focusbt = _app.Marked("focusbt"); + var radio_disable = _app.Marked("radio_disable"); + + _app.WaitForElement(radio_disable); + _app.Tap(radio_disable); _app.WaitForElement(tv); _app.Tap(bt1); @@ -64,5 +69,34 @@ public void When_Dragging_TreeView_Item() result = _app.Screenshot("result3"); ImageAssert.AreEqual(case3, result); } + + [Test] + [AutoRetry] + [ActivePlatforms(Platform.Browser)] + public void When_OnDragItemsCompleted() + { + Run("UITests.Windows_UI_Xaml.DragAndDrop.DragDrop_TreeView", skipInitialScreenshot: true); + var tv = _app.Marked("tv"); + var bt0 = _app.Marked("bt0"); + var radio_enable = _app.Marked("radio_enable"); + var tb = _app.Marked("tb"); + + _app.WaitForElement(tv); + + _app.WaitForElement(radio_enable); + _app.Tap(radio_enable); + _app.WaitForElement(bt0); + _app.Tap(bt0); + + var tvBounds = _app.Query("tv").Single().Rect; + float fromX = tvBounds.X + 100; + float fromY = tvBounds.Y + _itemHeight * 3 + _offset; + float toX = tvBounds.X + 100; + float toY = tvBounds.Y + _offset; + _app.DragCoordinates(fromX, fromY, toX, toY); + + string text = _app.GetText("tb").Trim(); + Assert.AreEqual("DragItemsCompleted is triggered", text); + } } } diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml/DragAndDrop/DragDrop_TreeView.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml/DragAndDrop/DragDrop_TreeView.xaml index 9849384f35f9..501054dde76d 100644 --- a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml/DragAndDrop/DragDrop_TreeView.xaml +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml/DragAndDrop/DragDrop_TreeView.xaml @@ -24,5 +24,8 @@