public void TestUpdateInvalidToValidToInvalid()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.Value.Wait().EqualTo("bad");

            page.Input.Click();
            page.Input.TabOut();
            page.Input.WaitError();
            page.InputValidation.Label.WaitText("incorrect value");

            page.Input.Click();
            page.Input.SendKeys(Keys.End);
            page.Input.SendKeys(Keys.Backspace);
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitText("incorrect value");

            page.Input.SendKeys("d");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitText("incorrect value");

            page.Input.TabOut();
            page.Input.WaitError();
            page.InputValidation.Label.WaitText("incorrect value");
        }
        public void TestInvalidByDefault()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.Value.Wait().EqualTo("bad");
            page.Input.WaitError();
            page.InputValidation.Label.WaitText("incorrect value");
        }
예제 #3
0
        public void TestValidByDefault()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.WaitNoError();
            page.ValidationState.WaitText("none");
            page.InputValidation.Label.WaitAbsent();
        }
예제 #4
0
        public void TestDoNotValidateUntilSubmit()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();
        }
예제 #5
0
        public void TestFocusWhenNothing()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.SubmitButton.Click();
            page.ValidationState.WaitText("valid");
            page.Input.WaitNotFocus();
        }
        public void TestValidByDefault()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.Value.Wait().EqualTo("bad");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();
        }
예제 #7
0
        public void TestValidateOnLostfocus()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");
            page.Input.WaitError();
            page.ValidationState.WaitText("none");
            page.InputValidation.Label.WaitText("incorrect value");
        }
예제 #8
0
        public void TestFocusWhenError()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");
            page.SubmitButton.Click();
            page.Input.WaitError();
            page.Input.WaitFocus();
        }
예제 #9
0
        public void TestValidOnSubmit()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("ok");
            page.SubmitButton.Click();
            page.Input.WaitNoError();
            page.ValidationState.WaitText("valid");
            page.InputValidation.Label.WaitAbsent();
        }
예제 #10
0
        public void TestResetValidationAfterEdit()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");
            page.SubmitButton.Click();

            page.Input.SetValue("bad");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();
        }
예제 #11
0
        public void TestValidateOnSubmit()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");

            page.SubmitButton.Click();
            page.Input.WaitError();
            page.ValidationState.WaitText("invalid");
            page.InputValidation.Label.WaitText("incorrect value");
        }
예제 #12
0
        public void TestValidateImmediately()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.InputValue("bad");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitText("incorrect value");

            page.Input.TabOut();
            page.Input.WaitError();
            page.InputValidation.Label.WaitText("incorrect value");
        }
예제 #13
0
        public void TestDoNotValidateUntilLostfocus()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.InputValue("bad");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();

            page.Input.TabOut();
            page.Input.WaitError();
            page.InputValidation.Label.WaitPresent();
        }
        public void TestUpdateInvalidToValid()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.Value.Wait().EqualTo("bad");

            page.Input.InputValue("ok");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitText("incorrect value");

            page.Input.TabOut();
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();
        }
예제 #15
0
        public void TestUpdateInvalidToValid()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");
            page.Input.WaitError();

            page.Input.InputValue("ok");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();

            page.Input.TabOut();
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();
        }
예제 #16
0
        public void TestUpdateInvalidToValid()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");

            page.Input.Click();
            page.Input.SendKeys(Keys.End);
            page.Input.SendKeys(Keys.Backspace);
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();

            page.Input.TabOut();
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitAbsent();
        }
예제 #17
0
        public void TestFocusWhenWarning()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.ValidationLevel.ExecuteAction(x =>
            {
                var tag = x.FindElement(By.CssSelector("button"));
                tag.Click();
                tag.SendKeys(Keys.Down);
                tag.SendKeys(Keys.Down);
                tag.SendKeys(Keys.Enter);
            }, "SetValue('warning')");
            page.Input.SetValue("bad");
            page.SubmitButton.Click();
            page.Input.WaitWarning();
            page.Input.WaitFocus();
        }
예제 #18
0
        public void TestUpdateInvalidToInvalid()
        {
            var page = new SingleInputPage(GetWebDriver()).WaitReady();

            page.Input.SetValue("bad");
            page.SubmitButton.Click();
            page.Input.WaitError();

            page.Input.Click();
            page.Input.SendKeys(Keys.End);
            page.Input.SendKeys("d");
            page.Input.WaitNoError();
            page.InputValidation.Label.WaitText("incorrect value");

            page.Input.TabOut();
            page.Input.WaitError();
            page.InputValidation.Label.WaitText("incorrect value");
        }