Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
            }
        }