Esempio n. 1
0
        public TlxBasePage SelectMainMenu(string menuName)
        {
            TlxBasePage requiredPage = null;

            var currentExpandedMainTab = GetAllMainTabs().Single(mainTab => IsMainTabExpanded(mainTab));

            //var listOfMainMenu = currentExpandedMainTab.FindElements(By.TagName("li"));
            //var clickElement = listOfMainMenu.Single(menuElement => menuElement.Text.ToLower().Equals(menuName.ToLower()));
            //clickElement.Click();
            //WaitForLoader();

            //WaitForDGridLoader();
            switch (menuName.ToLower())
            {
            case "projects":
                currentExpandedMainTab.FindElement(By.Id("navTlxProjects")).Click();

                //WaitForLoader();
                WaitForDGridLoader();
                WaitForElementToBeVisible(By.CssSelector("div[id^='listGrid-row-']"), 15);
                requiredPage = new IcrmProjectsPage(myDriver);
                break;

            case "tasks":
                currentExpandedMainTab.FindElement(By.Id("navTlxProjectTasks")).Click();

                //WaitForLoader();
                WaitForDGridLoader();
                WaitForElementToBeVisible(By.CssSelector("div[id^='listGrid-row-']"), 15);
                requiredPage = new IcrmTaskPage(myDriver);
                break;

            case "timegrid":
                currentExpandedMainTab.FindElement(By.Id("navTLXTimeGrid")).Click();

                //WaitForLoader();
                myDriver.SwitchTo().Frame(myDriver.FindElement(By.Id("MainContent_frmTLXTimeGrid_frameTimeGrid")));

                WaitForElementToBeVisible(By.Id("ASPxPageControl2"), 15);
                //WaitForTimeGridLoader();
                myDriver.SwitchTo().DefaultContent();

                requiredPage = new IcrmTaskPage(myDriver);
                break;

            case "webcalendar":
                currentExpandedMainTab.FindElement(By.Id("navWebCalender")).Click();
                WaitForElementToBeVisible(By.ClassName("mainContentHeaderTable"));
                requiredPage = new TlxBasePage(myDriver);
                break;
            }

            return(requiredPage);
        }
Esempio n. 2
0
        public IcrmProjectsPage SearchProject(string searchBy, string searchOperator, string searchValue)
        {
            var searchConditions = new List <Tuple <LookUpSearchInput> >();

            searchConditions.Add(Tuple.Create(
                                     new LookUpSearchInput
            {
                SearchBy       = searchBy,
                SearchOperator = searchOperator,
                Value          = searchValue
            }));

            LookupSearchBy(searchConditions);

            var newProjectsPage = new IcrmProjectsPage(myDriver);

            return(newProjectsPage);
        }