public void SetUp() { drive = new Driver(); drive.SetUpChromeDriver(); user = new User1(); accountPage = new AccountPage(); passwordEditPage = new PasswordEditPage(); startPage = new StartPage(); loginPage = new LoginPage(); drive.NavigatePage(startPage.GetPageURL()); drive.FindElementByXPath(startPage.ButtonLogin()).Click(); drive.FindElementByIdAndInputData(loginPage.InputEmail()).SendKeys(user.Email); drive.FindElementByIdAndInputData(loginPage.InputPassword()).SendKeys(user.Password); drive.FindElementByXPath(loginPage.ButtonLogin()).Click(); }
public void Login_Confirm_Test() { // Arrange user1.Password string expectedURL = new AccountPage().GetPageURL(); string actualURL; // Act drive.NavigatePage(startPage.GetPageURL()); drive.FindElementByXPath(startPage.ButtonLogin()).Click(); drive.FindElementByIdAndInputData(loginPage.InputEmail()).SendKeys(user.Email); drive.FindElementByIdAndInputData(loginPage.InputPassword()).SendKeys(user.Password); drive.FindElementByXPath(loginPage.ButtonLogin()).Click(); actualURL = drive.GetURL(); // Assert Assert.AreEqual(expectedURL, actualURL); }
public void Logout_To_HomePage_Test() { // Arrange string expected = homePage.GetPageURL(); string actual; // Act drive.NavigatePage(startPage.GetPageURL()); drive.FindElementByXPath(startPage.ButtonLogin()).Click(); drive.FindElementByIdAndInputData(loginPage.InputEmail()).SendKeys(user.Email); drive.FindElementByIdAndInputData(loginPage.InputPassword()).SendKeys(user.Password); drive.FindElementByXPath(loginPage.ButtonLogin()).Click(); drive.FindElementByXPath(accountPage.ButtonLogout()).Click(); drive.FindElementByXPath(accountLogoutPage.ButtonContinueLogout()).Click(); actual = drive.GetURL(); // Assert Assert.AreEqual(expected, actual); }