コード例 #1
0
        public void EditTagControlOfDynamicContentViaInlineEditing(string controlName, string tagName)
        {
            this.EditField(controlName);

            Manager.Current.Wait.For(this.WaitForEditButton, Manager.Current.Settings.ClientReadyTimeout);
            HtmlAnchor editButton = ActiveBrowser.Find.ByCustom <HtmlAnchor>(e => e.IsVisible() && e.CssClass.Equals("sfShowInlineEditDlgLnk"));

            editButton.Click();

            HtmlDiv workArea = ActiveBrowser.Find
                               .ByCustom <HtmlDiv>(w => w.IsVisible() && w.CssClass.Equals("k-widget k-multiselect k-header"))
                               .AssertIsPresent("Edit tags dialog");

            HtmlInputText tagsInput = workArea.Find.ByCssClass <HtmlInputText>("k-input").AssertIsPresent("tags input");

            tagsInput.Click();
            tagsInput.SimulateTextTyping(tagName);
            tagsInput.MouseClick();

            HtmlListItem tag2 = ActiveBrowser.WaitForElementWithCssClass("k-item k-state-focused")
                                .As <HtmlListItem>().AssertIsPresent("tag2");

            tag2.Click();
            BAT.Wrappers().Frontend().InlineEditing().DynamicTypes().SelectDoneButtongWhenEditingChoices();
        }
コード例 #2
0
        /// <summary>
        /// Navigate to previous year in fast navigation
        /// </summary>
        public void NavigatePreviousYearInCalendarSelector()
        {
            ActiveBrowser.RefreshDomTree();
            ActiveBrowser.WaitUntilReady();
            var previousYearButton = EM.Events.EventsFrontend.NavigatePreviousInFastNavigation;

            previousYearButton.AssertIsPresent("Previous year button");
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForElementWithCssClass("k-link k-nav-prev");
            previousYearButton.Click();
        }
コード例 #3
0
        /// <summary>
        /// Navigate to next year in fast navigation
        /// </summary>
        public void NavigateNextYearInCalendarSelector()
        {
            ActiveBrowser.RefreshDomTree();
            ActiveBrowser.WaitUntilReady();
            var nextYearButton = EM.Events.EventsFrontend.NavigateNextInFastNavigation;

            nextYearButton.AssertIsPresent("Next year button");
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForElementWithCssClass("^k-link k-nav-next");
            nextYearButton.Click();
        }
コード例 #4
0
        /// <summary>
        /// Verifies the tags titles on the frontend page.
        /// </summary>
        /// <param name="tagsTitles">The tags titles.</param>
        /// <returns>true or false depending on tags titles presence on frontend</returns>
        public bool IsTagsTitlesPresentOnTheFrontendPage(string[] tagsTitles)
        {
            ActiveBrowser.WaitForElementWithCssClass("sfPublicWrapper");
            HtmlDiv frontendPageMainDiv = BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent();

            for (int i = 0; i < tagsTitles.Length; i++)
            {
                HtmlAnchor tagsAnchor = frontendPageMainDiv.Find.ByExpression <HtmlAnchor>("tagname=a", "InnerText=" + tagsTitles[i]);
                if (tagsAnchor == null || !tagsAnchor.IsVisible())
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #5
0
        public void EditCategoryControlOfDynamicContentViaInlineEditing(string controlName, string categoryName)
        {
            this.EditField(controlName);

            HtmlAnchor editButton = ActiveBrowser.Find.ByCustom <HtmlAnchor>(e => e.IsVisible() && e.CssClass.Equals("sfShowInlineEditDlgLnk"));

            editButton.Click();

            HtmlUnorderedList allCats = ActiveBrowser.WaitForElementWithCssClass("k-group k-treeview-lines")
                                        .As <HtmlUnorderedList>()
                                        .AssertIsPresent("all categories");

            HtmlListItem listItem = allCats.Find.ByExpression <HtmlListItem>("InnerText=" + categoryName);

            var cats = listItem.Find.ByExpression <HtmlInputCheckBox>("tagname=input");

            cats.Click();
            BAT.Wrappers().Frontend().InlineEditing().DynamicTypes().SelectDoneButtongWhenEditingChoices();
        }
コード例 #6
0
        /// <summary>
        /// Edit content block
        /// </summary>
        public void EditContentBlock()
        {
            HtmlDiv cb = ActiveBrowser.Find.ByCustom <HtmlDiv>(x => x.CssClass.Contains("sfFieldEditable"))
                         .AssertIsPresent("ContentBlock");

            cb.Focus();
            cb.MouseClick();

            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncJQueryRequests();
            ActiveBrowser.RefreshDomTree();
            cb.MouseClick();
            cb.InvokeClick();
            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();
            ActiveBrowser.WaitForAsyncJQueryRequests();
            ActiveBrowser.WaitForElementWithCssClass("k-editor-toolbar");

            Manager.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.LControlKey);
            Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.LControlKey);
            Manager.Desktop.KeyBoard.TypeText("edited content block", 20);
        }
コード例 #7
0
 /// <summary>
 /// Verifies the selected image overlay template.
 /// </summary>
 /// <param name="altText">The alt text.</param>
 public void VerifySelectedImageOverlayTemplate(string altText)
 {
     ActiveBrowser.WaitForElementWithCssClass("mfp-img");
     ActiveBrowser.Find.ByExpression <HtmlImage>("class=mfp-img", "alt=" + altText)
     .AssertIsPresent("Overlay image");
 }