Getting tests to pass
This commit is contained in:
parent
f5711e5e12
commit
72e674c1f3
7 changed files with 25 additions and 55 deletions
|
|
@ -59,42 +59,4 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
base.OnDraw(graphics2D);
|
||||
}
|
||||
}
|
||||
|
||||
public class NewTabButton : GuiWidget
|
||||
{
|
||||
private SimpleTabs parentTabControl;
|
||||
private ThemeConfig theme;
|
||||
|
||||
public NewTabButton(ImageBuffer imageBuffer, SimpleTabs parentTabControl, ThemeConfig theme)
|
||||
{
|
||||
this.parentTabControl = parentTabControl;
|
||||
this.HAnchor = HAnchor.Fit;
|
||||
this.theme = theme;
|
||||
|
||||
IconButton = new IconButton(imageBuffer, theme)
|
||||
{
|
||||
HAnchor = HAnchor.Left,
|
||||
Height = theme.MicroButtonHeight,
|
||||
Width = theme.MicroButtonHeight,
|
||||
Margin = new BorderDouble(left: 10),
|
||||
Name = "Create New",
|
||||
};
|
||||
|
||||
this.AddChild(IconButton);
|
||||
}
|
||||
|
||||
public ITab LastTab { get; set; }
|
||||
|
||||
public IconButton IconButton { get; }
|
||||
|
||||
public override void OnDraw(Graphics2D graphics2D)
|
||||
{
|
||||
ChromeTab.DrawTabLowerLeft(
|
||||
graphics2D,
|
||||
this.LocalBounds,
|
||||
(parentTabControl.ActiveTab == this.LastTab) ? theme.ActiveTabColor : theme.InactiveTabColor);
|
||||
|
||||
base.OnDraw(graphics2D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
new ChromeTab("Start".Localize(), tabControl, tabControl.NewTabPage(), theme, hasClose: false)
|
||||
{
|
||||
MinimumSize = new Vector2(0, theme.TabButtonHeight),
|
||||
Name = "Initial Plus Tab",
|
||||
Name = "Start Tab",
|
||||
Padding = new BorderDouble(15, 0)
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab
|
|||
Margin = new BorderDouble(right: 5),
|
||||
Selectable = true,
|
||||
BackgroundColor = theme.MinimalShade,
|
||||
Name = "Create Part"
|
||||
Name = "Create Part Button"
|
||||
};
|
||||
emptyPlateButton.Click += async (s, e) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -200,7 +200,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
VAnchor = VAnchor.Bottom,
|
||||
MinimumSize = new Vector2(16, theme.TabButtonHeight),
|
||||
ToolTipText = "Create New".Localize()
|
||||
};
|
||||
|
||||
this.TabBar.ActionArea.AddChild(tabTrailer);
|
||||
|
|
|
|||
|
|
@ -84,15 +84,13 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
// Cancel in this case is on the Leveling Wizard, results in ReloadAll and for consistency across devices, requires we wait till it completes
|
||||
testRunner.WaitForReloadAll(() => testRunner.ClickByName("Cancel Button"));
|
||||
|
||||
// switch to controls so we can see the heights
|
||||
testRunner.SwitchToControlsTab();
|
||||
|
||||
// run the leveling wizard (only 4 next as there is no heated bed
|
||||
testRunner.ClickByName("Finish Setup Button");
|
||||
testRunner.ClickByName("Next Button");
|
||||
testRunner.ClickByName("Next Button");
|
||||
testRunner.ClickByName("Next Button");
|
||||
testRunner.ClickByName("Next Button");
|
||||
int numNextButtons = 5;
|
||||
for (int i = 0; i < numNextButtons; i++)
|
||||
{
|
||||
testRunner.ClickByName("Next Button");
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
testRunner.ClickByName("Move Z positive");
|
||||
|
|
|
|||
|
|
@ -473,6 +473,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
// Check if Guest printer names exists in dropdown
|
||||
testRunner.OpenPrintersDropdown();
|
||||
testRunner.ClickByName("Airwolf 3D HD Menu Item");
|
||||
testRunner.Delay(1000);
|
||||
testRunner.ClickByName("Open Empty Plate Button");
|
||||
|
||||
printer = ApplicationController.Instance.ActivePrinter;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ using MatterHackers.MatterControl.PartPreviewWindow;
|
|||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.MatterControl.PrinterCommunication.Io;
|
||||
using MatterHackers.MatterControl.PrinterControls.PrinterConnections;
|
||||
using MatterHackers.MatterControl.SettingsManagement;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.PrinterEmulator;
|
||||
using Newtonsoft.Json;
|
||||
|
|
@ -170,7 +171,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
public static void WaitForFirstDraw(this AutomationRunner testRunner)
|
||||
{
|
||||
SystemWindow systemWindow;
|
||||
testRunner.GetWidgetByName("PlusTabPage", out systemWindow, 10);
|
||||
testRunner.GetWidgetByName("Start Tab", out systemWindow, 10);
|
||||
// make sure we wait for MC to be up and running
|
||||
testRunner.WaitforDraw(systemWindow);
|
||||
}
|
||||
|
|
@ -219,7 +220,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
public static Emulator LaunchAndConnectToPrinterEmulator(this AutomationRunner testRunner, string make = "Airwolf 3D", string model = "HD", bool runSlow = false)
|
||||
{
|
||||
SystemWindow systemWindow;
|
||||
testRunner.GetWidgetByName("PlusTabPage", out systemWindow, 10);
|
||||
testRunner.GetWidgetByName("Start Tab", out systemWindow, 10);
|
||||
// make sure we wait for MC to be up and running
|
||||
testRunner.WaitforDraw(systemWindow);
|
||||
|
||||
|
|
@ -317,14 +318,20 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
|
||||
public static void AddAndSelectPrinter(this AutomationRunner testRunner, string make, string model)
|
||||
{
|
||||
SystemWindow systemWindow;
|
||||
testRunner.GetWidgetByName("Start Tab", out systemWindow, 10);
|
||||
// make sure we wait for MC to be up and running
|
||||
testRunner.WaitforDraw(systemWindow);
|
||||
|
||||
// If SelectMake is not visible and the ConnectionWizard is, click Skip
|
||||
if (!testRunner.NameExists("Select Make", 0.1))
|
||||
{
|
||||
// Go to the new tab screen
|
||||
if (!testRunner.NameExists("Create Printer", 0.1))
|
||||
{
|
||||
testRunner.ClickByName("Create New");
|
||||
// go to the start page
|
||||
testRunner.ClickByName("Start Tab");
|
||||
}
|
||||
|
||||
testRunner.ClickByName("Create Printer");
|
||||
}
|
||||
|
||||
|
|
@ -352,7 +359,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
|
||||
public static void OpenPrintersDropdown(this AutomationRunner testRunner)
|
||||
{
|
||||
testRunner.ClickByName("Create New");
|
||||
testRunner.ClickByName("Start Tab");
|
||||
testRunner.ClickByName("Printers... Menu");
|
||||
}
|
||||
|
||||
|
|
@ -641,6 +648,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
overrideWidth == -1 ? width : overrideWidth,
|
||||
overrideHeight == -1 ? height : overrideHeight);
|
||||
|
||||
OemSettings.Instance.ShowShopButton = false;
|
||||
|
||||
await AutomationRunner.ShowWindowAndExecuteTests(
|
||||
rootSystemWindow,
|
||||
testMethod,
|
||||
|
|
@ -777,7 +786,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
{
|
||||
testRunner.SwitchToSliceSettings();
|
||||
|
||||
if (!testRunner.NameExists("Printer Tab"))
|
||||
if (!testRunner.NameExists("Printer Tab", 0.1))
|
||||
{
|
||||
testRunner.ClickByName("Printer Overflow Menu");
|
||||
testRunner.ClickByName("Configure Printer Menu Item");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue