Exemple #1
0
        public void WhenIAddAProductToTheCart()
        {
            HomePage    homePage    = new HomePage(Driver);
            ProductPage productPage = new ProductPage(Driver);

            homePage.VeziDetaliiProdus();
            productPage.AdaugaInCos();
        }
Exemple #2
0
        //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");
        }
Exemple #3
0
        //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);
        }