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()); }
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); }