public void SetMaintenanceAndSupportQuantity(int item) { string text = HelperUtils.GetDescription((YearQuantity)item - 1); SetQuantityAsString(MaintenanceAndSupportQuantity, text, locatorForYearlyDropdownValues); WaitUtils.WaitForLoaderToDisapear(driver); }
public void ClickDeleteItemButtonByProductName(ProductsEnum product) { string productName = HelperUtils.GetDescription(product); string newLocator = locatorForDeleteItemBttnByProductName.Replace("foo", productName); cmnElement.ClickElement(driver.FindElement(By.XPath(newLocator))); }
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 ClickBuyNowButtonByProductName(ProductsEnum product) { string productName = HelperUtils.GetDescription(product); string formatProductName = Regex.Replace(productName, @"^([\w\-]+ )", ""); string newLocator = locatorBuyNowButtonPerProductName.Replace("foo", formatProductName); driver.FindElement(By.XPath(newLocator)).Click(); WaitUtils.WaitForPageToLoad(driver); }
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()); }
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); }