Пример #1
0
        public void CheckProductAttributesAfterColorChange()
        {
            Logger.Log.Info("CheckProductAttributesAfterColorChange");
            Product startProduct = ProductCreator.withManyColors_Black();

            expectedProduct = ProductCreator.withManyColors_ArchiveBeige();
            ProductPage productPageCheckProductAttributesAfterColorChange = new ProductPage(driver);

            try
            {
                BasketPage basketCheckProductAttributesAfterColorChange =
                    productPageCheckProductAttributesAfterColorChange
                    .OpenPage(startProduct.URL)
                    .AcceptCookies()
                    .ChooseColor(expectedProduct.color, expectedProduct.name)
                    .AddProductToBasket()
                    .NavigateToBasket();

                products = basketCheckProductAttributesAfterColorChange.GetProducts();
            }
            catch (Exception ex)
            {
                Logger.ErrorHandler(driver, ex);
            }
            Assert.AreEqual(expectedProduct.name, products[0].name, "invalid name");
            Assert.AreEqual(expectedProduct.color.ToLower(), products[0].color, "invalid color");
            Assert.AreEqual(expectedProduct.size, products[0].size, "invalid size");
            Assert.AreEqual(expectedProduct.item, products[0].item, "invalid item");
            Assert.AreEqual(expectedProduct.price, products[0].price, "invalid price");
            Assert.AreEqual(expectedProduct.count, products[0].count, "invalid count");
        }
Пример #2
0
        public void CheckTheTotalPriceOfTwoDifferentGoods()
        {
            Logger.Log.Info("CheckTheTotalPriceOfTwoDifferentGoods");
            expectedProducts = new List <Product>();
            expectedProducts.Add(ProductCreator.withManyColors_Black());
            expectedProducts.Add(ProductCreator.withManyColors_ArchiveBeige());
            string      totalPrice = "";
            ProductPage productPageCheckTheTotalPriceOfTwoDifferentGoods = new ProductPage(driver);

            try
            {
                productPageCheckTheTotalPriceOfTwoDifferentGoods.OpenPage(expectedProducts[0].URL)
                .AcceptCookies()
                .AddProductToBasket()
                .NavigateToBasket();


                BasketPage basketPageCheckTheTotalPriceOfTwoDifferentGoods =
                    productPageCheckTheTotalPriceOfTwoDifferentGoods.OpenPage(expectedProducts[1].URL)
                    .AddProductToBasket()
                    .NavigateToBasket();

                products   = basketPageCheckTheTotalPriceOfTwoDifferentGoods.GetProducts();
                totalPrice = basketPageCheckTheTotalPriceOfTwoDifferentGoods.GetTotalPrice();
            }
            catch (Exception ex)
            {
                Logger.ErrorHandler(driver, ex);
            }
            Assert.AreEqual(expectedProducts[0].name, products[0].name, "invalid name");
            Assert.AreEqual(expectedProducts[0].color.ToLower(), products[0].color, "invalid color");
            Assert.AreEqual(expectedProducts[0].size, products[0].size, "invalid size");
            Assert.AreEqual(expectedProducts[0].item, products[0].item, "invalid item");
            Assert.AreEqual(expectedProducts[0].personalisation, products[0].personalisation, "invalid personalisation");
            Assert.AreEqual(expectedProducts[0].personalisationColor, products[0].personalisationColor, "invalid personalisation color");
            Assert.AreEqual(expectedProducts[0].count, products[0].count, "invalid count");

            Assert.AreEqual(expectedProducts[1].name, products[1].name, "invalid name");
            Assert.AreEqual(expectedProducts[1].color.ToLower(), products[1].color, "invalid color");
            Assert.AreEqual(expectedProducts[1].size, products[1].size, "invalid size");
            Assert.AreEqual(expectedProducts[1].item, products[1].item, "invalid item");
            Assert.AreEqual(expectedProducts[1].personalisation, products[1].personalisation, "invalid personalisation");
            Assert.AreEqual(expectedProducts[1].personalisationColor, products[1].personalisationColor, "invalid personalisation color");
            Assert.AreEqual(expectedProducts[1].count, products[1].count, "invalid count");

            string productsTotalPrice = "£1,040";

            Assert.AreEqual(productsTotalPrice, totalPrice, "invalid price");
        }
Пример #3
0
        public void CheckTheCountOfShopsInUK()
        {
            Logger.Log.Info("CheckTheCountOfShopsInUK");
            expectedProduct = ProductCreator.withManyColors_Black();
            string      expectedLabel = "21 STORES IN UNITED KINGDOM";
            string      actualLabel   = "";
            ProductPage productPageCheckTheCountOfShopsInUK = new ProductPage(driver);

            try
            {
                productPageCheckTheCountOfShopsInUK.OpenPage(expectedProduct.URL)
                .AcceptCookies()
                .FindInStore()
                .AddStoresWithNoCurrentAvailability();

                actualLabel = productPageCheckTheCountOfShopsInUK.GetNumberOfShopsLabel();
            }
            catch (Exception ex)
            {
                Logger.ErrorHandler(driver, ex);
            }
            Assert.AreEqual(expectedLabel, actualLabel, "invalid label");
        }