public void UserRegistration() { // Register a user var loginPage = new PageObjects.LoginPage(_driver); var registrationPage = loginPage.ClickOnRegister(); registrationPage.Register(); Assert.IsTrue(loginPage.RegistrationSuccessCheck()); Console.WriteLine("Registration Success"); //Login after registration var dashboardPage = loginPage.ClickOnLogin(); // Assertion check after login Assert.IsTrue(dashboardPage.DashboardFirstNameCheck()); Console.WriteLine("FirstName Matched"); Assert.IsTrue(dashboardPage.DashboardFullNameCheck()); Console.WriteLine("Found user under registered users list"); }
public void GivenUserIsLoggedIn() { string loginUrl = ConfigurationManager.AppSettings["loginURL"].ToString(); string id = ConfigurationManager.AppSettings["UserID"].ToString(); string pw = ConfigurationManager.AppSettings["Password"].ToString(); if (!Browser.Initialised) { Browser.Initialize(); } Browser.Driver.Navigate().GoToUrl(loginUrl); var loginPage = new PageObjects.LoginPage(); loginPage.eMailAddress.SendKeys(id); loginPage.Password.SendKeys(pw); loginPage.LoginButton.Click(); }