public void VerifyProductDetailsAreDisplayedWhenUserClicksOnProductName()
        {
            productsPage  = new ProductsPage(CmdDriver.Driver);
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Verify Product details are displayed when a user clicks on product name");
            extentReportUtils.addTestLog(Status.Info, "VerifyProductDetailsAreDisplayedWhenUserClicksOnProductName");

            productsPage.ClickAcceptAllCookies();

            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI);

            string productName = HelperUtils.GetDescription(ProductsEnum.DEVCRAFT_UI);

            yourOrderPage.ClickAcceptAllCookies();

            // Assert productDetails are not displayed
            Assert.IsFalse(yourOrderPage.IsProductDetailsDisplayedByProductName(productName));

            // Click on product name
            yourOrderPage.ClickOnProductByProductName(productName);

            // Assert product details are displayed
            Assert.IsTrue(yourOrderPage.IsProductDetailsDisplayedByProductName(productName));

            // Click again on product name
            yourOrderPage.ClickOnProductByProductName(productName);

            // Assert productDetails are not displayed
            Assert.IsFalse(yourOrderPage.IsProductDetailsDisplayedByProductName(productName));
        }
        public void VerifyUserIsNavigatedBackToProductPageWhenRemovingExistingProductFromCard()
        {
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);
            productsPage  = new ProductsPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Verify the user is navigated back to Product page when removing the existing product from the card");
            extentReportUtils.addTestLog(Status.Info, "VerifyUserIsNavigatedBackToProductPageWhenRemovingExistingProductFromCard");

            productsPage.ClickAcceptAllCookies();

            // Choose product and click on 'Buy Now' button for it
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_COMPLETE);

            yourOrderPage.ClickAcceptAllCookies();

            // Click Delete item link by product name
            yourOrderPage.ClickDeleteItemButtonByProductName(ProductsEnum.DEVCRAFT_COMPLETE);

            // Assert Emtry Card message text
            Assert.AreEqual("Your shopping cart is empty!", yourOrderPage.GetEmptyCardMessageText());

            // Click "Browse Products" button
            yourOrderPage.ClickBrowseProductsButton();

            // Assert Header on Product page
            Assert.AreEqual("Pricing", productsPage.GetHeaderText());
        }
示例#3
0
        public void CheckAutoRenewNoteIsNotDisplayedWhenTheUserHasNotCheckIt()
        {
            productsPage    = new ProductsPage(CmdDriver.Driver);
            yourOrderPage   = new YourOrderPage(CmdDriver.Driver);
            contactInfoPage = new ContactInfoPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check Auto renewal note is NOT displayed on Contact Info page when the user has not check it");
            extentReportUtils.addTestLog(Status.Info, "CheckAutoRenewNoteIsNotDisplayedWhenTheUserHasNotCheckIt");
            //CmdDriver.NavigateTo("https://store.progress.com/configure-purchase?skuId=6127");

            productsPage.ClickAcceptAllCookies();

            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_ULTIMATE);

            yourOrderPage.ClickAcceptAllCookies();

            // Assert there is at least one product at the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            // Navigate user to the next page - Contact Info Page
            yourOrderPage.ClickContinueButton();

            // Assert Auto Renewal Message Box is displayed
            Assert.IsFalse(contactInfoPage.IsAutoRenewalMessageDisplayed());
        }
示例#4
0
        public void CheckValidationForEmail()
        {
            productsPage     = new ProductsPage(CmdDriver.Driver);
            yourOrderPage    = new YourOrderPage(CmdDriver.Driver);
            contactInfoPage  = new ContactInfoPage(CmdDriver.Driver);
            orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check validation for email");
            extentReportUtils.addTestLog(Status.Info, "CheckValidationForEmail");

            productsPage.ClickAcceptAllCookies();

            // Click on Buy Now button per Product name
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI);

            yourOrderPage.ClickAcceptAllCookies();

            // Assert there is at least one product at the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            // Navigate user to the next page - Contact Info Page
            yourOrderPage.ClickContinueButton();

            contactInfoPage.ClickAcceptAllCookies();

            ContactInfo contactInfo = new ContactInfo();

            contactInfo.Email = "32543543512@";

            // Fill Billing Information
            contactInfoPage.SetFirstName(contactInfo.FirstName);
            contactInfoPage.SetLastName(contactInfo.LastName);
            contactInfoPage.SetCompany(contactInfo.CompanyName);
            contactInfoPage.SetPhone(contactInfo.PhoneNumber);
            contactInfoPage.SetAddress(contactInfo.Address.Street);
            contactInfoPage.SetCountry(contactInfo.Address.Country);
            contactInfoPage.SetCity(contactInfo.Address.City);
            contactInfoPage.SetZipCode(contactInfo.Address.ZipCode);

            contactInfoPage.ClickContinueButton();

            // Assert email error message about required field
            Assert.AreEqual("Email is required", contactInfoPage.GetErrorMessageForEmail());

            // Set email with more than max lenght (150)
            string tooLongEmail = StringUtils.CreateString(151);

            contactInfoPage.SetEmail(tooLongEmail);

            // Assert error message about lenght
            Assert.AreEqual("Invalid email", contactInfoPage.GetErrorMessageForEmail());
        }
        public void CheckErrorMessageForInvalidCoupon()
        {
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check error message for an invalid coupon");
            extentReportUtils.addTestLog(Status.Info, "CheckErrorMessageForInvalidCoupon");
            CmdDriver.NavigateTo("https://store.progress.com/configure-purchase?skuId=6127");

            yourOrderPage.ClickAcceptAllCookies();

            // Set coupon
            yourOrderPage.SetCoupon("TestDiscount20");

            // Assert error message
            Assert.AreEqual("Coupon code is not valid.", yourOrderPage.GetCouponErrorMessageText());
        }
示例#6
0
        public void CheckVatIdIsNotRequiredField()
        {
            productsPage     = new ProductsPage(CmdDriver.Driver);
            yourOrderPage    = new YourOrderPage(CmdDriver.Driver);
            contactInfoPage  = new ContactInfoPage(CmdDriver.Driver);
            orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check Vat id is not a required field");
            extentReportUtils.addTestLog(Status.Info, "CheckVatIdIsNotRequiredField");

            productsPage.ClickAcceptAllCookies();

            // Click on Buy Now button per Product name
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI);

            yourOrderPage.ClickAcceptAllCookies();

            // Assert there is at least one product at the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            // Navigate user to the next page - Contact Info Page
            yourOrderPage.ClickContinueButton();

            ContactInfo contactInfo = new ContactInfo();

            contactInfo.Address.Country = "Bulgaria";
            contactInfo.Address.City    = "Sofia";
            contactInfo.Address.ZipCode = "1000";
            contactInfo.VatId           = "";

            // Fill Billing Information
            contactInfoPage.FillBillingInformation(contactInfo);

            // Assert error message for vat id is NOT displayed
            Assert.IsFalse(contactInfoPage.IsVatIdErrorMessageDisplayed());

            // Navigate user to next page
            contactInfoPage.ClickContinueButton();

            // Assert at Order summary page
            Assert.AreEqual("Order Summary", orderSummaryPage.GetHeaderText());
        }
示例#7
0
        public void CheckAutoRenewNoteIsDisplayedOnContactInfoPageWhenTheUserCheckIt()
        {
            productsPage    = new ProductsPage(CmdDriver.Driver);
            yourOrderPage   = new YourOrderPage(CmdDriver.Driver);
            contactInfoPage = new ContactInfoPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check Auto renewal note is displayed on Contact Info page when the user check it");
            extentReportUtils.addTestLog(Status.Info, "CheckAutoRenewNoteIsDisplayedOnContactInfoPageWhenTheUserCheckIt");
            //CmdDriver.NavigateTo("https://store.progress.com/configure-purchase?skuId=6127");

            productsPage.ClickAcceptAllCookies();

            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_ULTIMATE);

            yourOrderPage.ClickAcceptAllCookies();

            // Get product name
            string productName = HelperUtils.GetDescription(ProductsEnum.DEVCRAFT_COMPLETE);

            // Assert there is at least one product at the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            // Check Auto Renewal Checkbox
            yourOrderPage.ClickAutomaticalyRenewalCheckbox(productName);

            // Navigate user to the next page - Contact Info Page
            yourOrderPage.ClickContinueButton();

            // Assert Auto Renewal Message Box is displayed
            Assert.IsTrue(contactInfoPage.IsAutoRenewalMessageDisplayed());

            // Click 'Your Account' link
            contactInfoPage.ClickYourAccountLink();

            // Accept cookies
            contactInfoPage.ClickAcceptAllCookies();

            // Check current url
            string url = CmdDriver.Driver.Url.Trim();

            Assert.IsTrue(url.Contains("https://www.telerik.com/login/v2/telerik"));
        }
        public void VerifySavingsLabelsAreNotDisplayedWhenQuantitiesAreWithDefaultValues()
        {
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Verify savings labels are not displayed when quantities are with default values");
            extentReportUtils.addTestLog(Status.Info, "VerifySavingsLabelsAreNotDisplayedWhenQuantityAreWithDefaultValues");
            CmdDriver.NavigateTo("https://store.progress.com/configure-purchase?skuId=6127");

            yourOrderPage.ClickAcceptAllCookies();

            // Assert default License quantity value
            Assert.AreEqual(1, yourOrderPage.GetSelectedLicenceQuantityValue());

            // Assert default Maintenance & Support quantity value
            Assert.AreEqual(HelperUtils.GetDescription(YearQuantity.ONE_YEAR), yourOrderPage.GetSelectedMaintenanceAndSupportQuantityValue());

            // Assert Savings Label is NOT displayed under Unit Price
            Assert.IsFalse(yourOrderPage.IsSavingsLabelForUnitPriceDisplayed());

            // Assert Savings Label is NOT displayed under Yearly Price
            Assert.IsFalse(yourOrderPage.IsSavingsLabelForYearlyPriceDisplayed());
        }
示例#9
0
        public void CheckBillingInformationWithState()
        {
            productsPage     = new ProductsPage(CmdDriver.Driver);
            yourOrderPage    = new YourOrderPage(CmdDriver.Driver);
            contactInfoPage  = new ContactInfoPage(CmdDriver.Driver);
            orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check Billing information with state");
            extentReportUtils.addTestLog(Status.Info, "CheckBillingInformationWithState");

            productsPage.ClickAcceptAllCookies();

            // Click on Buy Now button per Product name
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI);

            yourOrderPage.ClickAcceptAllCookies();

            // Assert there is at least one product at the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            // Navigate user to the next page - Contact Info Page
            yourOrderPage.ClickContinueButton();

            ContactInfo contactInfo = new ContactInfo();

            // Fill Billing Information
            contactInfoPage.FillBillingInformation(contactInfo);

            // Assert Vat field is not displayed
            Assert.IsFalse(contactInfoPage.IsVatIdFieldDisplayed());

            // Navigate user to next page
            contactInfoPage.ClickContinueButton();

            // Assert at Order summary page
            Assert.AreEqual("Order Summary", orderSummaryPage.GetHeaderText());
        }
示例#10
0
        public void CheckBillingInformationWithVat()
        {
            productsPage     = new ProductsPage(CmdDriver.Driver);
            yourOrderPage    = new YourOrderPage(CmdDriver.Driver);
            contactInfoPage  = new ContactInfoPage(CmdDriver.Driver);
            orderSummaryPage = new OrderSummaryPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check Billing information with state");
            extentReportUtils.addTestLog(Status.Info, "CheckBillingInformationWithState");

            productsPage.ClickAcceptAllCookies();

            // Click on Buy Now button per Product name
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_UI);

            yourOrderPage.ClickAcceptAllCookies();

            // Assert there is at least one product at the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            // Navigate user to the next page - Contact Info Page
            yourOrderPage.ClickContinueButton();

            ContactInfo contactInfo = new ContactInfo();

            contactInfo.Address.Country = "Bulgaria";
            contactInfo.Address.City    = "Sofia";
            contactInfo.Address.ZipCode = "1000";
            contactInfo.VatId           = "BG160026043";

            // Fill Billing Information
            contactInfoPage.FillBillingInformation(contactInfo);
            contactInfoPage.ClickContinueButton();

            // Assert at Order summary page
            Assert.AreEqual("Order Summary", orderSummaryPage.GetHeaderText());
        }
        public void CheckTotalAndSubtotalValuesWhenThereAreDiscountsForBothLicensesAndYearlyDropDowns()
        {
            productsPage  = new ProductsPage(CmdDriver.Driver);
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check total and subtotal values when there are discounts for both licenses and yearly dropdowns");
            extentReportUtils.addTestLog(Status.Info, "CheckTotalAndSubtotalValuesWhenThereAreDiscountsForBothLicensesAndYearlyDropDowns");
            //CmdDriver.NavigateTo("https://store.progress.com/configure-purchase?skuId=6127");

            productsPage.ClickAcceptAllCookies();

            // Choose product and click on 'Buy Now' button for it
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_ULTIMATE);

            yourOrderPage.ClickAcceptAllCookies();

            Product product = new Product(ProductType.LICENSE_AND_YEARLY_DISCOUNT);

            // Set min values to have discounts for both licenses and yearly
            product.MinLicenseQty = 2;
            product.MinYearlyQty  = 2;

            // Set Unit Price and M & S subscription price
            product.InitialUnitPrice     = yourOrderPage.GetUnitPrice();
            product.MNsSubscriptionPrice = yourOrderPage.GetMnSSubscriptionPrice();

            // Set license quantity
            int randomLicenseQuantity = yourOrderPage.GetRandomLicenseQuantityWithMinValue(product.MinLicenseQty);

            product.LicenseQuantity = randomLicenseQuantity;

            // Set license discount
            product.LicenseDiscount = yourOrderPage.GetQuantityDiscounts(product.LicenseQuantity);

            // Calculate discount
            yourOrderPage.SetLicenseQuantity(product.LicenseQuantity);

            // Set Yearly quantity
            int randomYearQuantity = yourOrderPage.GetRandomYearQuantityWithMinValue(product.MinYearlyQty);

            product.YearlyQuantity = randomYearQuantity;
            product.YearlyDiscount = yourOrderPage.GetYearQuantityDiscounts(randomYearQuantity);
            yourOrderPage.SetMaintenanceAndSupportQuantity(product.YearlyQuantity);

            // Calculations
            product.CalculateValues();

            // Assert actual and expected unit price
            double actualUnitPrice = yourOrderPage.GetUnitPrice();

            Assert.AreEqual(product.UnitPrice, actualUnitPrice);

            // Check discount for licenses
            double actualDiscountForLicenses = yourOrderPage.GetSavingsLabelForUnitPrice();

            Assert.AreEqual(product.ExpectedDiscountForLicense, actualDiscountForLicenses);

            // Assert actual and expected yearly price
            double actualYearlyPrice = yourOrderPage.GetYearlyQuantityValue();

            Assert.AreEqual(product.ExpectedYearlyPrice, actualYearlyPrice);

            // Check discount
            double actualDiscountForYear = yourOrderPage.GetSavingsLabelForYearlyPrice();

            Assert.AreEqual(product.DiscountForYear, actualDiscountForYear);

            // Assert subtotal value
            double actualSubtotal = yourOrderPage.GetSubtotalValue();

            Assert.AreEqual(product.SubtotalValue, actualSubtotal);

            // Assert renewal price
            double actualRenewalPrice = yourOrderPage.GetMnSSubscriptionPrice();

            Assert.AreEqual(product.ExpectedRenewalPrice, actualRenewalPrice);

            // Assert total license price
            double actualTotalLicensesPrice = yourOrderPage.GetTotalLicensesPrice();

            Assert.AreEqual(product.ExpectedTotalLicensesPrice, actualTotalLicensesPrice);

            // Assert total Maintenance price
            double actualMaintenancePrice = yourOrderPage.GetTotalMaintenancePrice();

            Assert.AreEqual(product.ExpectedMaintenancePrice, actualMaintenancePrice);

            // Assert total discounts
            double actualTotalDiscounts = yourOrderPage.GetTotalDiscounts();

            Assert.AreEqual(product.ExpectedTotalDiscounts, actualTotalDiscounts);

            // Assert Total value
            double actualTotalValue = yourOrderPage.GetTotalValue();

            Assert.AreEqual(product.ExpectedTotalValue, actualTotalValue);

            // Assert Subtotal and Total value
            Assert.AreEqual(product.SubtotalValue, product.ExpectedTotalValue);
        }
        public void CheckLicenseQuantityWhenUserAddTheSameProductTwiceToCard()
        {
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);
            productsPage  = new ProductsPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check license quantity when user add the same product twice to card");
            extentReportUtils.addTestLog(Status.Info, "CheckLicenseQuantityWhenUserAddTheSameProductTwiceToCard");

            productsPage.ClickAcceptAllCookies();

            // Click on Buy Now button per Product name
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_COMPLETE);

            yourOrderPage.ClickAcceptAllCookies();

            string productName = HelperUtils.GetDescription(ProductsEnum.DEVCRAFT_COMPLETE);

            Assert.IsTrue(yourOrderPage.IsProductDisplayedByProductName(productName));

            // Assert only one product is displayed on the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            // Assert default License quantity value
            Assert.AreEqual(1, yourOrderPage.GetSelectedLicenceQuantityValue());

            Product product = new Product(ProductType.LICENSE_AND_YEARLY_DISCOUNT);
            int     qty     = 1;

            product.LicenseQuantity = qty;
            product.YearlyQuantity  = qty;

            // Set Unit Price and M & S subscription price
            product.InitialUnitPrice     = yourOrderPage.GetUnitPrice();
            product.MNsSubscriptionPrice = yourOrderPage.GetMnSSubscriptionPrice();

            // Set license discount
            product.LicenseDiscount = yourOrderPage.GetQuantityDiscounts(product.LicenseQuantity);

            // Calculate discount
            yourOrderPage.SetLicenseQuantity(product.LicenseQuantity);

            product.YearlyDiscount = (yourOrderPage.GetYearQuantityDiscounts(qty));
            yourOrderPage.SetMaintenanceAndSupportQuantity(product.YearlyQuantity);

            // Calculations
            product.CalculateValues();

            // Assert actual and expected unit price
            double actualUnitPrice = yourOrderPage.GetUnitPrice();

            Assert.AreEqual(product.UnitPrice, actualUnitPrice);

            // Assert subtotal value
            double actualSubtotal = yourOrderPage.GetSubtotalValue();

            Assert.AreEqual(product.SubtotalValue, actualSubtotal);

            // Assert renewal price
            double actualRenewalPrice = yourOrderPage.GetMnSSubscriptionPrice();

            Assert.AreEqual(product.ExpectedRenewalPrice, actualRenewalPrice);

            // Assert Total value
            double actualTotalValue = yourOrderPage.GetTotalValue();

            Assert.AreEqual(product.ExpectedTotalValue, actualTotalValue);

            // Assert Subtotal and Total value
            Assert.AreEqual(product.SubtotalValue, product.ExpectedTotalValue);

            // Click 'Continue Shopping' button
            yourOrderPage.ClickContinueShoppingButton();

            // Click on 'Buy now" button for same product
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_COMPLETE);

            // Assert only one product is displayed on the page
            Assert.AreEqual(1, yourOrderPage.GetProductsCountFromPage());

            int expectedLicenseQty2 = 2;

            // Assert license Qty is incresed
            Assert.AreEqual(expectedLicenseQty2, yourOrderPage.GetSelectedLicenceQuantityValue());

            product.LicenseQuantity = expectedLicenseQty2;

            // Calculate discount
            yourOrderPage.SetLicenseQuantity(product.LicenseQuantity);

            product.CalculateValues();

            // Assert Subtotal and Total value
            Assert.AreEqual(product.SubtotalValue, product.ExpectedTotalValue);
        }
        public void CheckTotalAndSubtotalValuesWhenThereIsADiscountOnlyForYearly()
        {
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check total and subtotal values when there are discounts for both licenses and yearly dropdowns");
            extentReportUtils.addTestLog(Status.Info, "CheckTotalAndSubtotalValuesWhenThereAreDiscountsForBothLicensesAndYearlyDropDowns");
            CmdDriver.NavigateTo("https://store.progress.com/configure-purchase?skuId=6127");

            yourOrderPage.ClickAcceptAllCookies();

            Product product = new Product(ProductType.ONLY_YEARLY_DISCOUNT);

            product.LicenseQuantity = 1;
            product.MinYearlyQty    = 2;

            // Set Unit Price and M & S subscription price
            product.InitialUnitPrice     = yourOrderPage.GetUnitPrice();
            product.MNsSubscriptionPrice = yourOrderPage.GetMnSSubscriptionPrice();

            // Assert Savings Label is NOT displayed under Unit Price
            Assert.IsFalse(yourOrderPage.IsSavingsLabelForUnitPriceDisplayed());

            // Set Yearly quantity
            int randomYearQuantity = yourOrderPage.GetRandomYearQuantityWithMinValue(product.MinYearlyQty);

            product.YearlyQuantity = randomYearQuantity;
            product.YearlyDiscount = yourOrderPage.GetYearQuantityDiscounts(randomYearQuantity);
            yourOrderPage.SetMaintenanceAndSupportQuantity(product.YearlyQuantity);

            // Calculations
            product.CalculateValues();

            // Assert actual and expected unit price
            double actualUnitPrice = yourOrderPage.GetUnitPrice();

            Assert.AreEqual(product.UnitPrice, actualUnitPrice);

            // Assert actual and expected yearly price
            double actualYearlyPrice = yourOrderPage.GetYearlyQuantityValue();

            Assert.AreEqual(product.ExpectedYearlyPrice, actualYearlyPrice);

            // Check discount
            double actualDiscountForYear = yourOrderPage.GetSavingsLabelForYearlyPrice();

            Assert.AreEqual(product.DiscountForYear, actualDiscountForYear);

            // Assert subtotal value
            double actualSubtotal = yourOrderPage.GetSubtotalValue();

            Assert.AreEqual(product.SubtotalValue, actualSubtotal);

            // Assert renewal price
            double actualRenewalPrice = yourOrderPage.GetMnSSubscriptionPrice();

            Assert.AreEqual(product.ExpectedRenewalPrice, actualRenewalPrice);

            // Assert total Maintenance price
            double actualMaintenancePrice = yourOrderPage.GetTotalMaintenancePrice();

            Assert.AreEqual(product.ExpectedMaintenancePrice, actualMaintenancePrice);

            // Assert total discounts
            double actualTotalDiscounts = yourOrderPage.GetTotalDiscounts();

            Assert.AreEqual(product.ExpectedTotalDiscounts, actualTotalDiscounts);

            // Assert Total value
            double actualTotalValue = yourOrderPage.GetTotalValue();

            Assert.AreEqual(product.ExpectedTotalValue, actualTotalValue);

            // Assert Subtotal and Total value
            Assert.AreEqual(product.SubtotalValue, product.ExpectedTotalValue);
        }
        public void CheckTotalAndSubtotalValuesWhenThereIsADiscountOnlyForLicenses()
        {
            productsPage  = new ProductsPage(CmdDriver.Driver);
            yourOrderPage = new YourOrderPage(CmdDriver.Driver);

            extentReportUtils.createATestCase("Check total and subtotal values when there is a discount only for licenses");
            extentReportUtils.addTestLog(Status.Info, "CheckTotalAndSubtotalValuesWhenThereIsADiscountOnlyForLicenses");

            productsPage.ClickAcceptAllCookies();

            // Choose product and click on 'Buy now' button for it
            productsPage.ClickBuyNowButtonByProductName(ProductsEnum.DEVCRAFT_ULTIMATE);

            yourOrderPage.ClickAcceptAllCookies();

            Product product = new Product(ProductType.ONLY_LICENCE_DISCOUNT);

            // Set min values to have discounts for both licenses and yearly
            product.MinLicenseQty = 2;
            product.MinYearlyQty  = 2;

            // Set Unit Price and M & S subscription price
            product.InitialUnitPrice     = yourOrderPage.GetUnitPrice();
            product.MNsSubscriptionPrice = yourOrderPage.GetMnSSubscriptionPrice();

            // Set license quantity
            int randomLicenseQuantity = yourOrderPage.GetRandomLicenseQuantityWithMinValue(product.MinLicenseQty);

            product.LicenseQuantity = randomLicenseQuantity;

            // Set license discount
            product.LicenseDiscount = yourOrderPage.GetQuantityDiscounts(product.LicenseQuantity);

            // Set License quantity
            yourOrderPage.SetLicenseQuantity(product.LicenseQuantity);

            // Set yearly quantity to be 1 (we don't want to have a discount)
            product.YearlyQuantity = 1;
            product.YearlyDiscount = yourOrderPage.GetYearQuantityDiscounts(product.YearlyQuantity);

            // Calculations
            product.CalculateValues();

            // Assert actual and expected unit price
            double actualUnitPrice = yourOrderPage.GetUnitPrice();

            Assert.AreEqual(product.UnitPrice, actualUnitPrice);

            // Check discount for licenses
            double actualDiscountForLicenses = yourOrderPage.GetSavingsLabelForUnitPrice();

            Assert.AreEqual(product.ExpectedDiscountForLicense, actualDiscountForLicenses);

            // Check discount
            Assert.IsFalse(yourOrderPage.IsSavingsLabelForYearlyPriceDisplayed());

            // Assert subtotal value
            double actualSubtotal = yourOrderPage.GetSubtotalValue();

            Assert.AreEqual(product.SubtotalValue, actualSubtotal);

            // Assert renewal price
            double actualRenewalPrice = yourOrderPage.GetMnSSubscriptionPrice();

            Assert.AreEqual(product.ExpectedRenewalPrice, actualRenewalPrice);

            // Assert total license price
            double actualTotalLicensesPrice = yourOrderPage.GetTotalLicensesPrice();

            Assert.AreEqual(product.ExpectedTotalLicensesPrice, actualTotalLicensesPrice);

            // Assert total discounts
            double actualTotalDiscounts = yourOrderPage.GetTotalDiscounts();

            Assert.AreEqual(product.ExpectedTotalDiscounts, actualTotalDiscounts);

            // Assert Total value
            double actualTotalValue = yourOrderPage.GetTotalValue();

            Assert.AreEqual(product.ExpectedTotalValue, actualTotalValue);

            // Assert Subtotal and Total value
            Assert.AreEqual(product.SubtotalValue, product.ExpectedTotalValue);
        }