public void ExecuteTest() { //login to application by creating an instance of Authentication class Authentication authentication = new Authentication(); AccountPage accountPage = authentication.SignIn("*****@*****.**", "@nuK1978"); SearchResultsPage searchResults = accountPage.EnterSearchText("printed summer dress"); Console.WriteLine("Executed Login page and did a search query in the next POM"); searchResults.AddToCart(); Console.WriteLine("Hover on search result and added item to cart"); }
public void IncorrectUserIdOrPassword() { //login to application by creating an instance of Authentication class Authentication authentication = new Authentication(); AccountPage accountPage = authentication.SignIn("*****@*****.**", "qwertop8"); //AccountPage accountPage = authentication.SignIn("*****@*****.**", "@nuK1978"); IWebElement loginMessage = PropertiesCollection.driver.FindElement(By.XPath("//*[@id=\"center_column\"]/div[1]/ol/li")); Console.WriteLine(loginMessage.Text); Boolean loginError = loginMessage.Text.Contains("Authentication failed"); Console.WriteLine(loginError); Assert.IsTrue(loginError); }