コード例 #1
0
        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());
        }
コード例 #2
0
        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));
        }
コード例 #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 CheckValidationForCompany()
        {
            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 company");
            extentReportUtils.addTestLog(Status.Info, "CheckValidationForCompany");

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

            // Fill Billing Information
            contactInfoPage.SetFirstName(contactInfo.FirstName);
            contactInfoPage.SetLastName(contactInfo.LastName);
            contactInfoPage.SetEmail(contactInfo.Email);
            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.SetState("New Jersey");

            // Click 'Continue' button
            contactInfoPage.ClickContinueButton();

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

            // Set email with more than max lenght (60)
            string tooLongCompany = StringUtils.CreateString(61);

            contactInfoPage.SetCompany(tooLongCompany);

            // Click 'Continue' button
            contactInfoPage.ClickContinueButton();

            // Assert email error message about required field
            Assert.AreEqual("Invalid company", contactInfoPage.GetErrorMessageForCompany());
        }
コード例 #5
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());
        }
コード例 #6
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"));
        }
コード例 #7
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());
        }
コード例 #8
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());
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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);
        }