Beispiel #1
0
 /// <summary>
 /// Creates a child page. All other settings will have the default value.
 /// Will not work unless the test is already on the Add Page form.
 /// This method can be used to make grandchild pages by entering the parent exactly as it would appear in the page drop down.
 /// Ex. "...Test Page"
 /// </summary>
 /// <param name="childName">The name of the child page that will be created.</param>
 /// <param name="parentName">The name of the child's parent. The parent page must already exist. </param>
 public void AddChildPage(string childName, string parentName)
 {
     PageNameField.Value = childName;
     ParentPageSelectList.Select(parentName);
     AddPageLink.ClickNoWait();
     System.Threading.Thread.Sleep(3000);
 }
Beispiel #2
0
 /// <summary>
 /// Creates a page that is not included in the menu, with the default for all other settings.
 /// Will not work unless the test is already on the Add page form.
 /// </summary>
 /// <param name="pageName">The name of the page.</param>
 public void AddHiddenPage(string pageName)
 {
     PageNameField.Value           = pageName;
     IncludeInMenuCheckbox.Checked = false;
     AddPageLink.ClickNoWait();
     System.Threading.Thread.Sleep(3000);
 }
Beispiel #3
0
 /// <summary>
 /// Creates a page that is inserted after another page. All other settings will have the default value.
 /// Will not work unless the test is already on the Add page form.
 /// </summary>
 /// <param name="pageName">The name of the page.</param>
 /// <param name="afterPage">The name of the page that the new page will be inserted afer.</param>
 public void AddPageAfter(string pageName, string afterPage)
 {
     PageNameField.Value            = pageName;
     InsertAfterRadioButton.Checked = true;
     InsertPageSelectList.Select(afterPage);
     AddPageLink.ClickNoWait();
     System.Threading.Thread.Sleep(3000);
 }
Beispiel #4
0
 /// <summary>
 /// Creates a page and gives a user view permissions for the page.
 /// Will not work unless the test is already on the Add Page form.
 /// </summary>
 /// <param name="pageName">The name of the page.</param>
 /// <param name="userName">The username of the user.</param>
 public void AddPageGiveUserViewPermission(string pageName, string userName)
 {
     PageNameField.Value       = pageName;
     UserPermissionField.Value = userName;
     AddUserPermissionLink.ClickNoWait();
     System.Threading.Thread.Sleep(1000);
     AddPageLink.ClickNoWait();
     System.Threading.Thread.Sleep(1500);
 }
Beispiel #5
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 #6
0
 /// <summary>
 /// Creates a page using a specific template and gies a user view permissions for the page.
 /// Will not work unless the test is already on the Add Page form.
 /// </summary>
 /// <param name="pageName">The name of the page.</param>
 /// <param name="userName">The username of the user.</param>
 /// <param name="templateName">The name of the template.</param>
 public void AddPageGiveUserViewPermissionSelectTemplate(string pageName, string userName, string templateName)
 {
     PageNameField.Value = pageName;
     PageTemplateSelect.Select(templateName);
     System.Threading.Thread.Sleep(1000);
     PermissionsTabLink.Click();
     UserPermissionField.Value = userName;
     AddUserPermissionLink.Click();
     System.Threading.Thread.Sleep(1000);
     AddPageLink.Click();
     System.Threading.Thread.Sleep(3000);
 }
Beispiel #7
0
 /// <summary>
 /// Creates a page using a specific template. All other settings will have the default value.
 /// Will not work unless the test is already on the Add Page form.
 /// </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)
 {
     PageNameField.Value = pageName;
     if (TemplateFolderSelectList.Option("Templates/").Exists)
     {
         TemplateFolderSelectList.Select("Templates/");
     }
     else
     {
         TemplateFolderSelectList.Select("Root");
     }
     PageTemplateSelect.Select(template);
     AddPageLink.ClickNoWait();
     System.Threading.Thread.Sleep(1000);
 }
Beispiel #8
0
 /// <summary>
 /// Creates a page using a specific template and gives All Users view permissions for the page. All other settings will have the default value.
 /// Will not work unless the test is already on the Add Page form.
 /// </summary>
 /// <param name="pageName">The name of the page.</param>
 /// <param name="template">The name of the template.</param>
 public void AddPageSelectTemplateAllUsersView(string pageName, string template)
 {
     PageNameField.Value = pageName;
     if (TemplateFolderSelectList.Option("Templates/").Exists)
     {
         TemplateFolderSelectList.Select("Templates/");
     }
     else
     {
         TemplateFolderSelectList.Select("Root");
     }
     PageTemplateSelect.Select(template);
     SetPermissionForRole("Grant", "View", "All Users");
     AddPageLink.ClickNoWait();
     System.Threading.Thread.Sleep(1500);
 }
Beispiel #9
0
 /// <summary>
 /// Creates a page with the default settings.
 /// Fills in the page name field and clicks the add page link.
 /// Will not work unless the test is already on the Add page form.
 /// </summary>
 /// <param name="pageName">The name of the page.</param>
 public void AddPage(string pageName)
 {
     PageNameField.Value = pageName;
     AddPageLink.ClickNoWait();
     System.Threading.Thread.Sleep(3000);
 }