Add failing PrinterDisconnectedOnTabClose test
This commit is contained in:
parent
8ba2299a76
commit
86660c032f
2 changed files with 45 additions and 0 deletions
|
|
@ -59,6 +59,7 @@
|
|||
<Compile Include="OptionsTabTests.cs" />
|
||||
<Compile Include="PartPreviewTests.cs" />
|
||||
<Compile Include="PrinterDropDownTests.cs" />
|
||||
<Compile Include="PrinterConnectionTests.cs" />
|
||||
<Compile Include="PrintQueueTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="PrintingTests.cs" />
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.GuiAutomation;
|
||||
using MatterHackers.MatterControl.PrinterCommunication;
|
||||
using MatterHackers.MatterControl.PrinterCommunication.Io;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.PrinterEmulator;
|
||||
using MatterHackers.VectorMath;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MatterHackers.MatterControl.Tests.Automation
|
||||
{
|
||||
[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Apartment(ApartmentState.STA)]
|
||||
public class PrinterConnectionTests
|
||||
{
|
||||
[Test]
|
||||
public async Task PrinterDisconnectedOnTabClose()
|
||||
{
|
||||
await MatterControlUtilities.RunTest((testRunner) =>
|
||||
{
|
||||
// Create and connect to Airwolf via emulator port
|
||||
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
|
||||
{
|
||||
var printer = testRunner.FirstPrinter();
|
||||
|
||||
// Ensure connected
|
||||
Assert.AreEqual(CommunicationStates.Connected, printer.Connection.CommunicationState, "Printer should be Connected after LaunchAndConnectToPrinterEmulator");
|
||||
|
||||
// Close Printer
|
||||
testRunner.CloseFirstPrinterTab();
|
||||
|
||||
// Ensure disconnected
|
||||
testRunner.WaitFor(() => printer.Connection.CommunicationState == PrinterCommunication.CommunicationStates.Disconnected);
|
||||
Assert.AreEqual(CommunicationStates.Disconnected, printer.Connection.CommunicationState, "Printer should be Disconnected after closing printer tab");
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}, maxTimeToRun: 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue