|
@@ -14,8 +14,12 @@ using TestStack.White.UIItems.WindowStripControls;
|
|
using TestStack.White.UIItems.MenuItems;
|
|
using TestStack.White.UIItems.MenuItems;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Text.RegularExpressions;
|
|
using System.Text.RegularExpressions;
|
|
-//using WindowsInput;
|
|
|
|
-//using WindowsInput.Native;
|
|
|
|
|
|
+using WindowsInput;
|
|
|
|
+using WindowsInput.Native;
|
|
|
|
+using System.Threading.Tasks;
|
|
|
|
+using System.Linq;
|
|
|
|
+using Application = TestStack.White.Application;
|
|
|
|
+using Window = TestStack.White.UIItems.WindowItems.Window;
|
|
|
|
|
|
namespace WhiteTests
|
|
namespace WhiteTests
|
|
{
|
|
{
|
|
@@ -100,37 +104,186 @@ namespace WhiteTests
|
|
}
|
|
}
|
|
|
|
|
|
ProcessStartInfo processStart = new ProcessStartInfo(files[0], "-debug");
|
|
ProcessStartInfo processStart = new ProcessStartInfo(files[0], "-debug");
|
|
|
|
+ /*
|
|
|
|
+ string outputDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
|
|
|
+ string editedDir = outputDir.Replace("WhiteTests", "SketchAssistantWPF");
|
|
|
|
+ string app_path = editedDir + @"\SketchAssistantWPF.exe";
|
|
|
|
+ ProcessStartInfo processStart = new ProcessStartInfo(app_path, "-debug");*/
|
|
application = Application.Launch(processStart);
|
|
application = Application.Launch(processStart);
|
|
return application.GetWindow("Sketch Assistant");
|
|
return application.GetWindow("Sketch Assistant");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ [DataTestMethod]
|
|
|
|
+ [TestCategory("FileIO")]
|
|
|
|
+ [DataRow("line")]
|
|
|
|
+ public void LoadSVGFileTest(String filename)
|
|
|
|
+ {
|
|
|
|
+ Window mainWindow = setupapp();
|
|
|
|
+ InputSimulator inputSimulator = new InputSimulator();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ string[] files = Directory.GetFiles(getSketchAssistantDirectory() + @"\whitelisted", "*.svg", SearchOption.AllDirectories);
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("LoadMenuButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("SVGMenuButton")).Click();
|
|
|
|
+ Thread.Sleep(1000);
|
|
|
|
+ inputSimulator.Keyboard.TextEntry(getSketchAssistantDirectory() + @"whitelisted\" + filename + ".svg");
|
|
|
|
+ Thread.Sleep(1000);
|
|
|
|
+ inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);
|
|
|
|
+ Thread.Sleep(1000);
|
|
|
|
+ //Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("DirectInput")]
|
|
|
|
+ public void DrawLineOnCanvasTest()
|
|
|
|
+ {
|
|
|
|
+ Window mainWindow = setupapp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ InputSimulator inputSimulator = new InputSimulator();
|
|
|
|
+ MouseSimulator mouseSimulator = new MouseSimulator(inputSimulator);
|
|
|
|
+ Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(100, 100);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonDown();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(100, 100);
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonUp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("DirectInput")]
|
|
|
|
+ public void UndoLineOnCanvasTest()
|
|
|
|
+ {
|
|
|
|
+ Window mainWindow = setupapp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ InputSimulator inputSimulator = new InputSimulator();
|
|
|
|
+ MouseSimulator mouseSimulator = new MouseSimulator(inputSimulator);
|
|
|
|
+ Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(0, 200);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonDown();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(500, 300);
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonUp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
|
|
+ Thread.Sleep(100);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("DirectInput")]
|
|
|
|
+ public void InvalidLineTest()
|
|
|
|
+ {
|
|
|
|
+ Window mainWindow = setupapp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ InputSimulator inputSimulator = new InputSimulator();
|
|
|
|
+ MouseSimulator mouseSimulator = new MouseSimulator(inputSimulator);
|
|
|
|
+ Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DrawButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonDown();
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(0, 200);
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(500, 300);
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonUp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(-1000, 0);
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonDown();
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(1000, 0);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonUp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- [TestCategory("bla")]
|
|
|
|
|
|
+ [TestCategory("DirectInput")]
|
|
|
|
+ public void PointsOnCanvasSimilarityTest()
|
|
|
|
+ {
|
|
|
|
+ Window mainWindow = setupapp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ InputSimulator inputSimulator = new InputSimulator();
|
|
|
|
+ MouseSimulator mouseSimulator = new MouseSimulator(inputSimulator);
|
|
|
|
+ Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Assert.AreEqual("-", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LineSimilarityBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
|
|
+ inputSimulator.Mouse.MoveMouseBy(0, 200);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonDown();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonUp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Assert.AreEqual("-", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LineSimilarityBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonDown();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ inputSimulator.Mouse.LeftButtonUp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Assert.AreEqual("1", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LineSimilarityBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Assert.AreEqual("-", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LineSimilarityBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Assert.AreEqual("1", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LineSimilarityBox")).Text.ToString());
|
|
|
|
+ mainWindow.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
public void CreateCanvasTest()
|
|
public void CreateCanvasTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- [TestCategory("bla")]
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
public void DrawLineTest()
|
|
public void DrawLineTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
@@ -138,30 +291,31 @@ namespace WhiteTests
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
public void DeleteLineTest()
|
|
public void DeleteLineTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DrawButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DrawButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DeleteButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DeleteButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
@@ -169,118 +323,120 @@ namespace WhiteTests
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- [TestCategory("bla")]
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
public void UndoTest()
|
|
public void UndoTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- [TestCategory("bla")]
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
public void RedoTest()
|
|
public void RedoTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- public void DrawSeveralLines()
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void DrawSeveralLinesTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
Thread.Sleep(30000);
|
|
Thread.Sleep(30000);
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- public void DeleteSeveralLines()
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void DeleteSeveralLinesTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
Thread.Sleep(24000);
|
|
Thread.Sleep(24000);
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DeleteButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DeleteButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugThree")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugThree")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 1 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Thread.Sleep(10000);
|
|
Thread.Sleep(10000);
|
|
Assert.AreEqual("Last Action: Line number 0 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
@@ -288,210 +444,286 @@ namespace WhiteTests
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- public void UndoSeveralLines()
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void UndoSeveralLinesTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
Thread.Sleep(30000);
|
|
Thread.Sleep(30000);
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- public void RedoSeveralLines()
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void RedoSeveralLinesTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
Thread.Sleep(24000);
|
|
Thread.Sleep(24000);
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- public void UndoAndRedoTests()
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void UndoAndRedoTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugOne")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugTwo")).Click();
|
|
Thread.Sleep(24000);
|
|
Thread.Sleep(24000);
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("RedoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DeleteButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DeleteButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugThree")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugThree")).Click();
|
|
Thread.Sleep(7000);
|
|
Thread.Sleep(7000);
|
|
Assert.AreEqual("Last Action: Line number 0 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 1 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 1 was deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void UndoAndDrawTest()
|
|
|
|
+ {
|
|
|
|
+ Window mainWindow = setupapp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugFour")).Click();
|
|
|
|
+ Thread.Sleep(2000);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("UndoButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugFour")).Click();
|
|
|
|
+ Thread.Sleep(2000);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- public void PointDraw()
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void DeleteSeveralLinesAtOnceTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugFour")).Click();
|
|
|
|
+ Thread.Sleep(2000);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugFour")).Click();
|
|
|
|
+ Thread.Sleep(2000);
|
|
|
|
+ Assert.AreEqual("Last Action: Line number 1 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("DeleteButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugFour")).Click();
|
|
|
|
+ Thread.Sleep(2000);
|
|
|
|
+ Assert.AreEqual("Last Action: Several Lines were deleted.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Close();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void PointDrawTest()
|
|
|
|
+ {
|
|
|
|
+ Window mainWindow = setupapp();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
|
|
+ mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugFour")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugFour")).Click();
|
|
Thread.Sleep(4000);
|
|
Thread.Sleep(4000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
|
|
|
|
[TestMethod]
|
|
[TestMethod]
|
|
- public void NewCanvasAfterDraw()
|
|
|
|
|
|
+ [TestCategory("DebugInput")]
|
|
|
|
+ public void NewCanvasAfterDrawTest()
|
|
{
|
|
{
|
|
Window mainWindow = setupapp();
|
|
Window mainWindow = setupapp();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("none", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("EditMenuButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugMode")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugThree")).Click();
|
|
mainWindow.Get<Menu>(SearchCriteria.ByAutomationId("DebugThree")).Click();
|
|
Thread.Sleep(4000);
|
|
Thread.Sleep(4000);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
// Click on No button in warning
|
|
// Click on No button in warning
|
|
Window messageBox0 = mainWindow.MessageBox("Warning");
|
|
Window messageBox0 = mainWindow.MessageBox("Warning");
|
|
messageBox0.Get<Button>(SearchCriteria.ByText("No")).Click();
|
|
messageBox0.Get<Button>(SearchCriteria.ByText("No")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
// close warning
|
|
// close warning
|
|
Window messageBox1 = mainWindow.MessageBox("Warning");
|
|
Window messageBox1 = mainWindow.MessageBox("Warning");
|
|
messageBox1.Close();
|
|
messageBox1.Close();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: Line number 0 was drawn.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
mainWindow.Get<Button>(SearchCriteria.ByAutomationId("CanvasButton")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
// click yes button on warning
|
|
// click yes button on warning
|
|
Window messageBox2 = mainWindow.MessageBox("Warning");
|
|
Window messageBox2 = mainWindow.MessageBox("Warning");
|
|
messageBox2.Get<Button>(SearchCriteria.ByText("Yes")).Click();
|
|
messageBox2.Get<Button>(SearchCriteria.ByText("Yes")).Click();
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
Assert.AreEqual("Last Action: A new canvas was created.", mainWindow.Get<TextBox>(SearchCriteria.ByAutomationId("LastActionBox")).Text.ToString());
|
|
- Thread.Sleep(20);
|
|
|
|
|
|
+ Thread.Sleep(30);
|
|
mainWindow.Close();
|
|
mainWindow.Close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
[TestClass]
|
|
[TestClass]
|
|
- [DeploymentItem(@"WhiteTests\test_input_files\")]
|
|
|
|
public class FileImporterTests
|
|
public class FileImporterTests
|
|
{
|
|
{
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -556,7 +788,7 @@ namespace WhiteTests
|
|
/// <param name="xCoordinates">an array containing the x coordinates of the points that will be created (length divisible by 3)</param>
|
|
/// <param name="xCoordinates">an array containing the x coordinates of the points that will be created (length divisible by 3)</param>
|
|
/// <param name="yCoordinates">an array containing the y coordinates of the points that will be created (length divisible by 3)</param>
|
|
/// <param name="yCoordinates">an array containing the y coordinates of the points that will be created (length divisible by 3)</param>
|
|
[DataTestMethod]
|
|
[DataTestMethod]
|
|
- [TestCategory("bla")]
|
|
|
|
|
|
+ [TestCategory("FileIO")]
|
|
[DataRow(new int[] { 54, 43, 57, 11, 145, 34, 113, 299, 0 }, new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 })]
|
|
[DataRow(new int[] { 54, 43, 57, 11, 145, 34, 113, 299, 0 }, new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 })]
|
|
[DataRow(new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 }, new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 })]
|
|
[DataRow(new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 }, new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 })]
|
|
[DataRow(new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 }, new int[] { 54, 43, 57, 11, 145, 34, 113, 199, 0 })]
|
|
[DataRow(new int[] { 33, 42, 140, 30, 30, 30, 32, 145, 2 }, new int[] { 54, 43, 57, 11, 145, 34, 113, 199, 0 })]
|
|
@@ -597,7 +829,7 @@ namespace WhiteTests
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="file">the input file represented as an array of lines</param>
|
|
/// <param name="file">the input file represented as an array of lines</param>
|
|
[DataTestMethod]
|
|
[DataTestMethod]
|
|
- [TestCategory("bla")]
|
|
|
|
|
|
+ [TestCategory("FileIO")]
|
|
[DataRow(new String[] { })]
|
|
[DataRow(new String[] { })]
|
|
[DataRow(new String[] { "begindrawing", "300x300", "line", "50;50", "100;50", "endline", "enddrawing" })]
|
|
[DataRow(new String[] { "begindrawing", "300x300", "line", "50;50", "100;50", "endline", "enddrawing" })]
|
|
[DataRow(new String[] { "drawing", "300;300", "line", "50;50", "100;50", "endline", "enddrawing" })]
|
|
[DataRow(new String[] { "drawing", "300;300", "line", "50;50", "100;50", "endline", "enddrawing" })]
|
|
@@ -623,12 +855,13 @@ namespace WhiteTests
|
|
//try to initialize the left image with an invalid isad drawing
|
|
//try to initialize the left image with an invalid isad drawing
|
|
Tuple<int, int, List<InternalLine>> values1 = uut.ParseISADInputForTesting(file);
|
|
Tuple<int, int, List<InternalLine>> values1 = uut.ParseISADInputForTesting(file);
|
|
}
|
|
}
|
|
- catch (FileImporterException)
|
|
|
|
|
|
+ catch (FileImporterException e)
|
|
{
|
|
{
|
|
//save the occurence of an exception
|
|
//save the occurence of an exception
|
|
correctExceptionThrown = true;
|
|
correctExceptionThrown = true;
|
|
|
|
+ System.Diagnostics.Debug.WriteLine(e.ToString());
|
|
}
|
|
}
|
|
- catch (Exception e)
|
|
|
|
|
|
+ catch (Exception)
|
|
{
|
|
{
|
|
//don't set success flag
|
|
//don't set success flag
|
|
}
|
|
}
|
|
@@ -656,7 +889,7 @@ namespace WhiteTests
|
|
{
|
|
{
|
|
uut.ParseSVGInputFile(s, 10000, 10000);
|
|
uut.ParseSVGInputFile(s, 10000, 10000);
|
|
}
|
|
}
|
|
- catch (Exception e)
|
|
|
|
|
|
+ catch (Exception)
|
|
{
|
|
{
|
|
noExceptionThrown = false;
|
|
noExceptionThrown = false;
|
|
}
|
|
}
|
|
@@ -684,13 +917,114 @@ namespace WhiteTests
|
|
}
|
|
}
|
|
catch (FileImporterException e)
|
|
catch (FileImporterException e)
|
|
{
|
|
{
|
|
|
|
+ System.Diagnostics.Debug.WriteLine(e.ToString());
|
|
correctExceptionThrown = true;
|
|
correctExceptionThrown = true;
|
|
}
|
|
}
|
|
- catch (Exception e)
|
|
|
|
|
|
+ catch (Exception)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
Assert.IsTrue(correctExceptionThrown);
|
|
Assert.IsTrue(correctExceptionThrown);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ [TestClass]
|
|
|
|
+ public class SimilarityCalculationTests
|
|
|
|
+ {
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// The debug data element used to generate random lines.
|
|
|
|
+ /// </summary>
|
|
|
|
+ private DebugData DebugData = new DebugData();
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Generates random lines and tests how similar they are.
|
|
|
|
+ /// To test the similarity score always stays between 0 and 1.
|
|
|
|
+ /// </summary>
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("UnitTest")]
|
|
|
|
+ public void StaysWithinParameters()
|
|
|
|
+ {
|
|
|
|
+ Parallel.For(1, 100,
|
|
|
|
+ i =>
|
|
|
|
+ {
|
|
|
|
+ InternalLine l0 = DebugData.GetRandomLine(1, (uint)i);
|
|
|
|
+ InternalLine l1 = DebugData.GetRandomLine(1, (uint)i);
|
|
|
|
+ var sim = GeometryCalculator.CalculateSimilarity(l0, l1);
|
|
|
|
+ Assert.IsTrue((sim >= 0));
|
|
|
|
+ Assert.IsTrue((sim <= 1));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("UnitTest")]
|
|
|
|
+ public void CorrectSimilarity()
|
|
|
|
+ {
|
|
|
|
+ Parallel.ForEach(DebugData.GetSimilarityTestData(),
|
|
|
|
+ tup =>
|
|
|
|
+ {
|
|
|
|
+ InternalLine l0 = tup.Item1;
|
|
|
|
+ InternalLine l1 = tup.Item2;
|
|
|
|
+ var sim = GeometryCalculator.CalculateSimilarity(l0, l1);
|
|
|
|
+ Assert.AreEqual(tup.Item3, sim, 0.00000001);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [TestClass]
|
|
|
|
+ public class InternalLineUnitTests
|
|
|
|
+ {
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// The debug data element used to generate random lines.
|
|
|
|
+ /// </summary>
|
|
|
|
+ private DebugData DebugData = new DebugData();
|
|
|
|
+
|
|
|
|
+ [TestMethod]
|
|
|
|
+ [TestCategory("UnitTest")]
|
|
|
|
+ public void MakePermanentTest()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ List<Point> points = new List<Point>();
|
|
|
|
+ points.AddRange(DebugData.debugPoints4);
|
|
|
|
+ InternalLine uut = new InternalLine(points);
|
|
|
|
+ Assert.AreEqual(false, uut.isPoint);
|
|
|
|
+ uut.MakePermanent(5);
|
|
|
|
+ Assert.AreEqual(true, uut.isPoint);
|
|
|
|
+ Assert.AreEqual(5, uut.GetID());
|
|
|
|
+ Assert.AreEqual(0, uut.GetLength());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [DataTestMethod]
|
|
|
|
+ [TestCategory("UnitTest")]
|
|
|
|
+ [DataRow(new int[] { 1, 1, 3, 3 }, new int[] { 1, 1, 2, 2, 3, 3 }, false, 2.828427125)]
|
|
|
|
+ [DataRow(new int[] { 1, 1, 3, 3 }, new int[] { 1, 1, 2, 2, 3, 3 }, true, 2.828427125)]
|
|
|
|
+ [DataRow(new int[] { 1, 1, 1, 4, 3, 4 }, new int[] { 1, 1, 1, 2, 1, 3, 1, 4, 2, 4, 3, 4 }, false, 5)]
|
|
|
|
+ [DataRow(new int[] { 1, 1, 1, 4, 3, 4 }, new int[] { 1, 1, 1, 2, 1, 3, 1, 4, 2, 4, 3, 4 }, true, 5)]
|
|
|
|
+ public void PermanentLineTest(int[] inPoints, int[] outPoints, bool isTemp, double len)
|
|
|
|
+ {
|
|
|
|
+ List<Point> inLine = new List<Point>(); List<Point> outLine = new List<Point>();
|
|
|
|
+ for (int i = 0; i < inPoints.Length; i += 2) inLine.Add(new Point(inPoints[i], inPoints[i + 1]));
|
|
|
|
+ for (int i = 0; i < outPoints.Length; i += 2) outLine.Add(new Point(outPoints[i], outPoints[i + 1]));
|
|
|
|
+ InternalLine uut;
|
|
|
|
+ if (isTemp)
|
|
|
|
+ {
|
|
|
|
+ uut = new InternalLine(inLine);
|
|
|
|
+ var zip = inLine.Zip(uut.GetPoints(), (a, b) => new Tuple<Point, Point>(a, b));
|
|
|
|
+ foreach (Tuple<Point, Point> tup in zip)
|
|
|
|
+ {
|
|
|
|
+ Assert.AreEqual(tup.Item1, tup.Item2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ uut = new InternalLine(inLine, 0);
|
|
|
|
+ var zip = outLine.Zip(uut.GetPoints(), (a, b) => new Tuple<Point, Point>(a, b));
|
|
|
|
+ foreach (Tuple<Point, Point> tup in zip)
|
|
|
|
+ {
|
|
|
|
+ Assert.AreEqual(tup.Item1, tup.Item2);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Assert.AreEqual(len, uut.GetLength(), 0.000001);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|