Validate Close confirm dialog works as expected

- Issue MatterHackers/MCCentral#2352
Abort dialog has no effect - MatterControl exits
This commit is contained in:
John Lewin 2017-11-30 14:48:32 -08:00
parent 7900faeb01
commit 07a9dcfc28

View file

@ -581,6 +581,17 @@ namespace MatterHackers.MatterControl.Tests.Automation
};
resetEvent.WaitOne();
// Click close but cancel
testRunner.CloseMatterControlViaUi();
testRunner.ClickByName("No Button");
// Wait for close
testRunner.WaitVanishForName("Yes Button", 4);
testRunner.Delay(2);
// Confirm abort
Assert.IsFalse(MatterControlApplication.Instance.HasBeenClosed, "Canceling Close dialog should *not* close MatterControl");
// Close MatterControl and cancel print
testRunner.CloseMatterControlViaUi();
testRunner.ClickByName("Yes Button");
@ -588,6 +599,13 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Wait for Disconnected CommunicationState which occurs after PrinterConnection.Disable()
testRunner.WaitForCommunicationStateDisconnected(maxSeconds: 30);
// Wait for close
testRunner.WaitVanishForName("Yes Button", 4);
testRunner.Delay(2);
// Confirm close
Assert.IsTrue(MatterControlApplication.Instance.HasBeenClosed, "Confirming Close dialog *should* close MatterControl");
// Wait for M106 change
testRunner.Delay(() => fanChangedCount > 0, 15, 500);