Beispiel #1
0
 public string CouponPercentageMethod()
 {
     WebDriverUtils.WaitForElementToBeVisible(driver, TableFrameXpath);
     if (CouponsPageValidations.ValidateIfNoElementsFoundExist(driver, NoFoundElementsField))
     {
         //Initialize variables
         WebDriverUtils.WaitForElementToBeClickable(driver, PercentageField);
         string CouponPercentage = WebDriverUtils.GetElementText(PercentageField);
         return(CouponPercentage);
     }
     return(null);
 }
Beispiel #2
0
        public string MaxUsesMethod()
        {
            WebDriverUtils.WaitForElementToBeVisible(driver, TableFrameXpath);

            if (CouponsPageValidations.ValidateIfNoElementsFoundExist(driver, NoFoundElementsField) == true)
            {
                WebDriverUtils.WaitForElementToBeClickable(driver, MaxUsesField);
                string CouponMaxUses = WebDriverUtils.GetElementText(MaxUsesField);
                return(CouponMaxUses);
            }

            return(null);
        }
Beispiel #3
0
        public void TC31_Coupon_SearchedCouponSuccessfully()
        {
            Logger.Info("test Case name TC31_Coupon_SearchedCouponSuccessfully");
            string Value = ConfigurationManager.AppSettings["number"];

            //Execution
            DashBoard   dashboard = new DashBoard(driver);
            CouponsPage coupons   = dashboard.goToCouponsPage();

            Logger.Info("SearchCoupon " + Value);
            coupons.SearchCoupon(Value);

            //Validation
            Logger.Info("ValidateSearchField");
            CouponsPageValidations.ValidateSearchField(coupons, driver, Value);
            Thread.Sleep(1000);
        }
Beispiel #4
0
        public bool SearchFieldMethod(string value)
        {
            //Initialize variables
            bool failed;

            WebDriverUtils.WaitForElementToBeVisible(driver, TableFrameXpath);

            if (CouponsPageValidations.ValidateIfNoElementsFoundExist(driver, NoFoundElementsField) == true)
            {
                WebDriverUtils.WaitForElementToBeClickable(driver, CouponCodeField);

                string CouponCode       = WebDriverUtils.GetElementText(CouponCodeField);
                string CouponPercentage = WebDriverUtils.GetElementText(PercentageField);
                string CouponMaxUses    = WebDriverUtils.GetElementText(MaxUsesField);

                if (CouponCode == value)
                {
                    failed = true;
                }
                else
                {
                    if (CouponPercentage == value)
                    {
                        failed = true;
                    }
                    else
                    {
                        if (CouponMaxUses == value)
                        {
                            failed = true;
                        }
                        else
                        {
                            failed = false;
                        }
                    }
                }
            }
            else
            {
                failed = false;
            }
            return(failed);
        }
Beispiel #5
0
        public bool CouponDeletedMethod(string deletevalue)
        {
            //Initialize variables
            bool exists;

            WebDriverUtils.WaitForElementToBeVisible(driver, TableFrameXpath);

            if (CouponsPageValidations.ValidateIfNoElementsFoundExist(driver, NoFoundElementsField) == false)
            {
                exists = false;
                return(exists);
            }
            else
            {
                WebDriverUtils.WaitForElementToBeClickable(driver, CouponId);
                exists = CouponId.Displayed.Equals(deletevalue);
                return(exists);
            }
        }
Beispiel #6
0
        public void TC27_Coupons_AddedCouponSuccessfully()
        {
            Logger.Info("Test Case Name TC27_Coupons_AddedCouponSuccessfully");
            string percentage = ConfigurationManager.AppSettings["percentage"];

            //Execution
            DashBoard dashboard = new DashBoard(driver);

            Logger.Info("Go to CouponsPage");
            CouponsPage coupons   = dashboard.goToCouponsPage();
            string      CodeValue = coupons.AddCouponWithGenericCode(percentage);

            coupons.SearchCoupon(CodeValue);

            //Validation
            CouponsPageValidations.ValidateCouponbyPercentage(coupons, driver, percentage);

            Thread.Sleep(1000);
        }
Beispiel #7
0
        public void TC28_Coupons_RemovedCouponSuccessfully()
        {
            Logger.Info("Test Case Name TC28_Coupons_RemovedCouponSuccessfully");
            string valuetodelete = ConfigurationManager.AppSettings["percentage"];

            //Execution
            DashBoard   dashboard = new DashBoard(driver);
            CouponsPage coupons   = dashboard.goToCouponsPage();

            Logger.Info("SearchCoupon " + valuetodelete);
            coupons.SearchCoupon(valuetodelete);
            CouponsPageValidations.ValidateSearchField(coupons, driver, valuetodelete);
            Logger.Info("Delecte Coupon " + valuetodelete);
            coupons.DeleteCoupon(valuetodelete);

            //Validation
            CouponsPageValidations.ValidateDeletedCoupon(coupons, driver, valuetodelete);

            Thread.Sleep(1000);
        }
Beispiel #8
0
        public void TC30_Coupons_EditedCouponSuccessfully()
        {
            Logger.Info("test Case name TC_30_Coupons_EditedCouponSuccessfully");
            string MaxUses = ConfigurationManager.AppSettings["MaxUses"];
            string Id      = ConfigurationManager.AppSettings["id"];

            //Execution
            DashBoard   dashboard = new DashBoard(driver);
            CouponsPage coupons   = dashboard.goToCouponsPage();

            Logger.Info("SearchCoupon " + Id);
            coupons.SearchCoupon(Id);
            CouponsPageValidations.ValidateSearchField(coupons, driver, Id);
            Logger.Info("EditCouponOnMaxUseValue " + MaxUses);
            coupons.EditCouponOnMaxUseValue(MaxUses);
            Logger.Info("SearchCoupon " + Id);
            coupons.SearchCoupon(Id);

            //Validation
            CouponsPageValidations.ValidateCouponByMaxUses(coupons, driver, MaxUses);
            Thread.Sleep(1000);
        }
Beispiel #9
0
        public void TC32_Coupon_PrintedCouponSuccessfully()
        {
            Logger.Info("Test Case Name TC32_Coupon_PrintedCouponSuccessfully");
            string ParentWindow;
            string printpage = ConfigurationManager.AppSettings["printpage"];
            string mainpage  = ConfigurationManager.AppSettings["mainpage"];

            //Execution
            DashBoard   dashboard = new DashBoard(driver);
            CouponsPage coupons   = dashboard.goToCouponsPage();

            Logger.Info("OpenPrintWindow");
            ParentWindow = coupons.OpenPrintWindow();

            //Validation
            Logger.Info("ValidateifURLisCorrect " + printpage);
            CouponsPageValidations.ValidateIfURLIsCorrect(driver, printpage);
            Logger.Info("ClosePrintWindow");
            coupons.ClosePrintWindow(ParentWindow);
            CouponsPageValidations.ValidateIfURLIsCorrect(driver, mainpage);
            Thread.Sleep(1000);
        }