public void AddFirstFoodInList()
        {
            Waits.WaitUntilModalBackgroundIsNotVisible();
            //Patikriname, ar krepselyje nera prekiu
            kikaHomePage.Header.AssertCartIconNumber("0");

            //Parenkame pirma rodoma item
            kikaHomePage.ClickFirstItem();

            var itemFromListName  = item.GetItemName();
            var itemFromListPrice = item.GetItemPrice();

            //Parenkame item kieki
            item.SelectItemQuantity();
            item.AddToCart();

            //Patikriname, ar item idetas i krepseli
            Thread.Sleep(4000);
            kikaHomePage.Header.AssertCartIconNumber("1");
            kikaHomePage.Header.ClickOnCartIcon();

            cart.AssertItemNameAndItemInCartName(itemFromListName);
            cart.AssertItemPriceAndItemInCartPrice(itemFromListPrice);

            cart.RemoveItemFromCart();
            Thread.Sleep(2000);
            kikaHomePage.Header.ClickOnProfileMenuIcon();
            kikaHomePage.Header.LogOut();

            Thread.Sleep(3000);
        }
Beispiel #2
0
        public void AddFirstDogToyItem()
        {
            //Thread.Sleep(2000);
            Waits.WaitUntilModalBackgroundIsNotVisible();
            kikaHomePage.Header.AssertCartIconNumber("0");
            pageMenuSection.NavigateToDogToyList();

            // Naviguojam tiesiai per sunu zaislu url:
            //Navigation.GoToDogToysPage();

            var itemFromListName  = itemListing.GetItemNameFromItemList();
            var itemFromListPrice = itemListing.GetItemPriceFromItemList();

            itemListing.AddToCartFirstItemFromItemList();
            kikaHomePage.Header.ClickOnCartIcon();
            cart.AssertItemCountInCart("1");
            //Assert item name, price, quantity ???
            cart.AssertFirstItemNameFromListAndItemInCartName(itemFromListName);
            cart.AssertFirstItemPriceFromListAndItemInCartPrice(itemFromListPrice);
            kikaHomePage.Header.AssertCartIconNumber("1");
            cart.RemoveItemFromCart();
            cart.AssertIfCartIsEmpty("Krepšelis yra tuščias");

            // Perkraunam puslapi
            Driver.RefreshPage();
            kikaHomePage.Header.AssertCartIconNumber("0");
            kikaHomePage.Header.ClickOnProfileMenuIcon();
            kikaHomePage.Header.LogOut();

            Thread.Sleep(3000);
        }
Beispiel #3
0
        public void ClickLoginIconButton()
        {
            AllureLifecycle.Instance.WrapInStep(() =>
            {
                Waits.WaitUntilModalBackgroundIsNotVisible();
                elementLoginIconButton.Click();
            }, "Click login icon");

            // Try catch ?? Nes interceptina click'a.
            //for (int i = 0; i < 4; i++)
            //{
            //    try
            //    {
            //        elementLoginIconButton.Click();
            //        break;
            //    }
            //    catch (ElementClickInterceptedException)
            //    {
            //        continue;
            //    }

            //}
        }