Beispiel #1
0
        /// <summary>
        /// Adds a page that is hidden, or not in the menu.
        /// </summary>
        /// <param name="pageName">The name of the page. </param>
        public void AddHiddenPage(string pageName)
        {
            AddPage(pageName);
            Thread.Sleep(2000);
            Span pageSpan = PageSpans.Filter(Find.ByText(s => s.Contains(pageName)))[0];

            // Fires the left click event
            pageSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            HidePageLink.Click();
        }
Beispiel #2
0
        /// <summary>
        /// Adds a child page to the site.
        /// The parent page of the child must already exist on the site.
        /// </summary>
        /// <param name="childName">The name for the child page.</param>
        /// <param name="parentName">The name of the parent page.</param>
        public void AddChildPage(string childName, string parentName)
        {
            Span homeSpan = PageSpans.Filter(Find.ByText(s => s.Contains(parentName)))[0];

            // Fires the left click event
            homeSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            AddPageLink.Click();
            BulkAddPageField.Value = childName;
            CreatePageLink.Click();
        }
Beispiel #3
0
        /// <summary>
        /// Gives a role permissions for a page that has already been created.
        /// </summary>
        /// <param name="setting">Grant, Deny, Unchecked</param>
        /// <param name="permission">The name of the Permission such as View, Edit, Add, Add Content etc.</param>
        /// <param name="pageName">The name of the page.</param>
        /// <param name="roleName">The name of the role.</param>
        public void SetPagePermissionForRole(string setting, string permission, string pageName, string roleName)
        {
            Span homeSpan = PageSpans.Filter(Find.ByText(s => s.Contains(pageName)))[0];

            // Fires the left click event
            homeSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            PageSettingsLink.Click();
            Thread.Sleep(1500);
            PageSettingsPage _pageSettings = new PageSettingsPage(this);

            _pageSettings.PermissionsTabLink.Click();
            _pageSettings.SetPermissionForRole(setting, permission, roleName);
            _pageSettings.UpdatePageLink.Click();
            Thread.Sleep(1500);
        }
Beispiel #4
0
        /// <summary>
        /// Gives a user edit permissions for a page that has already been created.
        /// </summary>
        /// <param name="pageName">The name of the page that the user will get edit permissions for.</param>
        /// <param name="userName">The name of the user that will be given edit permissions.</param>
        /// <param name="displayName">The display name of the user.</param>
        public void EditPageGiveUserEditPermissions(string pageName, string userName, string displayName)
        {
            Span homeSpan = PageSpans.Filter(Find.ByText(s => s.Contains(pageName)))[0];

            // Fires the left click event
            homeSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            PageSettingsLink.Click();
            Thread.Sleep(1500);
            PageSettingsPage _pageSettings = new PageSettingsPage(this);

            _pageSettings.PermissionsTabLink.Click();
            Thread.Sleep(1500);
            _pageSettings.GiveUserEditPermissionsForPage(userName, displayName);
            Thread.Sleep(1500);
            _pageSettings.UpdatePageLink.Click();
            Thread.Sleep(1500);
        }
Beispiel #5
0
        /// <summary>
        /// Adds a page using the Pages bulk add page field.
        /// Sets the template for the page to the template specified
        /// </summary>
        /// <param name="pageName">The name of the page.</param>
        /// <param name="template">The name of the template.</param>
        public void AddPageSelectTemplate(string pageName, string template)
        {
            AddPage(pageName);
            Thread.Sleep(2500);
            Span pageSpan = PageSpans.Filter(Find.ByText(s => s.Contains(pageName)))[0];

            // Fires the left click event
            pageSpan.FireEvent("oncontextmenu");
            Thread.Sleep(1000);
            PageSettingsLink.Click();
            Thread.Sleep(1500);
            PageSettingsPage _pageSettings = new PageSettingsPage(this);

            _pageSettings.TemplateFolderSelectList.Select(template);
            Thread.Sleep(1500);
            _pageSettings.UpdateLink.Click();
            Thread.Sleep(1500);
        }