コード例 #1
0
        public void TabFunctionality()
        {
            LoginPage    loginPage    = new LoginPage(this.driver, this.wait);
            MessagesPage messagesPage = new MessagesPage(this.driver, this.wait);

            this.driver.Navigate().GoToUrl(this.baseUrl + "/dialysis/login");

            this.driver.SwitchTo().ActiveElement().SendKeys(Keys.Tab);
            System.Threading.Thread.Sleep(1000);
            this.driver.SwitchTo().ActiveElement().SendKeys(Keys.Tab);
            System.Threading.Thread.Sleep(1000);
            this.driver.SwitchTo().ActiveElement().SendKeys(Keys.Enter);
            System.Threading.Thread.Sleep(1000);

            var emailMsg = messagesPage.GetEmailValidationMsg().Text;
            var passMsg  = messagesPage.GetPasswordValidationMsg().Text;


            Assert.Multiple(() =>
            {
                Assert.AreEqual("Email is required.", emailMsg, "[ERROR] Email error message is not displayed!");

                Assert.AreEqual("Password is required.", passMsg, "[ERROR] Password error message is not displayed!");
            });
        }
コード例 #2
0
        public void EmptyFiledsLogin()
        {
            LoginPage    loginPage    = new LoginPage(this.driver, this.wait);
            MessagesPage messagesPage = new MessagesPage(this.driver, this.wait);

            this.driver.Navigate().GoToUrl(this.baseUrl + "/dialysis/login");

            loginPage.GetLoginBtn()?.Click();

            var emailMsg = messagesPage.GetEmailValidationMsg().Text;
            var passMsg  = messagesPage.GetPasswordValidationMsg().Text;


            Assert.Multiple(() =>
            {
                Assert.AreEqual("Email is required.", emailMsg, "[ERROR] Email error message is not displayed!");

                Assert.AreEqual("Password is required.", passMsg, "[ERROR] Password error message is not displayed!");
            });
        }