Exemplo n.º 1
0
 public void BaseState()
 {
     _testApp = new ApplicationUnderTest("", "TestControlTests.exe");
     _testApp.ShowDesktop();
     _testApp.Terminate();
     _testApp.Run();
 }
Exemplo n.º 2
0
 public void BaseState()
 {
     _testApp = new ApplicationUnderTest("", "TestControlTests.exe");
     _testApp.ShowDesktop();
     _testApp.Run();
     _testApp.WaitForCaption("Demo Form", 2);
 }
Exemplo n.º 3
0
        public void BaseState()
        {
            _testApp = new ApplicationUnderTest("", "TestControlTests.exe");
            _testApp.Terminate();
            _testApp.ShowDesktop();
            _testApp.Run();

            var repo = new ControlLocatorDefRepo("app");

            repo.FindByCaption("Demo Form");

            repo = new ControlLocatorDefRepo("ok button");
            repo.FindUsing("app");
            repo.FindByAutomationId("buttonOk");

            repo = new ControlLocatorDefRepo("text box1");
            repo.FindUsing("app");
            repo.FindByAutomationId("textBox1");

            repo = new ControlLocatorDefRepo("text box2");
            repo.FindUsing("app");
            repo.FindByAutomationId("textBox2");

            repo = new ControlLocatorDefRepo("ok button using root automation id");
            repo.FindByAutomationId("Form1", true);
            repo.FindByAutomationId("buttonOk");

            repo = new ControlLocatorDefRepo("ok button using button name");
            repo.FindUsing("app");
            repo.FindByName("Ok");
        }
Exemplo n.º 4
0
        public void TestCheckAppExists()
        {
            var demoApp = new ApplicationUnderTest("", "");

            demoApp.ShowDesktop();
            try
            {
                demoApp.RunOnce();
                Assert.Fail("Test Application not there but test passing");
            }
            catch
            {
                Assert.IsTrue(true);
            }
        }
Exemplo n.º 5
0
        public void TestLaunchWinFormDemoApp()
        {
            var demoApp = new ApplicationUnderTest("", "TestControlTests.exe");

            demoApp.ShowDesktop();
            demoApp.RunOnce();
            if (demoApp.WaitForCaptionIfExists("***Demo Form-aaaaa", 2))
            {
                Assert.Fail("this should not pass");
            }

            if (demoApp.WaitForCaptionIfExists("Demo Form", 2))
            {
                Assert.IsTrue(true);
            }
            else
            {
                Assert.Fail("unable to get demoapp window caption");
            }

            demoApp.Terminate();
        }