示例#1
0
        /// <summary>
        /// Clicks on Widget menu item (only click is performed, no waiting)
        /// </summary>
        /// <param name="widgetName">The Widget Name</param>
        /// <param name="menuOption">The menu option</param>
        public void ClickOnFieldMenuItem(string widgetName, string menuOption)
        {
            HtmlDiv widget = GetWidgetByNameFromZoneEditor(widgetName);

            widget.ScrollToVisible();
            widget.Focus();
            HtmlAnchor moreLink = GetWidgetMoreLink(widget);

            moreLink.MouseClick();
            HtmlAnchor option = GetMoreMenuOption(menuOption);

            option.MouseClick();
        }
示例#2
0
        /// <summary>
        /// Type email.
        /// </summary>
        /// <param name="email">email.</param>
        public void TypeEmailAddress(string email)
        {
            HtmlDiv emailAddress = this.EM.CommentsAndReviews.CommentsFrontend.EmailField
                                   .AssertIsPresent("Email");

            emailAddress.ScrollToVisible();
            emailAddress.Focus();
            emailAddress.MouseClick();

            Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete);
            Manager.Current.Desktop.KeyBoard.TypeText(email);
        }
示例#3
0
        /// <summary>
        /// Type your name.
        /// </summary>
        /// <param name="yourName">Your name.</param>
        public void TypeYourName(string yourName)
        {
            HtmlDiv yourNameField = this.EM.CommentsAndReviews.CommentsFrontend.YourNameField
                                    .AssertIsPresent("Your name");

            yourNameField.ScrollToVisible();
            yourNameField.Focus();
            yourNameField.MouseClick();

            Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete);
            Manager.Current.Desktop.KeyBoard.TypeText(yourName);
        }
示例#4
0
        /// <summary>
        /// Remove the Paragraph Text Content in the Frontend of the form
        /// </summary>
        public void RemoveParagraphTextContent()
        {
            HtmlTextArea textbox = this.EM.Forms.FormsFrontend.ParagraphTextBox.AssertIsPresent("Text field");

            textbox.MouseClick();

            Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete);

            HtmlDiv label = this.EM.Forms.FormsFrontend.ParagraphTextField.AssertIsPresent("Paragraph field");

            label.Focus();
            label.MouseClick();
        }
示例#5
0
        /// <summary>
        /// Type a message.
        /// </summary>
        /// <param name="message">Message.</param>
        public void TypeAMessage(string message)
        {
            ActiveBrowser.RefreshDomTree();

            HtmlDiv editable = this.EM.CommentsAndReviews.CommentsFrontend.LeaveACommentArea
                               .AssertIsPresent("Leave area");

            editable.ScrollToVisible();
            editable.Focus();
            editable.MouseClick();

            Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete);
            Manager.Current.Desktop.KeyBoard.TypeText(message);
        }
        /// <summary>
        /// Fills the code in editable area.
        /// </summary>
        /// <param name="code">The code.</param>
        public void FillCodeInEditableArea(string code)
        {
            HtmlDiv editable = EM.ScriptsAndStyles.ScriptsAndStylesEditScreen
                               .CodeMirrorLines
                               .AssertIsPresent("Editable area");

            editable.ScrollToVisible();
            editable.Focus();
            editable.MouseClick();

            Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete);

            Manager.Current.Desktop.KeyBoard.TypeText(code);
        }
示例#7
0
 /// <summary>
 /// Selects media from media selector.
 /// </summary>
 /// <param name="title">The media title.</param>
 public void SelectMediaFile(string title, bool isDocumentFile = false)
 {
     if (isDocumentFile)
     {
         HtmlDiv doc = ActiveBrowser.Find.ByExpression <HtmlDiv>("tagName=div", "class=Media-item-title ng-binding", "innertext=" + title);
         doc.ScrollToVisible();
         doc.Focus();
         doc.MouseClick();
     }
     else
     {
         HtmlImage image = ActiveBrowser.Find.ByExpression <HtmlImage>("tagName=img", "alt=" + title);
         image.ScrollToVisible();
         image.Focus();
         image.MouseClick();
     }
 }
示例#8
0
        /// <summary>
        /// Remove the TextBox Content in the Frontend of the form
        /// </summary>
        public void RemoveTextboxContent()
        {
            HtmlInputText textbox = this.EM.Forms.FormsFrontend.TextField.AssertIsPresent("Text field");

            textbox.ScrollToVisible();
            textbox.Focus();
            textbox.MouseClick();

            Manager.Current.Desktop.KeyBoard.KeyDown(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.A);
            Manager.Current.Desktop.KeyBoard.KeyUp(System.Windows.Forms.Keys.Control);
            Manager.Current.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Delete);

            HtmlDiv label = this.EM.Forms.FormsFrontend.TextboxField.AssertIsPresent("Text field");

            label.Focus();
            label.MouseClick();
        }
示例#9
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();
            ActiveBrowser.RefreshDomTree();
            ActiveBrowser.WaitForAsyncJQueryRequests();
            ActiveBrowser.Find.ByCustom <HtmlUnorderedList>(e => e.CssClass.Contains("k-editor-toolbar") && e.IsVisible() == true)
            .AssertIsPresent("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);
        }