Ejemplo n.º 1
0
        public void ClickDialogBox_AlertDialogBoxIsActive_ClickIt()
        {
            var html = XenonTestsResourceLookup.GetContent("ScrollToElement");

            using (var bt = new BrowserTest(html))
            {
                var browser = bt.Start();
                CreateInstance(browser)
                .GoToUrl("/")
                .Click(where => where.TextIs("Click"));

                Assert.AreEqual("worked", bt.GetPostResult()["temp"]);
            }
        }
Ejemplo n.º 2
0
        public void MoveToElement_WhenMovingToElement_MovesToElement()
        {
            var html = XenonTestsResourceLookup.GetContent("MoveToElement");

            using (var browserTest = new BrowserTest(html))
            {
                var browser = browserTest.Start();

                CreateInstance(browser)
                .GoToUrl("/")
                .MoveToElement("#element");

                Assert.AreEqual("worked", browserTest.GetPostResult()["temp"]);
            }
        }
Ejemplo n.º 3
0
        public void SelectList_WhenDelayBeforeResultsAreDisplayed_SelectsValue()
        {
            using (
                var browserTest =
                    new BrowserTest(GetEmbeddedResource("Xenon.Tests.SelectListTests.SelectListTests.html")))
            {
                var browser = browserTest.Start();

                CreateInstance(browser)
                .GoToUrl("/")
                .SelectList("[name='delayed-select-list']", "Third")
                .Click(where => where.TextIs("Submit"));

                var postResult = browserTest.GetPostResult();

                Assert.AreEqual("3", postResult["delayed-select-list"]);
            }
        }
Ejemplo n.º 4
0
        public void EnterDateIntoDatePicker_DoesSetValue(BrowserType browserType)
        {
            using (var browserTest = new BrowserTest(GetHtml()))
            {
                var theFifthOfNovember = new DateTime(1605, 11, 5);

                CreateInstance(browserTest.Start(browserType))
                .GoToUrl("/")
                .EnterDate("input[name=\"date\"]", theFifthOfNovember)
                .Click(x => x.TextIs("Submit"));

                Assert.AreEqual(theFifthOfNovember, GetPostedDateValue());

                DateTime GetPostedDateValue()
                {
                    var postResult = browserTest.GetPostResult();

                    return(DateTime.Parse(postResult["date"]));
                }
            }
        }