public void OrderRaitingRefrigeratorTest()
        {
            var resultComponent     = new ResultComponent(webDriver);
            var basicOrderComponent = new BasicOrderComponent(webDriver);

            resultComponent.Open(_url);
            basicOrderComponent.ClickProductType(BasicOrderComponent.ProductType.New);
            resultComponent.ProcessingComplite();
            basicOrderComponent.ClickOrder(BasicOrderComponent.OrderType.Rating);
            try
            {
                resultComponent.WaitProcessing();
            }
            catch (Exception) { }
            finally
            {
                resultComponent.ProcessingComplite();
            }
            double[] stars = resultComponent.GetAllStarsOnThisPage();
            for (int i = 0; i < stars.Length - 1; i++)
            {
                if (stars[i] < stars[i + 1])
                {
                    Assert.Fail("Error! The order rating not works");
                    break;
                }
            }

            log.Log(Status.Pass, "The order rating  works correctly");
        }
        public void OrderPriceDescRefrigeratorTest()
        {
            var resultComponent     = new ResultComponent(webDriver);
            var basicOrderComponent = new BasicOrderComponent(webDriver);

            resultComponent.Open(_url);
            basicOrderComponent.ClickProductType(BasicOrderComponent.ProductType.New);
            resultComponent.ProcessingComplite();
            basicOrderComponent.ClickOrder(BasicOrderComponent.OrderType.PriceDESC);
            try
            {
                resultComponent.WaitProcessing();
            }
            catch (Exception) { }
            finally
            {
                resultComponent.ProcessingComplite();
            }
            double[] price         = resultComponent.GetAllPriceOnThisPage();
            double[] priceSortDESC = resultComponent.GetAllPriceOnThisPage();
            Array.Sort(priceSortDESC);
            Array.Reverse(priceSortDESC);

            Assert.AreEqual(price, priceSortDESC, "Error, wrong sorting of prices");
            log.Log(Status.Pass, "The order price by DESC works correctly");
        }
Beispiel #3
0
        public void OrderPriceDescNotebookTest()
        {
            var resultComponent     = new ResultComponent(webDriver);
            var basicOrderComponent = new BasicOrderComponent(webDriver);

            resultComponent.Open(_url);
            basicOrderComponent.ClickProductType(BasicOrderComponent.ProductType.New);
            resultComponent.ProcessingComplite();
            basicOrderComponent.ClickOrder(BasicOrderComponent.OrderType.PriceDESC);
            try
            {
                resultComponent.WaitProcessing();
            }
            catch (Exception) { }
            finally
            {
                resultComponent.ProcessingComplite();
            }
            double[] price = resultComponent.GetAllPriceOnThisPage();
            for (int i = 0; i < price.Length - 1; i++)
            {
                if (price[i] < price[i + 1])
                {
                    Assert.Fail("Error! The order price by DESC not works");
                    break;
                }
            }

            log.Log(Status.Pass, "The order price by DESC works correctly");
        }
        public void OrderOtherRefrigeratorTest(BasicOrderComponent.OrderType type, string url)
        {
            var resultComponent     = new ResultComponent(webDriver);
            var basicOrderComponent = new BasicOrderComponent(webDriver);

            resultComponent.Open(_url);
            basicOrderComponent.ClickProductType(BasicOrderComponent.ProductType.New);
            resultComponent.ProcessingComplite();
            basicOrderComponent.ClickOrder(type);
            try
            {
                resultComponent.WaitProcessing();
            }
            catch (Exception) { }
            finally
            {
                resultComponent.ProcessingComplite();
            }
            List <string> fullNameListJSON = resultComponent.GetListJsonFullName(url);
            List <string> fullNameListPage = resultComponent.GetListFullnameOnThisPage();

            Assert.AreEqual(fullNameListJSON, fullNameListPage, "JSON is different");
            log.Log(Status.Pass, $"The order {type}  works correctly");
        }