Exemplo n.º 1
0
        public void AdminCanCreateGroup()
        {
            Thread.Sleep(500);

            // hover the context ... button
            var action = new Actions(_fixture.Driver);

            action.MoveToElement(_fixture.DataElement("tree-item-Approval groups", ".umb-options")).Click().Build().Perform();

            Thread.Sleep(5555555);
            _fixture.Logout(false);
        }
Exemplo n.º 2
0
        public void AdminCanCreateDeleteGroup()
        {
            _fixture.Login(ChromeDriverFixture.AdminUser, ChromeDriverFixture.AdminPassword);
            _driver.Url = ChromeDriverFixture.GroupsDashUrl;

            var    action    = new Actions(_fixture.Driver);
            string groupName = Utility.RandomString();

            action.MoveToElement(_fixture.DataElement("tree-item-Approval groups", ".umb-options")).Click().Build().Perform();

            _fixture.DataElement("action-add").Click();

            IWebElement input = _driver.FindElement(By.CssSelector("[data-element='workflow-overlay__groups-name']"));

            input.Clear();
            input.SendKeys(groupName);

            // create the group
            _driver.FindElement(By.CssSelector(".btn-toolbar [ng-click*='vm.add']")).Click();

            // route updates
            var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(10));

            wait.Until(ExpectedConditions.UrlContains("edit-group"));

            // expand the tree
            _fixture.DataElement("tree-item-Approval groups", "[data-element='tree-item-expand']").Click();

            // right click the group
            action.MoveToElement(_driver.FindElement(By.XPath($"//a[contains(text(), '{groupName}')]"))).ContextClick().Build().Perform();

            //// ok to delete
            //_fixture.DataElement("action-delete").Click();

            //// confirm delete
            //_driver.FindElement(By.CssSelector(".btn-toolbar [ng-click*='vm.delete']")).Click();
        }
Exemplo n.º 3
0
        public void UserTypeHasCorrectAccess(string user, string password, bool expected)
        {
            _fixture.Login(user, password);

            // check for workflow section in nav
            Exception ex = Record.Exception(() => _fixture.DataElement("section-workflow"));

            Assert.Equal(expected, ex == null);

            Thread.Sleep(500);

            // check for save and publish button
            _fixture.DataElement("section-content", "a").Click();
            _fixture.DataElement("tree-root", "~ ul li:first-child").Click();

            _fixture.Wait(".workflow-button-drawer");
            ex = Record.Exception(() => _driver.FindElement(By.CssSelector("[key='buttons_saveAndPublish']")));
            Assert.Equal(expected, ex == null);

            Thread.Sleep(500);

            // check for workflow config menu option
            _fixture.DataElement("section-content", "a").Click();

            // hover the context ... button
            var action = new Actions(_fixture.Driver);

            action.MoveToElement(_fixture.DataElement("tree-root", "~ ul li:first-child")).ContextClick().Build().Perform();

            Thread.Sleep(2500);

            ex = Record.Exception(() => _fixture.DataElement("action-workflowConfig"));
            Assert.Equal(expected, ex == null);

            // don't forget to logout...
            _fixture.Logout(!expected);
        }