mattercontrol/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs
John Lewin 9a5d872486 Automation updates
- Revise skirt_distance label per support team
 - Remove CreateInstance(showWindow) out variable
 - Remove embedded tools requiring showWindow out variable
 - Remove queueItemFolderToAdd variable/parameter
 - Change AfterFirstDraw event to null conditional invoke
 - Removed unused AutomationTest from MatterControlApplication
 - Refactor for style consistency and document new methods
 - Change queueItemFolderToAdd type to custom enum to ensure optional parameters are not mixed up
 - Ensure TestExportZip file is deleted before attempting export
2015-12-22 13:06:47 -08:00

55 lines
No EOL
2.1 KiB
C#

using MatterHackers.Agg.PlatformAbstract;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.UI.Tests;
using MatterHackers.GuiAutomation;
using NUnit.Framework;
using System;
using System.IO;
namespace MatterHackers.MatterControl.UI
{
[TestFixture, Category("MatterControl.UI"), RunInApplicationDomain]
public class SqLiteLibraryProviderTests
{
[Test, RequiresSTA, RunInApplicationDomain]
public void LibraryQueueViewRefreshesOnAddItem()
{
// Run a copy of MatterControl
Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
{
AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
{
testRunner.ClickByName("Library Tab", 5);
MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection");
resultsHarness.AddTestResult(testRunner.ClickByName("3D View Edit", 3));
resultsHarness.AddTestResult(testRunner.ClickByName("3D View Copy", 3), "Click Copy");
// wait for the copy to finish
testRunner.Wait(.1);
resultsHarness.AddTestResult(testRunner.ClickByName("3D View Delete", 3), "Click Delete");
resultsHarness.AddTestResult(testRunner.ClickByName("Save As Menu", 3), "Click Save As Menu");
resultsHarness.AddTestResult(testRunner.ClickByName("Save As Menu Item", 3), "Click Save As");
testRunner.Wait(1);
testRunner.Type("Test Part");
resultsHarness.AddTestResult(MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"));
resultsHarness.AddTestResult(testRunner.ClickByName("Save As Save Button", 1));
// ensure that it is now in the library folder (that the folder updated)
resultsHarness.AddTestResult(testRunner.WaitForName("Row Item " + "Test Part", 5), "The part we added should be in the library");
MatterControlUtilities.CloseMatterControl(testRunner);
}
};
AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items);
Assert.IsTrue(testHarness.AllTestsPassed);
Assert.IsTrue(testHarness.TestCount == 8); // make sure we ran all our tests
}
}
}