Working on the unit test for the library select check boxes.

This commit is contained in:
Lars Brubaker 2015-08-24 14:15:01 -07:00
parent 7105dd07e6
commit d545db7690
3 changed files with 16 additions and 7 deletions

View file

@ -170,6 +170,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
selectionCheckBoxContainer.Visible = false;
selectionCheckBoxContainer.Margin = new BorderDouble(left: 6);
selectionCheckBox = new CheckBox("");
selectionCheckBox.Name = "Row Item Select Checkbox";
selectionCheckBox.VAnchor = VAnchor.ParentCenter;
selectionCheckBox.HAnchor = HAnchor.ParentCenter;
selectionCheckBoxContainer.AddChild(selectionCheckBox);

@ -1 +1 @@
Subproject commit a4af30c10089a08aac246632f311ca88366b1152
Subproject commit c3f7b01fbb7c1e4209ad1715141299668cd6a815

View file

@ -58,13 +58,21 @@ namespace MatterHackers.MatterControl.UI
SystemWindow systemWindow;
GuiWidget rowItem = testRunner.GetWidgetByName("Local Library Row Item Collection", out systemWindow);
testRunner.Wait(.5);
testRunner.ClickByName("Open Collection");
SearchRegion rowItemRegion = testRunner.GetRegionByName("Local Library Row Item Collection");
testRunner.ClickByName("Library Edit Button");
testRunner.Wait(.5);
//SystemWindow containingWindow;
//GuiWidget textInputWidget = testRunner.GetWidgetByName("Create Folder - Text Input", out containingWindow);
testRunner.Wait(5);
SystemWindow containingWindow;
GuiWidget foundWidget = testRunner.GetWidgetByName("Row Item Select Checkbox", out containingWindow, searchRegion: rowItemRegion);
CheckBox checkBoxWidget = foundWidget as CheckBox;
resultsHarness.AddTestResult(checkBoxWidget != null, "We should have an actual checkbox");
resultsHarness.AddTestResult(checkBoxWidget.Checked == false, "currently not checked");
testRunner.ClickByName("Row Item Select Checkbox", searchRegion: rowItemRegion);
testRunner.Wait(.5);
resultsHarness.AddTestResult(checkBoxWidget.Checked == true, "currently checked");
UITests.CloseMatterControl(testRunner);
}
@ -77,10 +85,10 @@ namespace MatterHackers.MatterControl.UI
#endif
bool showWindow;
MatterControlApplication matterControlWindow = MatterControlApplication.CreateInstance(out showWindow);
AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 10);
AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 1000);
Assert.IsTrue(testHarness.AllTestsPassed);
Assert.IsTrue(testHarness.TestCount == 0); // make sure we ran all our tests
Assert.IsTrue(testHarness.TestCount == 3); // make sure we ran all our tests
}
}
}