コード例 #1
0
        public void HighestDiscountCalculationCheck()
        {
            Logger.GetInstance().LogLine($"STEP: Opening main page...");
            MainPage mainPage = new MainPage();

            mainPage.SelectCategory(FileUtils.GetLocalizedString("Action"));
            Logger.GetInstance().LogLine($"STEP: Selected 'action' category.");

            CategoryPage gameCategoryPage = new CategoryPage(FileUtils.GetLocalizedString("Action"));

            gameCategoryPage.TopSellersButton.Click();
            SingleWebDriver.ScrollTo(0, 800);
            SteamGame gameWithHighestDiscount = gameCategoryPage.SelectGameWithHighestDiscount();

            Logger.GetInstance().LogLine($"STEP: Game with highest discount is got.");

            GamePage     gamePage = new GamePage();
            DiscountInfo discountInfoFromGamePage = gamePage.GetDiscountInfo();

            Assert.Multiple(() =>
            {
                Assert.AreEqual(gameWithHighestDiscount.DiscountInfo.Discount, discountInfoFromGamePage.Discount,
                                $"Discount from category page {gameWithHighestDiscount.DiscountInfo.Discount} is not equal to discount from game page.");
                Assert.AreEqual(gameWithHighestDiscount.DiscountInfo.OldPrice, discountInfoFromGamePage.OldPrice,
                                $"Old price from category page {gameWithHighestDiscount.DiscountInfo.OldPrice} is not equal to old price from game page.");
                Assert.AreEqual(gameWithHighestDiscount.DiscountInfo.NewPrice, discountInfoFromGamePage.NewPrice,
                                $"New price from category page {gameWithHighestDiscount.DiscountInfo.NewPrice} is not equal to new price from game page.");
            });
            Logger.GetInstance().LogLine($"STEP: Test complete.");
        }