public void openingCorrectFormatAviInWindow1() { var app = Application.Launch("KinectWin7.exe"); var window = app.GetWindow("Kinect Skeleton Analyst", InitializeOption.NoCache); var label = window.Get <Label>("labelKosciec1"); Assert.IsTrue(label.Text == ""); var uploadAvi1Button = window.Get <Button>("uploadAvi1_Button"); uploadAvi1Button.Click(); string tests_dir = Directory.GetCurrentDirectory(); var openModalWindow = window.ModalWindow("Open", InitializeOption.NoCache); window.WaitWhileBusy(); Assert.IsNotNull(openModalWindow); var filePath = Path.Combine(tests_dir, "..", "..", "..", "..", "clipKosciec.avi"); var filenameTextBox = openModalWindow.Get <TextBox>(SearchCriteria.ByAutomationId("1148")); filenameTextBox.SetValue(filePath); openModalWindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); Assert.IsTrue(label.Text == "Nacisnij start"); Assert.IsTrue(window.Get <Button>("startKosciec1").Enabled); Assert.IsTrue(window.Get <Button>("pauseKosciec1").Enabled); Assert.IsTrue(window.Get <Button>("stopKosciec1").Enabled); Assert.IsFalse(window.Get <Button>("startKosciec2").Enabled); Assert.IsFalse(window.Get <Button>("pauseKosciec2").Enabled); Assert.IsFalse(window.Get <Button>("stopKosciec2").Enabled); Assert.IsFalse(window.Get <Button>("startMovieAll").Enabled); Assert.IsFalse(window.Get <Button>("pauseAll").Enabled); Assert.IsFalse(window.Get <Button>("stopAll").Enabled); app.Close(); }
public void LeftHelloDetected() { //Arrange Application application = Application.Launch(@"..\..\..\HelloKinectWPF\bin\Debug\HelloKinectWPF.exe"); Window window = application.GetWindow("MainWindow", InitializeOption.NoCache); window.WaitWhileBusy(); //Act var fileStream = new FileStream(RecordingPath, FileMode.Open); Kinect.ReplayStart(fileStream); Thread.Sleep(8000); //Assert var label = window.Get <TestStack.White.UIItems.Label>(SearchCriteria.ByAutomationId("Label")); Assert.That(label.Text == "Hello Kinect"); fileStream.Close(); application.Close(); }
public void openAndRunBothKosciecSimultaneously() { var app = Application.Launch("KinectWin7.exe"); var window = app.GetWindow("Kinect Skeleton Analyst", InitializeOption.NoCache); var label1 = window.Get <Label>("labelKosciec1"); var label2 = window.Get <Label>("labelKosciec2"); Assert.IsTrue(label1.Text == ""); Assert.IsTrue(label2.Text == ""); var uploadButton1 = window.Get <Button>("uploadSkeleton1_Button"); uploadButton1.Click(); string tests_dir = Directory.GetCurrentDirectory(); var openModalWindow = window.ModalWindow("Open", InitializeOption.NoCache); window.WaitWhileBusy(); Assert.IsNotNull(openModalWindow); var filePath = Path.Combine(tests_dir, "..", "..", "..", "..", "Kosciec.kosciec"); var filenameTextBox = openModalWindow.Get <TextBox>(SearchCriteria.ByAutomationId("1148")); filenameTextBox.SetValue(filePath); openModalWindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); var uploadButton2 = window.Get <Button>("uploadSkeleton2_Button"); uploadButton2.Click(); tests_dir = Directory.GetCurrentDirectory(); openModalWindow = window.ModalWindow("Open", InitializeOption.NoCache); window.WaitWhileBusy(); Assert.IsNotNull(openModalWindow); filePath = Path.Combine(tests_dir, "..", "..", "..", "..", "Kosciec.kosciec"); filenameTextBox = openModalWindow.Get <TextBox>(SearchCriteria.ByAutomationId("1148")); filenameTextBox.SetValue(filePath); openModalWindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); var startButton = window.Get <Button>("startMovieAll"); var pauseButton = window.Get <Button>("pauseAll"); var stopAllButton = window.Get <Button>("stopAll"); Assert.AreNotEqual(label1.Text, ""); Assert.AreNotEqual(label2.Text, ""); startButton.Click(); System.Threading.Thread.Sleep(2000); Assert.AreNotEqual(label1.Text, "Nacisnij start"); Assert.AreNotEqual(label2.Text, "Nacisnij start"); var time1_1 = label1.Text; var time1_2 = label2.Text; System.Threading.Thread.Sleep(1000); Assert.AreNotEqual(label1.Text, time1_1); Assert.AreNotEqual(label2.Text, time1_2); pauseButton.Click(); System.Threading.Thread.Sleep(1000); var time2_1 = label1.Text; var time2_2 = label2.Text; System.Threading.Thread.Sleep(1000); Assert.AreEqual(label1.Text, time2_1); Assert.AreEqual(label2.Text, time2_2); startButton.Click(); System.Threading.Thread.Sleep(500); var time3_1 = label1.Text; var time3_2 = label2.Text; System.Threading.Thread.Sleep(1000); Assert.AreNotEqual(label1.Text, time3_1); Assert.AreNotEqual(label2.Text, time3_2); stopAllButton.Click(); System.Threading.Thread.Sleep(1000); var time4_1 = label1.Text; var time4_2 = label2.Text; System.Threading.Thread.Sleep(1000); Assert.AreEqual(label1.Text, time4_1); Assert.AreEqual(label2.Text, time4_2); app.Close(); }
public void openAndRunAvi2() { var app = Application.Launch("KinectWin7.exe"); var window = app.GetWindow("Kinect Skeleton Analyst", InitializeOption.NoCache); var label = window.Get <Label>("labelKosciec2"); Assert.IsTrue(label.Text == ""); var uploadButton = window.Get <Button>("uploadAvi2_Button"); uploadButton.Click(); string tests_dir = Directory.GetCurrentDirectory(); var openModalWindow = window.ModalWindow("Open", InitializeOption.NoCache); window.WaitWhileBusy(); Assert.IsNotNull(openModalWindow); var filePath = Path.Combine(tests_dir, "..", "..", "..", "..", "clipKosciec.avi"); var filenameTextBox = openModalWindow.Get <TextBox>(SearchCriteria.ByAutomationId("1148")); filenameTextBox.SetValue(filePath); openModalWindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); var startButton = window.Get <Button>("startKosciec2"); var pauseButton = window.Get <Button>("pauseKosciec2"); var stop = window.Get <Button>("stopKosciec2"); Assert.AreEqual(label.Text, "Nacisnij start"); startButton.Click(); System.Threading.Thread.Sleep(2000); Assert.AreNotEqual(label.Text, "Nacisnij start"); var time1 = label.Text; System.Threading.Thread.Sleep(2000); Assert.AreNotEqual(label.Text, time1); pauseButton.Click(); System.Threading.Thread.Sleep(1000); var time2 = label.Text; System.Threading.Thread.Sleep(1000); Assert.AreEqual(label.Text, time2); startButton.Click(); System.Threading.Thread.Sleep(1000); var time3 = label.Text; System.Threading.Thread.Sleep(1000); Assert.AreNotEqual(label.Text, time3); stop.Click(); System.Threading.Thread.Sleep(1000); var time4 = label.Text; System.Threading.Thread.Sleep(1000); Assert.AreEqual(label.Text, time4); app.Close(); }
public void openingBothCorrectKosciecFiles() { var app = Application.Launch("KinectWin10.exe"); var window = app.GetWindow("Kinect Skeleton Analyst", InitializeOption.NoCache); var label1 = window.Get <Label>("labelKosciec1"); var label2 = window.Get <Label>("labelKosciec2"); Assert.IsTrue(label1.Text == ""); Assert.IsTrue(label2.Text == ""); var uploadButton1 = window.Get <Button>("uploadSkeleton1_Button"); var uploadButton2 = window.Get <Button>("uploadSkeleton2_Button"); uploadButton1.Click(); string tests_dir = Directory.GetCurrentDirectory(); var openModalWindow = window.ModalWindow("Open", InitializeOption.NoCache); window.WaitWhileBusy(); Assert.IsNotNull(openModalWindow); var filePath = Path.Combine(tests_dir, "..", "..", "..", "..", "Kosciec.kosciec"); var filenameTextBox = openModalWindow.Get <TextBox>(SearchCriteria.ByAutomationId("1148")); filenameTextBox.SetValue(filePath); openModalWindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); uploadButton2.Click(); openModalWindow = window.ModalWindow("Open", InitializeOption.NoCache); window.WaitWhileBusy(); Assert.IsNotNull(openModalWindow); filePath = Path.Combine(tests_dir, "..", "..", "..", "..", "Kosciec.kosciec"); filenameTextBox = openModalWindow.Get <TextBox>(SearchCriteria.ByAutomationId("1148")); filenameTextBox.SetValue(filePath); openModalWindow.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); Assert.AreNotEqual(label1.Text, ""); Assert.AreNotEqual(label2.Text, ""); Assert.IsTrue(window.Get <Button>("startKosciec1").Enabled); Assert.IsTrue(window.Get <Button>("pauseKosciec1").Enabled); Assert.IsTrue(window.Get <Button>("stopKosciec1").Enabled); Assert.IsTrue(window.Get <Button>("startKosciec2").Enabled); Assert.IsTrue(window.Get <Button>("pauseKosciec2").Enabled); Assert.IsTrue(window.Get <Button>("stopKosciec2").Enabled); Assert.IsTrue(window.Get <Button>("startMovieAll").Enabled); Assert.IsTrue(window.Get <Button>("pauseAll").Enabled); Assert.IsTrue(window.Get <Button>("stopAll").Enabled); app.Close(); }