示例#1
0
        public static void DeletePermissions()
        {
            GridHelper.GridId = "entityRolesDetailsGrid";
            IList <IWebElement> tableRows = GridHelper.GetGridRows();

            var rows = tableRows.Count;

            for (int i = 0; i < rows; i++)
            {
                var rowBtns = tableRows[0].FindElements(By.TagName("a"));
                rowBtns[1].Click();

                WaitHelper.Wait.Timeout = TimeSpan.FromSeconds(3);
                var dialog = WaitHelper.WaitToConfrimWindow();
                WaitHelper.Wait.Timeout = TimeSpan.FromSeconds(10);

                var btnOk = dialog.FindElement(By.XPath("//button[contains(text(),'אישור')]"));

                btnOk.Click();
                Thread.Sleep(500);

                tableRows = GridHelper.GetGridRows();
            }

            if (tableRows.Count > 0)
            {
                Assert.Fail("Fail to DeleteRols for Entity : " + GridHelper.RowId);
            }
        }
示例#2
0
        public static void SetReporsForRole()
        {
            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();

                        WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(By.ClassName("close-button")));
                        Thread.Sleep(500);
                        var window = SeleniumDriver.driver.FindElement(By.XPath("/html/body/div[4]"));

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

                        GridHelper.GridId = "entityRolesDetailsGrid_ReportsWindow_reportsGrid";

                        tableRows           = GridHelper.GetGridRows();
                        PermissionsToReport = tableRows[0].Text;

                        var input = tableRows[0].FindElement(By.TagName("input"));
                        input.Click();

                        var saveBtn = window.FindElement(By.ClassName(" k-grid-save-changes"));
                        saveBtn.Click();

                        WaitHelper.WaitToDialogWindow();
                        SeleniumDriver.driver.FindElement(By.XPath("//button")).Click();
                        Thread.Sleep(500);

                        WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(By.ClassName("close-button")));
                        var closeBtn = window.FindElement(By.ClassName("close-button"));
                        closeBtn.Click();
                        Thread.Sleep(500);
                    }
                }
                catch (Exception)
                {
                    continue;
                }
            }
        }
示例#3
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;
                }
            }
        }