예제 #1
0
        public void I_VerifyDateDropDownListOptions(string dropDownListElement)
        {
            List <string> dateDropDownListOptions = I_VerifyDropDownListOptionList(dropDownListElement);

            String[] DateArray = { "",   "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9",  "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
                                   "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" };
            Boolean  verify = true;

            for (int i = 0; i < dateDropDownListOptions.Count; i++)
            {
                if (!dateDropDownListOptions[i].Equals(DateArray[i]))
                {
                    verify = false;
                    break;
                }
            }
            if (verify)
            {
                Verification.Pass("TEST PASSED: Date drop down list options are displayed successfully.");
            }
            else
            {
                Verification.Fail("TEST FAILED: Date drop down list options are not displayed successfully.");
            }
        }
예제 #2
0
 public BaseElement(IWebDriver driver, By identifier)
 {
     try
     {
         this.driver = driver;
         // element = driver.FindElement(identifier);
         element = WaitUntilElementExists(identifier, driver);
     }
     catch (Exception ee)
     {
         String count      = ConfigurationManager.AppSettings.Get("Retry");
         int    retryCount = int.Parse(count);
         for (int i = 1; i <= retryCount; i++)
         {
             try
             {
                 element = driver.FindElement(identifier);
                 if (element.Displayed)
                 {
                     break;
                 }
             }
             catch (Exception e) {
                 Console.WriteLine(e);
             }
         }
         Verification.Fail(ee.ToString());
     }
 }
 public BaseElementList(IWebDriver driver, By identifier)
 {
     try
     {
         this.driver = driver;
         element     = WaitUntilElementExists(identifier, driver);
         elements    = driver.FindElements(identifier);
     }
     catch (Exception ee)
     {
         String count        = ConfigurationManager.AppSettings.Get("Retry");
         int    retryCount   = int.Parse(count);
         int    statusCount  = 0;
         int    elementCount = 0;
         for (int i = 1; i <= retryCount; i++)
         {
             try
             {
                 try
                 {
                     elementCount = driver.FindElements(identifier).Count;
                     for (int z = 0; z <= elementCount; z++)
                     {
                         if (driver.FindElement(identifier).Displayed)
                         {
                             statusCount++;
                         }
                         else
                         {
                             break;
                         }
                     }
                 }
                 catch (Exception e)
                 {
                     Console.WriteLine(e);
                 }
                 if (statusCount == elementCount)
                 {
                     try
                     {
                         elements = driver.FindElements(identifier);
                     }
                     catch (Exception exe) {
                         Verification.Fail(exe.ToString());
                     }
                 }
             }
             catch (Exception e)
             {
                 Console.Write(e);
             }
         }
         Verification.Fail(ee.ToString());
     }
 }
        public void I_CheckRefundStatusCustomerSuite()
        {
            I_CustomerSuiteLogin();
            I.Fill(Pages.CustomerSuitePage.OrderNoTextField, TestData.OrdersPage.OrderNumber);
            I.Click(Pages.CustomerSuitePage.SearchButton);
            I.Click(Pages.CustomerSuitePage.RefundButton);
            I.WaitUntilReady();
            string textLog = I.GetAttributeText(Pages.CustomerSuitePage.RefundProceedLabel);

            if (textLog.Contains("Refund Processed"))
            {
                I.Click(Pages.CustomerSuitePage.Logoutlink);
            }
            else
            {
                for (int i = 1; i <= 10; i++)
                {
                    I.RefreshPage();
                    I.WaitUntilReady();
                    I.Fill(Pages.CustomerSuitePage.OrderNoTextField, TestData.OrdersPage.OrderNumber);
                    I.Click(Pages.CustomerSuitePage.SearchButton);
                    I.Click(Pages.CustomerSuitePage.RefundButton);
                    I.Wait(3);
                    string textLognew = I.GetAttributeText(Pages.CustomerSuitePage.RefundProceedLabel);
                    if (textLognew.Contains("Refund Processed"))
                    {
                        break;
                    }
                }
                string statuslog = I.GetAttributeText(Pages.CustomerSuitePage.RefundProceedLabel);
                if (statuslog.Contains("Refund Processed"))
                {
                    I.Click(Pages.CustomerSuitePage.Logoutlink);
                }
                else
                {
                    Verification.Fail("Cannot find Refund Processed text");
                }
            }
        }
예제 #5
0
        public void I_VerifyMonthDropDownListOptions(string dropDownListElement)
        {
            List <string> monthDropDownListOptions = I_VerifyDropDownListOptionList(dropDownListElement);

            String[] monthArray = { "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" };
            Boolean  verify     = true;

            for (int i = 0; i < monthDropDownListOptions.Count; i++)
            {
                if (!monthDropDownListOptions[i].Equals(monthArray[i]))
                {
                    verify = false;
                    break;
                }
            }
            if (verify)
            {
                Verification.Pass("TEST PASSED: Month drop down list options are displayed successfully.");
            }
            else
            {
                Verification.Fail("TEST FAILED: Month drop down list options are not displayed successfully.");
            }
        }
예제 #6
0
        public void I_VerifyTitleDropDownListOptions(string dropDownListElement)
        {
            List <string> titleDropDownListOptions = I_VerifyDropDownListOptionList(dropDownListElement);

            String[] titleArray = { "", "Mr", "Mrs", "Miss", "Ms", "Dr" };
            Boolean  verify     = true;

            for (int i = 0; i < titleDropDownListOptions.Count; i++)
            {
                if (!titleDropDownListOptions[i].Equals(titleArray[i]))
                {
                    verify = false;
                    break;
                }
            }
            if (verify)
            {
                Verification.Pass("TEST PASSED: Title drop down list options are displayed successfully.");
            }
            else
            {
                Verification.Fail("TEST FAILED: Title drop down list options are not displayed successfully.");
            }
        }