diff --git a/PartPreviewWindow/View3D/UndoCommands/GroupCommand.cs b/PartPreviewWindow/View3D/UndoCommands/GroupCommand.cs index c5b248f00..5b166a2eb 100644 --- a/PartPreviewWindow/View3D/UndoCommands/GroupCommand.cs +++ b/PartPreviewWindow/View3D/UndoCommands/GroupCommand.cs @@ -56,12 +56,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { selectedItem.Children.Modify((sChildren) => { - for(int i= sChildren.Count-1; i >= 0; i--) + foreach(var child in sChildren) { - var child = sChildren[i]; - sChildren.RemoveAt(i); gChildren.Add(child); } + + sChildren.Clear(); }); }); scene.Children.Add(newGroup); diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index daf36cf56..948a1c298 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -161,8 +161,12 @@ namespace MatterHackers.MatterControl.Tests.Automation public static void CloseSignInAndPrinterSelect(this AutomationRunner testRunner, PrepAction preAction = PrepAction.CloseSignInAndPrinterSelect) { - // NOTE: Tests fail to detect and close this Window when delay is ~.5 - // + SystemWindow systemWindow; + testRunner.GetWidgetByName("View3DWidget", out systemWindow); + // make sure we wait for MC to be up and running + testRunner.WaitforDraw(systemWindow); + + // If there is a auth pannel make sure we try and close it // Non-MCCentral builds won't have the plugin. Reduce the wait time for these cases if (testRunner.WaitForName("Connection Wizard Skip Sign In Button", 1)) {