Ejemplo n.º 1
0
        public void Should_BePossibleTo_CreateDifferentBrowsersInDifferentThreads()
        {
            var thread01 = new Thread(() =>
            {
                var checkBoxesForm = new CheckBoxesForm();
                checkBoxesForm.Open();
                Assert.AreEqual(checkBoxesForm.Url, AqualityServices.Browser.CurrentUrl);
                AqualityServices.Browser.Quit();
            });
            var thread02 = new Thread(() =>
            {
                var authForm = new AuthenticationForm();
                authForm.Open();
                Assert.AreEqual(authForm.Url, AqualityServices.Browser.CurrentUrl);
                AqualityServices.Browser.Quit();
            });

            thread01.Start();
            thread02.Start();

            thread01.Join();
            thread02.Join();

            thread01.Interrupt();
            thread02.Interrupt();
        }
        public void Should_BePossibleTo_GetStateViaJsActions()
        {
            var checkboxesForm = new CheckBoxesForm();
            var checkBox1      = checkBoxesForm.FirstCheckBox;

            checkBox1.Check();
            var checkBox2 = checkBoxesForm.SecondCheckBox;

            checkBox2.Uncheck();

            Assert.Multiple(() =>
            {
                Assert.IsTrue(checkBox1.JsActions.IsChecked());
                Assert.IsFalse(checkBox2.JsActions.IsChecked());
            });
        }
Ejemplo n.º 3
0
        public void Should_BePossibleTo_NavigateBackAndForward()
        {
            var firstNavigationUrl  = new WelcomeForm().Url;
            var secondNavigationUrl = new CheckBoxesForm().Url;

            var browser = AqualityServices.Browser;

            browser.GoTo(firstNavigationUrl);
            Assert.AreEqual(browser.CurrentUrl, firstNavigationUrl);

            browser.GoTo(secondNavigationUrl);
            Assert.AreEqual(browser.CurrentUrl, secondNavigationUrl);

            browser.GoBack();
            Assert.AreEqual(browser.CurrentUrl, firstNavigationUrl);

            browser.GoForward();
            Assert.AreEqual(browser.CurrentUrl, secondNavigationUrl);
        }