Example #1
0
        public static void ChackTaxonomyList()
        {
            GridHelper.GridId = "entityRolesDetailsGrid";
            var tableRows = GridHelper.GetGridRows();

            foreach (var row in tableRows)
            {
                var rowBtns = row.FindElements(By.TagName("a"));

                try
                {
                    if (row.Text.Contains("דוחות"))
                    {
                        var reportsBtn = rowBtns[2];

                        reportsBtn.Click();
                        Thread.Sleep(500);
                        WaitHelper.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("/html/body/div[4]")));
                        var window = SeleniumDriver.driver.FindElement(By.XPath("/html/body/div[4]"));

                        var taxnomyDropDown = SeleniumDriver.driver.FindElement(By.ClassName("k-dropdown"));
                        taxnomyDropDown.Click();

                        Thread.Sleep(500);

                        IList <IWebElement> containers = GridHelper.DropDownGetContainers();

                        IList <IWebElement> optionslist = containers[containers.Count - 1].FindElements(By.TagName("li"));

                        foreach (var item in optionslist)
                        {
                            if (!TaxonomyList.Contains(item.Text))
                            {
                                Assert.Fail("Permissions Type drop down missing type : " + item.Text);
                            }
                        }

                        WaitHelper.Wait.Until(ExpectedConditions.ElementIsVisible(By.ClassName("close-button")));
                        var closeBtn = window.FindElement(By.ClassName("close-button"));
                        closeBtn.Click();
                        Thread.Sleep(500);
                    }
                }
                catch (Exception)
                {
                    continue;
                }
            }
        }
Example #2
0
        public static void AddEntity(int role)
        {
            GridHelper.CreateNewClick();

            WaitHelper.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("/html/body/div[7]")));

            var popupWindow = SeleniumDriver.driver.FindElement(By.XPath("/html/body/div[7]"));

            Thread.Sleep(500);

            var dropdown = popupWindow.FindElement(By.ClassName("xms-role-type"));

            var buttonsdiv = popupWindow.FindElement(By.ClassName("k-edit-buttons"));

            var buttons = buttonsdiv.FindElements(By.TagName("a"));

            dropdown.Click();

            Thread.Sleep(500);

            IList <IWebElement> containers = GridHelper.DropDownGetContainers();

            IList <IWebElement> optionslist = containers[containers.Count - 1].FindElements(By.TagName("li"));

            if (Roles == null)
            {
                Roles = new List <string>();
                Roles.AddRange(optionslist.Select(x => x.Text));
                ChackDropDownRols();
            }

            IWebElement option = optionslist[role];

            WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(option));

            GridHelper.RowId = option.Text;

            option.Click();

            buttons[0].Click();

            Thread.Sleep(500);

            if (!GridHelper.IsRowExists(false))
            {
                Assert.Fail("AddRow to Permissions table failed");
            }
        }