Пример #1
0
        /// <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();
        }
Пример #2
0
        /// <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();
        }