Ejemplo n.º 1
0
        public void ForwardShouldNotBePossibleOnBrowserWithNoHistory()
        {
            BrowsersToTestWith.ForEach(manager =>
            {
                manager.CloseBrowser();

                var browser = manager.GetBrowser(AboutBlank);

                var wentForward = browser.Forward();
                Assert.That(wentForward, Is.False, "Expected no navigation back");
            });
        }
Ejemplo n.º 2
0
        public void AutoMoveMousePointerToTopLeft()
        {
            BrowsersToTestWith.ForEach(manager =>
            {
                manager.CloseBrowser();

                var notTopLeftPoint = new Point(50, 50);
                Cursor.Position     = notTopLeftPoint;
                Settings.AutoMoveMousePointerToTopLeft = false;

                using (manager.CreateBrowser(TestPageUri))
                {
                    Assert.That(Cursor.Position, Is.EqualTo(notTopLeftPoint));
                }

                Settings.AutoMoveMousePointerToTopLeft = true;
                using (manager.CreateBrowser(TestPageUri))
                {
                    Assert.That(Cursor.Position, Is.EqualTo(new Point(0, 0)));
                }
            });
        }
Ejemplo n.º 3
0
        public void AutoMoveMousePointerToTopLeft()
        {
            BrowsersToTestWith.ForEach(manager =>
            {
                // GIVEN
                manager.CloseBrowser();

                var notTopLeftPoint = new Point(50, 50);
                Cursor.Position     = notTopLeftPoint;

                // This test won't work if mousepointer isn't moved
                // Happens if system is locked or remote desktop with no UI
                if (Cursor.Position != notTopLeftPoint)
                {
                    return;
                }


                // WHEN not moving the mousepointer to top left
                // when creating a new browser instance
                Settings.AutoMoveMousePointerToTopLeft = false;
                using (manager.CreateBrowser(TestPageUri))
                {
                    // THEN cursor should still be on 50,50
                    Assert.That(Cursor.Position, Is.EqualTo(notTopLeftPoint));
                    manager.CloseBrowser();
                }

                // WHEN we set to the mousepointer to top left
                // when creating a new browser instance
                Settings.AutoMoveMousePointerToTopLeft = true;
                using (manager.CreateBrowser(TestPageUri))
                {
                    // THEN cursor should be on 0,0
                    Assert.That(Cursor.Position, Is.EqualTo(new Point(0, 0)));
                    manager.CloseBrowser();
                }
            });
        }