Ejemplo n.º 1
0
        public void AchiveParent(IWebDriver driver, string ParentName)
        {
            sURL = Utilities.GlobalVariable.sURL + "Parent/Management";
            driver.Navigate().GoToUrl(sURL);

            Utilities.Common.TitleValidation(driver, "AchiveParent",
                                             "Parent Management - aimy plus");


            Utilities.Common.WaitBySleeping(Utilities.GlobalVariable.iShortWait);


            IWebElement txtCategory = WebDriverExtensions.FindElement(driver, By.Id("category"), 2);

            AimySendKeys(driver, txtCategory, ParentName);
            txtCategory.SendKeys(Keys.Enter);

            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(500));

            wait.PollingInterval = TimeSpan.FromSeconds(2);
            wait.Until(ExpectedConditions.ElementExists(By.CssSelector("span.caret.split-dropdown-caret")));

            IReadOnlyCollection <IWebElement> items =
                driver.FindElements(By.CssSelector("span.caret.split-dropdown-caret"));

            foreach (var item in items)
            {
                item.Click();
                break;
            }
            Thread.Sleep(2000);
            AimyClick(driver, menuItemArchive);
            Thread.Sleep(2000);
            AimyClick(driver, buttonOK);
        }
Ejemplo n.º 2
0
        public bool IsParentBeenRestoredToParentManagePage(IWebDriver driver, string ParentName)
        {
            log.Info("Parent Archive Restore Validation Test");
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            sURL = GlobalVariable.sURL + "Parent/Management";
            driver.Navigate().GoToUrl(sURL);
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            IWebElement txtCategory = WebDriverExtensions.FindElement(driver, By.Id("category"), 2);

            AimySendKeys(driver, txtCategory, ParentName);
            txtCategory.SendKeys(Keys.Enter);
            Thread.Sleep(2000);
            IReadOnlyCollection <IWebElement> elements = null;

            try
            {
                elements = WebDriverExtensions.FindElements(driver,
                                                            By.XPath("html/body/div[3]/div[3]/div[2]/table/tbody/tr[1]/td[3]/div/p[1]/b"),
                                                            10);
            }
            catch (Exception)
            {
                if (elements == null)
                {
                    log.Info("[FAIL]: '" + ParentName + "' has NOT been found.");
                    return(false);
                }
            }
            log.Info("[PASS]: '" + ParentName + "' has been RESTORED!");
            return(true);
        }
Ejemplo n.º 3
0
        public bool FindTheParent(IWebDriver driver, string ParentName)
        {
            log.Info("Parent Manager - FindArchivedParentName : Validation Test Case: ");
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            IWebElement txtCategory = WebDriverExtensions.FindElement(driver, By.Id("category"), 2);

            AimySendKeys(driver, txtCategory, ParentName);
            txtCategory.SendKeys(Keys.Enter);


            try
            {
                if (filteredParentName != null && filteredParentName.Displayed)
                {
                    bool flag = filteredParentName.Text.Equals(ParentName);
                }
            }
            catch (Exception)
            {
                if (filteredParentName == null)
                {
                    log.Info("[FAIL]  '" + ParentName + "' does NOT exist. FAILED!");
                    return(false);
                }
            }
            log.Info("[PASS] '" + ParentName + "' exist. PASSED!");
            return(true);
        }
Ejemplo n.º 4
0
        public int totalCardOnPage()
        {
            // Make sure at least one card is present on the page before counting
            WebDriverExtensions.FindElement(driver, cardFull, 120);

            // Count all the cards on page
            return(driver.FindElements(cardFull).Count);
        }
Ejemplo n.º 5
0
        public void FindElementDriverException()
        {
            var driver = new Mock <IWebDriver>();

            Assert.Throws <ArgumentException>(() =>
                                              WebDriverExtensions.FindElement(driver.Object,
                                                                              ElementLocatorMethods.None,
                                                                              string.Empty));
        }
Ejemplo n.º 6
0
        public void FindElementByTagName()
        {
            var driver = new ChromeDriver(Constants.CHROME_DRIVER_PATH);

            Assert.Throws <NoSuchElementException>(() =>
                                                   WebDriverExtensions.FindElement(driver,
                                                                                   ElementLocatorMethods.TagName,
                                                                                   "abc"));
            driver.Quit();
        }
Ejemplo n.º 7
0
        public void FindElementElementNullException()
        {
            var driver = new ChromeDriver(Constants.CHROME_DRIVER_PATH);

            Assert.Throws <ArgumentNullException>(() =>
                                                  WebDriverExtensions.FindElement(driver,
                                                                                  ElementLocatorMethods.None,
                                                                                  string.Empty));
            driver.Quit();
        }
Ejemplo n.º 8
0
        public void FindElementByNone()
        {
            var driver  = new ChromeDriver(Constants.CHROME_DRIVER_PATH);
            var element =
                WebDriverExtensions.FindElement(driver,
                                                ElementLocatorMethods.None,
                                                "abc");

            driver.Quit();
            Assert.Null(element);
        }
Ejemplo n.º 9
0
 public static IWebElement WaitForElement(this IWebDriver driver, SelectorBase selector)
 {
     if (driver == null)
     {
         throw new ArgumentNullException("driver");
     }
     if (selector == null)
     {
         throw new ArgumentNullException("selector");
     }
     new WebDriverWait(driver, DefaultWaitTimeSpan).Until <WebElement>(d => WebDriverExtensions.FindElement(d, selector));
     return(WebDriverExtensions.FindElement(driver, selector));
 }
Ejemplo n.º 10
0
        public bool IsParentUnlocked(IWebDriver driver, string ParentName)
        {
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            IReadOnlyCollection <IWebElement> TableRows = WebDriverExtensions.FindElements(driver,
                                                                                           By.XPath("html/body/div[3]/div[3]/div[2]/table/tbody/tr"), 2);

            for (int t = 0; t < TableRows.Count; t++)
            {
                if (TableRows.ElementAt(t) != null)
                {
                    if (!String.IsNullOrEmpty(TableRows.ElementAt(t).GetAttribute("style")))
                    {
                        if (TableRows.ElementAt(t).GetAttribute("style").Equals("background-color: rgb(239, 201, 201);"))
                        {
                            // filter for this parent
                            IWebElement txtCategory = WebDriverExtensions.FindElement(driver, By.Id("category"), 2);

                            AimySendKeys(driver, txtCategory, ParentName);
                            txtCategory.SendKeys(Keys.Enter);

                            // locate the 'profile' dropdown list
                            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(500));
                            wait.PollingInterval = TimeSpan.FromSeconds(2);
                            wait.Until(
                                ExpectedConditions.ElementExists(By.CssSelector("span.caret.split-dropdown-caret")));

                            IReadOnlyCollection <IWebElement> items =
                                driver.FindElements(By.CssSelector("span.caret.split-dropdown-caret"));
                            // click on 'profile'dropdown list
                            foreach (var item in items)
                            {
                                item.Click();
                                break;
                            }

                            Thread.Sleep(2000);
                            AimyClick(driver, menuItemUnlock);
                            Thread.Sleep(2000);
                            AimyClick(driver, buttonOK);

                            return(true);
                        }
                    }
                }
            }
            return(true);
        }
        public bool AchiveChildren(IWebDriver driver, string ChildName)
        {
            sURL = GlobalVariable.sURL + "Parent/ChildManagement";
            driver.Navigate().GoToUrl(sURL);

            Common.TitleValidation(driver, "AchiveChildren",
                                   "Child Management - aimy plus");


            Common.WaitBySleeping(GlobalVariable.iShortWait);

            IWebElement txtCategory = WebDriverExtensions.FindElement(driver, By.Id("category"), 2);

            AimySendKeys(driver, txtCategory, ChildName);

            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));

            wait.PollingInterval = TimeSpan.FromSeconds(2);
            wait.Until(ExpectedConditions.ElementExists(By.CssSelector("span.caret.split-dropdown-caret")));

            IReadOnlyCollection <IWebElement> items =
                driver.FindElements(By.CssSelector("span.caret.split-dropdown-caret"));

            foreach (var item in items)
            {
                item.Click();
                break;
            }

            AimyClick(driver, menuItemArchive);
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            AimyClick(driver, buttonNO);
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            driver.Navigate().GoToUrl(sURL);
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            AimySendKeys(driver, WebDriverExtensions.FindElement(driver, By.Id("category"), 2), ChildName);
            Common.WaitBySleeping(GlobalVariable.iShortWait);
            bool actuResult = ValidationChildAchive(driver, "AchiveChildren");

            return(actuResult);
        }
Ejemplo n.º 12
0
 public void detailAnnualTripClick()
 {
     WebDriverExtensions.FindElement(driver, detailAnnualTrip, 120).Click();
 }
Ejemplo n.º 13
0
 public void collapseSeemoreButtonClick()
 {
     WebDriverExtensions.FindElement(driver, collapseSeemoreButton, 120).Click();
 }
Ejemplo n.º 14
0
 public void sortPriceLowToHighClick()
 {
     WebDriverExtensions.FindElement(driver, sortPriceLowToHighCheckbox, 120).Click();
 }
Ejemplo n.º 15
0
 public void FPGInsuranceCheckboxClick()
 {
     WebDriverExtensions.FindElement(driver, FPGInsuranceCheckbox, 120).Click();
 }
Ejemplo n.º 16
0
 public void insuranceTabClick()
 {
     WebDriverExtensions.FindElement(driver, insuranceTab, 120).Click();
 }
Ejemplo n.º 17
0
 public void showMyResultButtonClick()
 {
     WebDriverExtensions.FindElement(driver, showMyResultButton, 120).Click();
 }
Ejemplo n.º 18
0
 public void travelTabClick()
 {
     WebDriverExtensions.FindElement(driver, travelTab, 120).Click();
 }