Пример #1
0
        public void LoginWithNotValidData()
        {
            app.Logon.Logout();

            DataAccount notValidData = new DataAccount("admin", "123");

            app.Logon.Login(notValidData);
            Assert.IsFalse(app.Logon.IsLoggedIn());
        }
Пример #2
0
        public void LoginWithValidData()
        {
            app.Logon.Logout();

            DataAccount validData = new DataAccount("admin", "secret");

            app.Logon.Login(validData);
            Assert.IsTrue(app.Logon.IsLoggedIn(validData));
        }
Пример #3
0
        public void Login(DataAccount account)
        {
            if (IsLoggedIn())
            {
                if (IsLoggedIn(account))
                {
                    return;
                }

                Logout();
            }
            Type(By.Name("user"), account.Login);
            Type(By.Name("pass"), account.Pass);
            driver.FindElement(By.CssSelector("input[type=\"submit\"]")).Click();
        }
Пример #4
0
 public bool IsLoggedIn(DataAccount account)
 {
     return(IsLoggedIn() &&
            GetLoggetUserName() == account.Login);
 }