fixing tests

This commit is contained in:
Lars Brubaker 2022-01-20 17:52:42 -08:00
parent dbd1eb56ce
commit 035b84d065
3 changed files with 26 additions and 1 deletions

View file

@ -250,6 +250,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ClickByName("Start New Design");
}
testRunner.VerifyAndRemovePhil();
return testRunner;
}
@ -430,6 +432,26 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ClickByName("Cancel Wizard Button")
.WaitFor(() => !testRunner.ChildExists<SetupStepComPortOne>());
testRunner.VerifyAndRemovePhil();
return testRunner;
}
public static AutomationRunner VerifyAndRemovePhil(this AutomationRunner testRunner)
{
var view3D = testRunner.GetWidgetByName("View3DWidget", out _, 3) as View3DWidget;
var scene = view3D.Object3DControlLayer.Scene;
testRunner.WaitFor(() => scene.Children.Count == 1);
Assert.AreEqual(1, scene.Children.Count, "Should have a Phil on the bed");
testRunner.WaitFor(() => scene.Children.First().Name == "Phil A Ment.stl");
Assert.AreEqual("Phil A Ment.stl", scene.Children.First().Name);
testRunner.Type("^a"); // clear the selection (type a space)
testRunner.WaitFor(() => scene.SelectedItem != null);
testRunner.Type("{BACKSPACE}");
testRunner.WaitFor(() => scene.Children.Count == 0);
return testRunner;
}