public void WhenIAddAProductToTheCart() { HomePage homePage = new HomePage(Driver); ProductPage productPage = new ProductPage(Driver); homePage.VeziDetaliiProdus(); productPage.AdaugaInCos(); }
//b. Adaugati in cos un produs ca si utilizator. -- fara sa fiu logat public void VerifyAddToCartAsGuest() { HomePage homePage = new HomePage(Driver); LoginPage loginPage = new LoginPage(Driver); ProductPage productPage = new ProductPage(Driver); //Arrange NavigateToUrl(SiteUrl); //Act homePage.VeziDetaliiProdus(); productPage.AdaugaInCos(); //Assert loginPage.VerifyElementContainsText(loginPage.AlertMessage, "Pentru a efectua aceasta actiune, va rugam sa va autentificati"); }
//c. Adaugati in cos un produs ca si admin. public void VerifyAddToCartAsAdmin() { CartPage cartPage = new CartPage(Driver); HomePage homePage = new HomePage(Driver); LoginPage loginPage = new LoginPage(Driver); ProductPage productPage = new ProductPage(Driver); //Arrange NavigateToUrl(SiteUrl); homePage.GoToAuthentication(); loginPage.AuthenticateUser(AdminUser, AdminPassword); //Act homePage.VeziDetaliiProdus(); productPage.AdaugaInCos(); //Assert loginPage.VerifyElementIsDisplayed(cartPage.ComandaAcumButton); }