2017-06-05 22:51:28 -07:00
|
|
|
|
using System.Threading;
|
2016-10-25 06:17:37 -07:00
|
|
|
|
using System.Threading.Tasks;
|
2016-08-01 17:21:31 -07:00
|
|
|
|
using MatterHackers.MatterControl.PartPreviewWindow;
|
2015-09-01 16:03:29 -07:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
2016-05-11 09:13:56 -07:00
|
|
|
|
namespace MatterHackers.MatterControl.Tests.Automation
|
2015-09-01 16:03:29 -07:00
|
|
|
|
{
|
2017-06-05 22:51:28 -07:00
|
|
|
|
[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Apartment(ApartmentState.STA)]
|
2015-09-01 16:03:29 -07:00
|
|
|
|
public class SqLiteLibraryProviderTests
|
|
|
|
|
|
{
|
2017-06-05 22:51:28 -07:00
|
|
|
|
[Test]
|
2016-10-25 06:17:37 -07:00
|
|
|
|
public async Task LibraryQueueViewRefreshesOnAddItem()
|
2015-09-01 16:03:29 -07:00
|
|
|
|
{
|
2017-06-05 22:51:28 -07:00
|
|
|
|
await MatterControlUtilities.RunTest((testRunner) =>
|
2015-09-01 16:03:29 -07:00
|
|
|
|
{
|
2022-02-03 17:21:51 -08:00
|
|
|
|
testRunner.OpenPartTab()
|
2021-06-11 11:23:15 -07:00
|
|
|
|
.AddItemToBed();
|
2015-09-01 16:03:29 -07:00
|
|
|
|
|
2017-06-05 22:51:28 -07:00
|
|
|
|
var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget;
|
2020-09-11 19:59:14 -07:00
|
|
|
|
var scene = view3D.Object3DControlLayer.Scene;
|
2017-09-16 01:11:44 -07:00
|
|
|
|
|
2018-09-30 09:12:11 -07:00
|
|
|
|
testRunner.WaitFor(() => scene.SelectedItem != null);
|
2018-10-12 17:25:00 -07:00
|
|
|
|
Assert.IsNotNull(scene.SelectedItem, "Expect part selection after Add to Bed action");
|
2015-09-01 16:03:29 -07:00
|
|
|
|
|
2021-06-11 11:23:15 -07:00
|
|
|
|
testRunner.ClickByName("Duplicate Button")
|
|
|
|
|
|
// wait for the copy to finish
|
|
|
|
|
|
.Delay(.1)
|
|
|
|
|
|
.ClickByName("Remove Button")
|
|
|
|
|
|
.SaveBedplateToFolder("0Test Part", "Local Library Row Item Collection")
|
|
|
|
|
|
// Click Home -> Local Library
|
|
|
|
|
|
.NavigateToLibraryHome()
|
|
|
|
|
|
.NavigateToFolder("Local Library Row Item Collection");
|
2016-08-01 17:21:31 -07:00
|
|
|
|
|
2016-10-19 11:10:30 -07:00
|
|
|
|
// ensure that it is now in the library folder (that the folder updated)
|
2017-06-14 14:02:29 -07:00
|
|
|
|
Assert.IsTrue(testRunner.WaitForName("Row Item 0Test Part"), "The part we added should be in the library");
|
2016-08-01 17:21:31 -07:00
|
|
|
|
|
2017-02-01 10:12:31 -08:00
|
|
|
|
testRunner.Delay(.5);
|
2016-10-25 06:17:37 -07:00
|
|
|
|
|
2017-06-04 08:35:29 -07:00
|
|
|
|
return Task.CompletedTask;
|
2017-06-05 22:51:28 -07:00
|
|
|
|
}, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items, overrideWidth: 1300);
|
2015-09-01 16:03:29 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|