Resolve failing tests due to assumed default Part tab

- Issue MatterHackers/MCCentral#3173
This commit is contained in:
John Lewin 2018-04-19 07:58:03 -07:00
parent 3213b22fd8
commit ec760353fa
6 changed files with 23 additions and 13 deletions

View file

@ -226,6 +226,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab
var createPart = new TextButton("Create Part".Localize(), theme)
{
Name = "Create Part Button",
Margin = theme.ButtonSpacing,
BackgroundColor = theme.MinimalShade
};

View file

@ -26,6 +26,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.CloseSignInAndPrinterSelect();
testRunner.OpenEmptyPartTab();
testRunner.AddItemToBedplate();
// Get View3DWidget
@ -59,6 +61,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.CloseSignInAndPrinterSelect();
testRunner.OpenEmptyPartTab();
testRunner.AddItemToBedplate();
// Get View3DWidget and count Scene.Children before Copy button is clicked
@ -106,6 +110,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.CloseSignInAndPrinterSelect();
testRunner.OpenEmptyPartTab();
testRunner.AddItemToBedplate();
var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget;
@ -141,6 +147,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.CloseSignInAndPrinterSelect();
testRunner.OpenEmptyPartTab();
testRunner.AddItemToBedplate();
var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget;

View file

@ -167,6 +167,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.CloseSignInAndPrinterSelect();
testRunner.OpenEmptyPartTab();
testRunner.AddTestAssetsToLibrary("Batman.stl");
var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget;

View file

@ -292,7 +292,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Dismiss pause dialog
testRunner.WaitForName("No Button", 90); // the no button is 'Resume'
// validate the current layer
Assert.AreEqual(1, ApplicationController.Instance.ActivePrinter.Connection.CurrentlyPrintingLayer);
testRunner.ClickByName("No Button");
@ -301,7 +301,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
// close the pause dialog pop-up do not resume
ClickDialogButton(testRunner, "Yes Button", 3);
// Disconnect
// Disconnect
testRunner.ClickByName("Disconnect from printer button");
// Reconnect
@ -472,7 +472,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
scrollable.Width = width - 1;
scrollable.Width = width;
// Tuning values should match
// Tuning values should match
ConfirmExpectedSpeeds(testRunner, initialExtrusionRate, initialFeedRate);
testRunner.Delay();
@ -578,7 +578,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.AddItemToBedplate();
testRunner.StartPrint();
int fanChangedCount = 0;
emulator.FanSpeedChanged += (s, e) =>
{
@ -589,7 +589,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
emulator.WaitForLayer(printer.Settings, 2);
emulator.RunSlow = true;
// Click close but cancel
testRunner.CloseMatterControl();
testRunner.ClickByName("No Button");

View file

@ -15,6 +15,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.CloseSignInAndPrinterSelect();
testRunner.OpenEmptyPartTab();
testRunner.AddItemToBedplate();
var view3D = testRunner.GetWidgetByName("View3DWidget", out _) as View3DWidget;

View file

@ -179,7 +179,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForFirstDraw();
// If there is a auth pannel make sure we try and close it
// If there is an auth panel 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))
{
@ -190,14 +190,11 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.ClickByName("Cancel Wizard Button");
}
}
if (closeInitialPlusTab)
{
var plusTabRegion = testRunner.GetRegionByName("Initial Plus Tab");
testRunner.ClickByName("Close Tab Button", plusTabRegion);
testRunner.WaitForWidgetDisappear("Initial Plus Tab", 2);
}
public static void OpenEmptyPartTab(this AutomationRunner testRunner, bool closeInitialPlusTab = true)
{
testRunner.ClickByName("Create Part Button");
}
public static void ChangeToQueueContainer(this AutomationRunner testRunner)