示例#1
0
        public void Test_AccountCartOpen()
        {
            _navPanel = new NavigationPanel(driver);
            wait.Until(d => _navPanel.IsNavigationPanelOpened());
            _navPanel.OpenMore(wait)
            .OpenLoginPage(wait)
            .LogIn(TestEmail, TestPassword, wait);

            var cartPage = _navPanel
                           .OpenCart(wait);

            var actualTitle = cartPage.GetTitle(wait);

            StringAssert.AreEqualIgnoringCase(ExpectedEmptyCartTitle, actualTitle);
        }
示例#2
0
        private bool AddLaptopsToCart()
        {
            _navPanel = new NavigationPanel(driver);
            _navPanel
            .OpenCatalogPage(wait)
            .SelectCategory(LaptopsCategoryTitle, wait);
            var lapCat       = new LaptopsCategory(driver);
            var productsList = lapCat.OpenAllLaptopsProductsList(wait);

            productsList.OpenSortPanel(wait).RbtnExpensiveCheap.Click();

            foreach (var item in _laptopsModels)
            {
                var currentProduct = productsList.GetProduct(item, wait);
                new ProductCompactView(driver, currentProduct).AddToCart(wait);
            }

            driver.PressKeyCode(AndroidKeyCode.Back);
            var cartItems = _navPanel
                            .OpenCart(wait)
                            .GetCartItems(wait);
            // _laptopsModels.Reverse();

            var matchNames = new bool[3];
            var count      = 0;

            foreach (var item in cartItems)
            {
                var currText = new CartItemView(driver, item).GetTitle(wait);
                matchNames[count] = currText.Contains(_laptopsModels[count]);
                Console.WriteLine(currText + " = " + _laptopsModels[count]);
                count++;
            }

            return(matchNames[0] && matchNames[1] && matchNames[2]);
        }