예제 #1
0
        public void RemoveFromCart(string nameProduck)
        {
            ShopingCartPage shopingCartPage = new ShopingCartPage();
            HomePage        homePage        = new HomePage();
            TopBar          topBar          = new TopBar();
            var             product         = homePage.FindAppropriateProduct(nameProduck);

            Thread.Sleep(500);
            product.ClickCartButton();
            Thread.Sleep(500);
            topBar.ShoppingCartButtonClick();
            shopingCartPage.GetProduct().GetProductName();
            shopingCartPage.GetProduct().ClickRemoveButton();
            shopingCartPage.GetEmptyCartMessage();
        }
예제 #2
0
        public void ClearShoppingCart()
        {
            TopBar          navBar      = new TopBar();
            ShopingCartPage shopingCart = navBar.ShoppingCartButtonClick();

            while (!shopingCart.IsEmpty())
            {
                shopingCart.GetProduct().ClickRemoveButton();
            }
        }
예제 #3
0
        public string AddProductByNameUseSearch(string nameProduck)
        {
            ShopingCartPage shopingCartPage = new ShopingCartPage();
            SearchMethods   search          = new SearchMethods();
            TopBar          topBar          = new TopBar();
            var             searchResult    = search.Search(nameProduck);

            Thread.Sleep(500);
            searchResult.AddAppropriateItemToCart(nameProduck);
            Thread.Sleep(500);
            topBar.ShoppingCartButtonClick();
            return(shopingCartPage.GetProduct().GetProductName());
        }
예제 #4
0
        public string AddProductByName(string nameProduck)
        {
            ShopingCartPage shopingCartPage = new ShopingCartPage();
            HomePage        homePage        = new HomePage();
            TopBar          topBar          = new TopBar();
            var             product         = homePage.FindAppropriateProduct(nameProduck);

            Thread.Sleep(500);
            product.ClickCartButton();
            Thread.Sleep(500);
            topBar.ShoppingCartButtonClick();
            return(shopingCartPage.GetProduct().GetProductName());
        }
예제 #5
0
        public string GetCurrencyFromShopingCart(ShopingCartPage shopingCartPage)
        {
            ShopingCartTableItem product = shopingCartPage.GetProduct();
            string productPrice          = product.GetProductPrice();
            string cleanProductPrice     = productPrice.Trim();

            if (CurrentCurrencyFromMain == "€")
            {
                return(cleanProductPrice[cleanProductPrice.Length - 1].ToString());
            }
            else
            {
                return(cleanProductPrice[0].ToString());
            }
        }
예제 #6
0
        public string AddProductByNameUseSearchWithLofinedUser(string nameProduck, string email, string password)
        {
            LoginPageMethods login = new LoginPageMethods();

            login.LogIntoAccount(email, password);
            ShopingCartPage shopingCartPage = new ShopingCartPage();
            SearchMethods   search          = new SearchMethods();
            TopBar          topBar          = new TopBar();
            var             product         = search.Search(nameProduck);

            product.AddAppropriateItemToCart(nameProduck);
            //Thread.Sleep(1000);
            topBar.ShoppingCartButtonClick();
            return(shopingCartPage.GetProduct().GetProductName());
        }