Update tests to redirect to new menu items

This commit is contained in:
John Lewin 2018-04-07 11:21:02 -07:00
parent ef19b792a1
commit d72772f62c
8 changed files with 27 additions and 24 deletions

View file

@ -456,11 +456,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
ToolTipText = "Add an.stl, .obj, .amf, .gcode or.zip file to the Library".Localize(),
Action = (selectedLibraryItems, listView) =>
{
/*
Name = "Library Add Button";
*/
AggContext.FileDialogs.OpenFileDialog(
new OpenFileDialogParams(ApplicationSettings.OpenPrintableFileParams, multiSelect: true),
(openParams) =>
@ -485,10 +480,6 @@ namespace MatterHackers.MatterControl.PrintLibrary
Icon = AggContext.StaticData.LoadIcon("fa-folder-new_16.png", IconColor.Raw),
Action = (selectedLibraryItems, listView) =>
{
/*
Name = "Create Folder From Library Button";
*/
DialogWindow.Show(
new InputBoxPage(
"Create Folder".Localize(),

View file

@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.CloseSignInAndPrinterSelect();
testRunner.NavigateToFolder("Local Library Row Item Collection");
testRunner.ClickByName("Create Folder From Library Button");
testRunner.InvokeLibraryCreateFolderDialog();
testRunner.Delay(.5);
testRunner.Type("Test Text");

View file

@ -19,7 +19,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
//Navigate to Downloads Library Provider
testRunner.NavigateToFolder("Print Queue Row Item Collection");
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
//Get parts to add
string rowItemPath = MatterControlUtilities.GetTestItemPath("Batman.stl");

View file

@ -114,7 +114,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
Assert.IsTrue(File.Exists(exportZipPath), "Queue was exported to zip file, file exists on disk at expected path");
// Import the exported zip file and confirm the Queue Count increases by 3
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
testRunner.Delay(1);
testRunner.Type(exportZipPath);
testRunner.Delay(1);

View file

@ -34,7 +34,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.NavigateToFolder("-Temporary Row Item Collection");
// Add both files to the FileOpen dialog
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
testRunner.CompleteDialog(
string.Format(
"\"{0}\" \"{1}\"",
@ -61,7 +61,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.NavigateToFolder("-Temporary Row Item Collection");
// Add AMF part items to Downloads and then type paths into file dialog
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
testRunner.CompleteDialog(MatterControlUtilities.GetTestItemPath("Rook.amf"), 4);
Assert.IsTrue(testRunner.WaitForName("Row Item Rook.amf"), "Rook item exists");
@ -81,7 +81,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.NavigateToFolder("Downloads Row Item Collection");
testRunner.NavigateToFolder("-Temporary Row Item Collection");
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
testRunner.CompleteDialog(MatterControlUtilities.GetTestItemPath("Test.zip"), 4);
testRunner.DoubleClickByName("Test.zip Row Item Collection");
@ -106,7 +106,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Navigate to Downloads Library Provider
testRunner.NavigateToFolder("Downloads Row Item Collection");
testRunner.NavigateToFolder("-Temporary Row Item Collection");
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
testRunner.CompleteDialog(MatterControlUtilities.GetTestItemPath("Batman.stl"), 2);

View file

@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
Assert.IsFalse(testRunner.WaitForName("Row Item 2013-01-25 Mouthpiece V2", 1), "Mouthpiece part should not exist at test start");
// Add Library item
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
testRunner.Delay(2);
testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.zip"));
testRunner.Delay(1);
@ -118,7 +118,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.NavigateToFolder("Local Library Row Item Collection");
// Create New Folder
testRunner.ClickByName("Create Folder From Library Button");
testRunner.InvokeLibraryCreateFolderDialog();
testRunner.Delay(.5);
testRunner.Type("New Folder");

View file

@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ChangeToQueueContainer();
// Click Add button and select files
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
// Open Fennec_Fox
testRunner.CompleteDialog(
@ -83,7 +83,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ChangeToQueueContainer();
// Click Add button and select files
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
// Open Fennec_Fox, Batman files
testRunner.CompleteDialog(
@ -197,7 +197,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ChangeToQueueContainer();
// Click Add button and select files
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
// Open Rook
testRunner.CompleteDialog(
@ -227,7 +227,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ChangeToQueueContainer();
// Click Add button and select files
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
// Open Batman
testRunner.CompleteDialog(
@ -257,7 +257,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ChangeToQueueContainer();
// Click Add button and select files
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
// Open chichen-itza_pyramid
testRunner.CompleteDialog(

View file

@ -480,6 +480,18 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.Delay(.5);
}
public static void InvokeLibraryAddDialog(this AutomationRunner testRunner)
{
testRunner.ClickByName("Print Library Overflow Menu");
testRunner.ClickByName("Add Menu Item");
}
public static void InvokeLibraryCreateFolderDialog(this AutomationRunner testRunner)
{
testRunner.ClickByName("Print Library Overflow Menu");
testRunner.ClickByName("Create Folder Menu Item");
}
/// <summary>
/// Types the specified text into the dialog and sends {Enter} to complete the interaction
/// </summary>
@ -870,7 +882,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
}
// Add Library item
testRunner.ClickByName("Library Add Button");
testRunner.InvokeLibraryAddDialog();
// Generate the full, quoted paths for the requested assets
string fullQuotedAssetPaths = string.Join(" ", assetNames.Select(name => $"\"{MatterControlUtilities.GetTestItemPath(name)}\""));