public void LoginWithInvalidCredentials()
        {
            app.Auth.Logout();

            AccountName account = new AccountName("admin", "12345");

            app.Auth.Login(account);

            Assert.IsFalse(app.Auth.isLoggedIn(account));
        }
        public void LoginWithValidCredentials()
        {
            app.Auth.Logout();

            AccountName account = new AccountName("admin", "secret");

            app.Auth.Login(account);

            Assert.IsTrue(app.Auth.isLoggedIn(account));
        }
        public void Login(AccountName account)
        {
            if (isLoggedIn())
            {
                if (isLoggedIn(account))
                {
                    return;
                }

                Logout();
            }
            Type(By.Name("user"), account.Name);
            Type(By.Name("pass"), account.Password);
            driver.FindElement(By.CssSelector("input[type=\"submit\"]")).Click();
        }
 public bool isLoggedIn(AccountName account)
 {
     //return isLoggedIn() && driver.FindElement(By.Name("logout")).FindElement(By.TagName("b")).Text
     //== "(" + account.Name + ")";
     return(isLoggedIn() && GetLoggedUserName() == account.Name);
 }