/// <summary> /// Adds a module to the current page from the ribbon bar. /// </summary> /// <param name="moduleName">The title for the module.</param> /// <param name="moduleType">The type of module to add.</param> /// <param name="moduleCategory">The category the module is in.</param> public void AddModuleToPage(string moduleName, string moduleType, string moduleCategory) { //Select the module category ModuleCategorySelectList.Select(moduleCategory); System.Threading.Thread.Sleep(1500); Element item = null; //Try finding the module element in the combo box item = GetItemFromTelerikComboBox(ModuleComboBoxLink, ModuleSelectDiv, "rcbItem ", moduleType); if (item == null) { //The module element wasn't found //Try finding the module element using the class "rcbHovered " instead item = GetItemFromTelerikComboBox(ModuleComboBoxLink, ModuleSelectDiv, "rcbHovered ", moduleType); } //Select the module type item.FireEvent("onmouseover"); System.Threading.Thread.Sleep(1000); item.ClickNoWait(); if (!moduleName.Equals("")) { //Enter a title for the module ModuleTitleField.Value = moduleName; } System.Threading.Thread.Sleep(2000); //Click the add module button AddModuleButton.ClickNoWait(); }
/// <summary> /// Adds an existing module to the current page from the ribbon bar. /// </summary> /// <param name="pageName">The name of the page that contains the existing module.</param> /// <param name="moduleName">The name of the existing module.</param> /// <param name="moduleListItemClass">The class to filter all of the items within the existing module drop down by. /// The currently selected item will have the class "rcbHovered ", all others will have the class "rcbItem ".</param> public void AddExistingModuleToPage(string pageName, string moduleName, string moduleListItemClass) { AddExistingModuleRadioButton.ClickNoWait(); AddExistingModulePageSelectList.Select(pageName); System.Threading.Thread.Sleep(2000); Element item = GetItemFromTelerikComboBox(AddExistingModuleComboBoxLink, ExistingModuleSelectDiv, moduleListItemClass, moduleName); item.FireEvent("onmouseover"); item.Click(); System.Threading.Thread.Sleep(1000); AddModuleButton.ClickNoWait(); }
/// <summary> /// Adds an HTML module to the current page from the ribbon bar, with the visibility set and the position of the module set. /// </summary> /// <param name="moduleName">The title for the module.</param> /// <param name="moduleType">The type of module to add. Either HTML or HTML Pro.</param> /// <param name="visibility">The visibility for the module. Either "Same As Page" or "Page Editors Only".</param> /// <param name="modulePostion">The position the module should be inserted into. Either "Bottom" "Top" "Above" or "Below".</param> public void AddHTMLModuleToPage(string moduleName, string moduleType, string visibility, string modulePostion) { ModuleCategorySelectList.Select("All Categories"); System.Threading.Thread.Sleep(1500); Element item = null; //Class will be "rcbHovered ", instead of "rcbList " item = GetItemFromTelerikComboBox(ModuleComboBoxLink, ModuleSelectDiv, "rcbHovered ", moduleType); item.FireEvent("onmouseover"); item.ClickNoWait(); if (!moduleName.Equals("")) { ModuleTitleField.Value = moduleName; } System.Threading.Thread.Sleep(1000); ModulePositionSelectList.Select(modulePostion); AddModuleButton.ClickNoWait(); }