Ejemplo n.º 1
0
        public void ToolTipsShow()
        {
            SystemWindow buttonContainer = new SystemWindow(300, 200)
            {
                BackgroundColor = RGBA_Bytes.White,
            };

            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner("C:/TestImages");
                testRunner.Wait(1);

                // Now do the actions specific to this test. (replace this for new tests)
                {
                    testRunner.MoveToByName("ButtonWithToolTip");
                    testRunner.Wait(1.5);
                    GuiWidget toolTipWidget = buttonContainer.FindNamedChildRecursive("ToolTipWidget");
                    resultsHarness.AddTestResult(toolTipWidget != null, "Tool tip is showing");
                    testRunner.MoveToByName("right");
                    toolTipWidget = buttonContainer.FindNamedChildRecursive("ToolTipWidget");
                    resultsHarness.AddTestResult(toolTipWidget == null, "Tool tip is not showing");
                }

                testRunner.Wait(1);
                buttonContainer.CloseOnIdle();
            };

            Button leftButton = new Button("left", 10, 40);

            leftButton.Name        = "ButtonWithToolTip";
            leftButton.ToolTipText = "Left Tool Tip";
            buttonContainer.AddChild(leftButton);
            Button rightButton = new Button("right", 110, 40);

            rightButton.Name = "right";
            buttonContainer.AddChild(rightButton);

            AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(buttonContainer, testToRun, 10000);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 2);             // make sure we can all our tests
        }
Ejemplo n.º 2
0
        public async Task ToolTipsShow()
        {
            SystemWindow buttonContainer = new SystemWindow(300, 200)
            {
                BackgroundColor = RGBA_Bytes.White,
            };

            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.Delay(1);

                testRunner.MoveToByName("ButtonWithToolTip");
                testRunner.Delay(1.5);
                GuiWidget toolTipWidget = buttonContainer.FindNamedChildRecursive("ToolTipWidget");
                Assert.IsTrue(toolTipWidget != null, "Tool tip is showing");
                testRunner.MoveToByName("right");
                toolTipWidget = buttonContainer.FindNamedChildRecursive("ToolTipWidget");
                Assert.IsTrue(toolTipWidget == null, "Tool tip is not showing");

                testRunner.Delay(1);
                buttonContainer.CloseOnIdle();

                return(Task.FromResult(0));
            };

            Button leftButton = new Button("left", 10, 40);

            leftButton.Name        = "ButtonWithToolTip";
            leftButton.ToolTipText = "Left Tool Tip";
            buttonContainer.AddChild(leftButton);
            Button rightButton = new Button("right", 110, 40);

            rightButton.Name = "right";
            buttonContainer.AddChild(rightButton);

            await AutomationRunner.ShowWindowAndExecuteTests(buttonContainer, testToRun, 10000);
        }
Ejemplo n.º 3
0
		public void ToolTipsShow()
		{
			SystemWindow buttonContainer = new SystemWindow(300, 200)
			{
				BackgroundColor = RGBA_Bytes.White,
			};

			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner("C:/TestImages");
				testRunner.Wait(1);

				// Now do the actions specific to this test. (replace this for new tests)
				{
					testRunner.MoveToByName("ButtonWithToolTip");
					testRunner.Wait(1.5);
					GuiWidget toolTipWidget = buttonContainer.FindNamedChildRecursive("ToolTipWidget");
					resultsHarness.AddTestResult(toolTipWidget != null, "Tool tip is showing");
					testRunner.MoveToByName("right");
					toolTipWidget = buttonContainer.FindNamedChildRecursive("ToolTipWidget");
					resultsHarness.AddTestResult(toolTipWidget == null, "Tool tip is not showing");
				}

				testRunner.Wait(1);
				buttonContainer.CloseOnIdle();
			};

			Button leftButton = new Button("left", 10, 40);
			leftButton.Name = "ButtonWithToolTip";
			leftButton.ToolTipText = "Left Tool Tip";
			buttonContainer.AddChild(leftButton);
			Button rightButton = new Button("right", 110, 40);
			rightButton.Name = "right";
			buttonContainer.AddChild(rightButton);

			AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(buttonContainer, testToRun, 10);

			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 2); // make sure we can all our tests
		}