Revise helper for reuse, allow caller to override target folder

- Use IEnumerable<string> instead of params to support target folder
This commit is contained in:
John Lewin 2018-11-02 07:35:26 -07:00
parent b61511da81
commit 0758361f0f
4 changed files with 10 additions and 10 deletions

View file

@ -15,7 +15,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
await MatterControlUtilities.RunTest((testRunner) =>
{
testRunner.AddAndSelectPrinter();
testRunner.AddTestAssetsToLibrary("Batman.stl");
testRunner.AddTestAssetsToLibrary(new[] { "Batman.stl" });
return Task.CompletedTask;
});
@ -27,7 +27,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
await MatterControlUtilities.RunTest((testRunner) =>
{
testRunner.AddAndSelectPrinter();
testRunner.AddTestAssetsToLibrary("Rook.amf", "Batman.stl");
testRunner.AddTestAssetsToLibrary(new[] { "Rook.amf", "Batman.stl" });
return Task.CompletedTask;
});
@ -39,7 +39,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
await MatterControlUtilities.RunTest((testRunner) =>
{
testRunner.AddAndSelectPrinter();
testRunner.AddTestAssetsToLibrary("Rook.amf");
testRunner.AddTestAssetsToLibrary(new[] { "Rook.amf" });
return Task.CompletedTask;
}, overrideWidth: 1024, overrideHeight: 800);
@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.AddAndSelectPrinter();
testRunner.AddTestAssetsToLibrary("Rook.amf");
testRunner.AddTestAssetsToLibrary(new[] { "Rook.amf" });
testRunner.ClickByName("Row Item Rook");
@ -188,7 +188,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.AddAndSelectPrinter();
testRunner.AddTestAssetsToLibrary("Rook.amf");
testRunner.AddTestAssetsToLibrary(new[] { "Rook.amf" });
// Select and remove item
testRunner.ClickByName("Row Item Rook");
@ -208,7 +208,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.AddAndSelectPrinter();
testRunner.AddTestAssetsToLibrary("Rook.amf", "Batman.stl");
testRunner.AddTestAssetsToLibrary(new[] { "Rook.amf", "Batman.stl" });
// Select both items
testRunner.SelectListItems("Row Item Rook", "Row Item Batman");

View file

@ -167,7 +167,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.OpenEmptyPartTab();
testRunner.AddTestAssetsToLibrary("Batman.stl");
testRunner.AddTestAssetsToLibrary(new[] { "Batman.stl" });
var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget;
var scene = view3D.InteractionLayer.Scene;

View file

@ -24,7 +24,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.AddAndSelectPrinter("Airwolf 3D", "HD");
testRunner.AddTestAssetsToLibrary("Rook.amf");
testRunner.AddTestAssetsToLibrary(new[] { "Rook.amf" });
testRunner.AddItemToBedplate("", "Row Item Rook");

View file

@ -1010,10 +1010,10 @@ namespace MatterHackers.MatterControl.Tests.Automation
/// </summary>
/// <param name="testRunner"></param>
/// <param name="assetNames">The test assets to add to the library</param>
public static void AddTestAssetsToLibrary(this AutomationRunner testRunner, params string[] assetNames)
public static void AddTestAssetsToLibrary(this AutomationRunner testRunner, IEnumerable<string> assetNames, string targetLibrary = "Local Library Row Item Collection")
{
// Switch to the Local Library tab
testRunner.NavigateToFolder("Local Library Row Item Collection");
testRunner.NavigateToFolder(targetLibrary);
// Assert that the requested items are *not* in the list
foreach (string assetName in assetNames)