public void IsexecutedLoginAndLogout() { string messageObtained = ""; string messageObtained2 = ""; LoginClass loginClass = new LoginClass(); loginClass.FillUsername(driver, username); loginClass.FillPassword(driver, password); loginClass.Wait(driver, 3000); loginClass.SubmitCredentials(driver); Thread.Sleep(2000); messageObtained = loginClass.GetMessage(driver); Thread.Sleep(5000); loginClass.Logout(driver); loginClass.Wait(driver, 2000); messageObtained2 = loginClass.GetMessage(driver); Thread.Sleep(2000); Assert.IsTrue((messageObtained.Contains("You logged into a secure area!")) && messageObtained2.Contains("You logged out of the secure area!")); loginClass.CloseDriver(driver); }
public void IsincorrectPassword() { string incorrectPassword = password.ToLower(); string messageObtained = ""; LoginClass loginClass = new LoginClass(); loginClass.FillUsername(driver, username); loginClass.FillPassword(driver, incorrectPassword); loginClass.Wait(driver, 3000); loginClass.SubmitCredentials(driver); Thread.Sleep(2000); messageObtained = loginClass.GetMessage(driver); Assert.IsTrue((messageObtained.Contains("Your password is invalid!"))); loginClass.CloseDriver(driver); }