Exemplo n.º 1
0
        public void EditProfileFullName()
        {
            HomePage     homePage      = new HomePage(Driver);
            ProfilePage  profilePage   = new ProfilePage(Driver);
            UserHelper   jsonConverter = new UserHelper();
            User         user          = jsonConverter.GetUser();
            SignInPage   signInPage    = new SignInPage(Driver);
            RightNavMenu rightNavMenu  = new RightNavMenu(Driver);

            var fName = $"FN{DateTime.Now.ToString("yyyyMMddHHmmss")}";
            var lName = $"LN{DateTime.Now.ToString("yyyyMMddHHmmss")}";

            homePage
            .ClickAccountIcon();
            rightNavMenu
            .ClickSignInLink();
            signInPage
            .FillInEmailAddressInput(user)
            .FillInPasswordInput(user)
            .ClickSignInButton();
            profilePage
            .ClickAccountIconForSignInUser()
            .ClickAccountLink()
            .ClickProfilePasswordMenuItem()
            .EditFullNameAndSave(fName, lName)
            .ClickSaveButton();

            jsonConverter.ReplaceUserDataInJson(user, fName, lName);

            Assert.AreEqual($"{fName} {lName}", profilePage.GetFullName(), "User Name is changed");
        }
Exemplo n.º 2
0
        public void AddProductInCartUnloggedUser()
        {
            HomePage                 homePage             = new HomePage(Driver);
            RightNavMenu             rightNavMenu         = new RightNavMenu(Driver);
            ProductDetailsPage       productDetails       = new ProductDetailsPage(Driver);
            AllProductInCategoryPage allProductInCategory = new AllProductInCategoryPage(Driver);
            CartPage                 cartPage             = new CartPage(Driver);

            homePage
            .ClickMenuButton()
            .HoverFirstCategory()
            .ClickFirstSubCategory()
            .ClickInches75TVCategory();

            string profuctPrice = allProductInCategory.GetProductPrice();

            allProductInCategory
            .ClickFirstProductInGrid();
            productDetails
            .ClickAddToCartButton()
            .ClickViewCartButton();

            string cartProfuctPrice = cartPage.GetCartProductPrice();

            Assert.AreEqual(profuctPrice, cartProfuctPrice, "product add to cart and Price are equal");
        }
Exemplo n.º 3
0
        public void CreateNewAccount()
        {
            HomePage          homePage          = new HomePage(Driver);
            RightNavMenu      rightNavMenu      = new RightNavMenu(Driver);
            CreateYourAccount createYourAccount = new CreateYourAccount(Driver);
            ProfilePage       profilePage       = new ProfilePage(Driver);

            homePage
            .ClickAccountIcon();
            rightNavMenu
            .ClickCreateAccountLink();
            createYourAccount
            .FillInFirstNameField($"Test{DateTime.Now.ToString("yyyyMMddHHmmss")}")
            .FillInLastNameField($"Name{DateTime.Now.ToString("yyyyMMddHHmmss")}")
            .FillInEmailAddress($"test{DateTime.Now.ToString("yyyyMMddHHmmss")}@gmail.com")
            .FillInCreateAPassword("12345678")
            .ClickCreateAccountButton();
            profilePage
            .ClickAccountIconForSignInUser();

            Assert.AreEqual("TN", homePage.GetAcountIconValue(), "User is creadet successfuly");
        }
Exemplo n.º 4
0
        public void AddAndRemoveProductFromCart()
        {
            HomePage                 homePage             = new HomePage(Driver);
            RightNavMenu             rightNavMenu         = new RightNavMenu(Driver);
            ProductDetailsPage       productDetails       = new ProductDetailsPage(Driver);
            AllProductInCategoryPage allProductInCategory = new AllProductInCategoryPage(Driver);
            CartPage                 cartPage             = new CartPage(Driver);

            homePage
            .ClickMenuButton()
            .HoverFirstCategory()
            .ClickFirstSubCategory()
            .ClickInches75TVCategory();
            allProductInCategory
            .ClickFirstProductInGrid();
            productDetails
            .ClickAddToCartButton()
            .ClickViewCartButton();
            cartPage
            .ClickRemoveButton();

            Assert.IsTrue(cartPage.GetCartTitle().Contains("0 items in your cart"), "Title isn't null");
        }