예제 #1
0
 public static void DeleteEntity()
 {
     GridHelper.ActiveTab = 1;
     GridHelper.GoToActiveTab();
     GridHelper.GridId = "entitiesGrid";
     GridHelper.RowId  = "test";
     GridHelper.BtnClick("Delete");
     GridHelper.ConfrimButtonClick(true);
     Thread.Sleep(500);
     if (GridHelper.IsRowExists())
     {
         Assert.Fail("DeleteRow Fail");
     }
 }
예제 #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");
            }
        }
예제 #3
0
        public static void DownloadEmptyTempletAndUpdate()
        {
            WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(By.ClassName("xms-reports-filter-period-type")));
            var container = SeleniumDriver.driver.FindElements(By.ClassName("cards-container"));

            var buttonadmin = container[0].FindElements(By.ClassName("card-button-admin"));
            var cardcontent = container[0].FindElement(By.ClassName("card-content"));
            var cardname    = "d" + container[0].FindElement(By.ClassName("card-name")).Text;
            var cardbuttons = cardcontent.FindElements(By.ClassName("btn-group"));
            var dropdown    = cardbuttons[1].FindElement(By.ClassName("dropdown-toggle"));

            dropdown.Click();

            var dropdownmenu = cardbuttons[1].FindElement(By.ClassName("dropdown-menu"));

            var emptyTemplete = dropdownmenu.FindElements(By.XPath("//*[contains(text(), 'תבנית ריקה')]"));

            emptyTemplete[0].Click();
            Thread.Sleep(3000);
            WaitHelper.Wait.Until(ExpectedConditions.InvisibilityOfElementLocated(By.ClassName("loading-message")));
            if (!CheckFileDownloaded(cardname))
            {
                Assert.Fail("Fail to Download Empty Templet");
            }

            buttonadmin[0].Click();

            WaitHelper.Wait.Until(ExpectedConditions.ElementIsVisible(By.Id("report-admin-modal")));

            AdminPageHelper.SwitchToIframeInContainerId("report-admin-modal");

            GridHelper.GridId = "templatesGrid";
            GridHelper.CreateNewClick();

            WaitHelper.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("/html/body/div[5]")));
            var windowNewTemplete = SeleniumDriver.driver.FindElement(By.XPath("/html/body/div[5]"));

            var description = windowNewTemplete.FindElement(By.Id("Description"));

            description.SendKeys("test");
            string path = Environment.GetEnvironmentVariable("USERPROFILE") + "\\Downloads\\" + cardname + ".xlsm";

            windowNewTemplete.FindElement(By.Id("templateUpload")).SendKeys(path);

            var updatebtn = windowNewTemplete.FindElement(By.ClassName("k-grid-update"));

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

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

            btnOk.Click();
            GridHelper.RowId = "test";
            if (!GridHelper.IsRowExists(true))
            {
                Assert.Fail("EmptyTemplet and not updated");
            }

            AdminPageHelper.SwitchToMainPage();
            SeleniumDriver.driver.Navigate().Refresh();
        }