Wrote a test for clicking on the queue check box button

This commit is contained in:
Lars Brubaker 2016-12-21 17:02:25 -08:00
parent e7bdbefe7f
commit 9dd64e2ce1
3 changed files with 45 additions and 3 deletions

View file

@ -461,6 +461,49 @@ namespace MatterHackers.MatterControl.Tests.Automation
await MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items);
}
[Test, Apartment(ApartmentState.STA)]
public async Task QueueSelectCheckBoxWorks()
{
AutomationTest testToRun = (testRunner) =>
{
testRunner.CloseSignInAndPrinterSelect();
/*
*Tests that when one item is selected
*1. Queue Item count equals three before the test starts
*2. Selecting multiple queue items and then clicking the Remove button removes the item
*3. Selecting multiple queue items and then clicking the Remove button decreases the queue tab count by one
*/
int queueItemCount = QueueData.Instance.ItemCount;
bool queueItemExists = testRunner.WaitForName("Queue Item Batman", 2);
bool secondQueueItemExists = testRunner.WaitForName("Queue Item 2013-01-25_Mouthpiece_v2", 2);
SystemWindow systemWindow;
GuiWidget rowItem = testRunner.GetWidgetByName("Queue Item Batman", out systemWindow, 3);
SearchRegion rowItemRegion = testRunner.GetRegionByName("Queue Item Batman", 3);
testRunner.ClickByName("Queue Edit Button", 3);
GuiWidget foundWidget = testRunner.GetWidgetByName("Queue Item Checkbox", out systemWindow, 3, searchRegion: rowItemRegion);
CheckBox checkBoxWidget = foundWidget as CheckBox;
Assert.IsTrue(checkBoxWidget != null, "We should have an actual checkbox");
Assert.IsTrue(checkBoxWidget.Checked == false, "currently not checked");
testRunner.ClickByName("Queue Item Batman", 3);
Assert.IsTrue(checkBoxWidget.Checked == true, "currently checked");
testRunner.ClickByName("Queue Item Checkbox", 3, searchRegion: rowItemRegion);
Assert.IsTrue(checkBoxWidget.Checked == false, "currently not checked");
return Task.FromResult(0);
};
await MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items);
}
/// <summary>
/// Confirms the Export to Zip feature compresses and exports to a zip file and that file imports without issue
/// </summary>