Use default WaitFor timeouts

- Issue MatterHackers/MCCentral#2427
This commit is contained in:
John Lewin 2017-12-15 20:24:58 -08:00
parent 2d4282c801
commit 70c1894c9a
6 changed files with 21 additions and 21 deletions

View file

@ -110,7 +110,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.Delay(2);
testRunner.Type("{Enter}");
testRunner.WaitFor(() => File.Exists(exportZipPath), 3);
testRunner.WaitFor(() => File.Exists(exportZipPath));
Assert.IsTrue(File.Exists(exportZipPath), "Queue was exported to zip file, file exists on disk at expected path");
// Import the exported zip file and confirm the Queue Count increases by 3
@ -120,7 +120,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.Delay(1);
testRunner.Type("{Enter}");
testRunner.WaitFor(() => QueueData.Instance.ItemCount == 8, 5);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == 8);
Assert.AreEqual(8, QueueData.Instance.ItemCount, "All parts imported successfully from exported zip");
testRunner.Delay(.3);
@ -180,7 +180,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.Delay(.2);
testRunner.ClickByName("Queue Copy Button");
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedQueueCount, 3);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedQueueCount);
Assert.AreEqual(expectedQueueCount, QueueData.Instance.ItemCount, "Copy button increases queue count by one");
Assert.IsTrue(testRunner.WaitForName("Row Item Batman - copy"), "Copied Batman item exists with expected name");

View file

@ -40,12 +40,12 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Click Copy button and count Scene.Children
testRunner.ClickByName("3D View Copy");
testRunner.WaitFor(() => scene.Children.Count == 2, 3);
testRunner.WaitFor(() => scene.Children.Count == 2);
Assert.AreEqual(2, scene.Children.Count, "Should have 2 parts after copy");
// Click Copy button a second time and count Scene.Children
testRunner.ClickByName("3D View Copy");
testRunner.WaitFor(() => scene.Children.Count > 2, 3);
testRunner.WaitFor(() => scene.Children.Count > 2);
Assert.AreEqual(3, scene.Children.Count, "Should have 3 parts after 2nd copy");
return Task.CompletedTask;
@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
for (int i = 2; i <= 6; i++)
{
testRunner.ClickByName("3D View Copy");
testRunner.WaitFor(() => scene.Children.Count == i, 3);
testRunner.WaitFor(() => scene.Children.Count == i);
Assert.AreEqual(i, scene.Children.Count, $"Should have {i} parts after copy");
}
@ -85,11 +85,11 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.Type("^a");
testRunner.ClickByName("3D View Group");
testRunner.WaitFor(() => scene.Children.Count == 1, 3);
testRunner.WaitFor(() => scene.Children.Count == 1);
Assert.AreEqual(1, scene.Children.Count, $"Should have 1 parts after group");
testRunner.ClickByName("3D View Ungroup");
testRunner.WaitFor(() => scene.Children.Count == 6, 3);
testRunner.WaitFor(() => scene.Children.Count == 6);
Assert.AreEqual(6, scene.Children.Count, $"Should have 6 parts after ungroup");
return Task.CompletedTask;

View file

@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl"));
// Wait up to 3 seconds for expected outcome
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 3);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount);
// Assert - one part added and queue count increases by one
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should increase by 1 when adding 1 item");
@ -94,7 +94,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
secondsToWait: 2);
// Wait up to 3 seconds for expected outcome
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 3);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount);
// Assert - two parts added and queue count increases by two
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should increase by 2 when adding 2 items");
@ -121,7 +121,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Remove item
testRunner.LibraryRemoveSelectedItem();
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 5, 500);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 500);
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should decrease by one after clicking Remove");
@ -148,7 +148,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Remove items
testRunner.LibraryRemoveSelectedItem();
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 5, 500);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 500);
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should decrease by two after clicking Remove");
@ -204,7 +204,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
MatterControlUtilities.GetTestItemPath("Rook.amf"));
// Wait up to 3 seconds for expected outcome
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 3);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount);
// Assert - one part added and queue count increases by one
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should increase by 1 when adding 1 item");
@ -234,7 +234,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
MatterControlUtilities.GetTestItemPath("Batman.stl"));
// Wait up to 3 seconds for expected outcome
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 3);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount);
// Assert - one part added and queue count increases by one
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should increase by 1 when adding 1 item");
@ -264,7 +264,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
MatterControlUtilities.GetTestItemPath("chichen-itza_pyramid.gcode"));
// Wait up to 3 seconds for expected outcome
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount, 3);
testRunner.WaitFor(() => QueueData.Instance.ItemCount == expectedCount);
// Assert - one part added and queue count increases by one
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should increase by 1 when adding 1 item");

View file

@ -44,11 +44,11 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.WaitForPrintFinished();
// Wait for expected temp
testRunner.WaitFor(() => ApplicationController.Instance.ActivePrinter.Connection.GetActualHotendTemperature(0) <= 0, 5);
testRunner.WaitFor(() => ApplicationController.Instance.ActivePrinter.Connection.GetActualHotendTemperature(0) <= 0);
Assert.Less(ApplicationController.Instance.ActivePrinter.Connection.GetActualHotendTemperature(0), 30);
// Wait for expected temp
testRunner.WaitFor(() => ApplicationController.Instance.ActivePrinter.Connection.ActualBedTemperature <= 10, 5);
testRunner.WaitFor(() => ApplicationController.Instance.ActivePrinter.Connection.ActualBedTemperature <= 10);
Assert.Less(ApplicationController.Instance.ActivePrinter.Connection.ActualBedTemperature, 10);
}
@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
emulator.WaitForLayer(ActiveSliceSettings.Instance.printer.Settings, 2);
testRunner.WaitFor(() => emulator.ZPosition > 5, 3);
testRunner.WaitFor(() => emulator.ZPosition > 5);
// assert the leveling is working
Assert.Greater(emulator.ZPosition, 5);