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
|
|
|
|
{
|
2018-04-19 07:58:03 -07:00
|
|
|
|
testRunner.OpenEmptyPartTab();
|
|
|
|
|
|
|
2017-10-27 14:19:26 -07:00
|
|
|
|
testRunner.AddItemToBedplate();
|
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
|
|
|
|
|
2018-01-08 23:34:40 -08:00
|
|
|
|
testRunner.ClickByName("Duplicate Button");
|
2017-06-05 22:51:28 -07:00
|
|
|
|
|
2016-10-19 11:10:30 -07:00
|
|
|
|
// wait for the copy to finish
|
2017-02-01 10:12:31 -08:00
|
|
|
|
testRunner.Delay(.1);
|
2018-01-08 23:34:40 -08:00
|
|
|
|
testRunner.ClickByName("Remove Button");
|
2015-09-01 16:03:29 -07:00
|
|
|
|
|
2017-06-06 18:19:02 -07:00
|
|
|
|
testRunner.SaveBedplateToFolder("0Test Part", "Local Library Row Item Collection");
|
2017-06-05 22:51:28 -07:00
|
|
|
|
|
|
|
|
|
|
// Click Home -> Local Library
|
2017-06-18 10:02:34 -07:00
|
|
|
|
testRunner.NavigateToLibraryHome();
|
2017-06-05 22:51:28 -07:00
|
|
|
|
testRunner.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
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|