Class CommentForm


  • public class CommentForm
    extends BaseElement
    Represents the form used to add, edit or reply to a comment.
    Since:
    4.0M1
    Version:
    $Id: ae72232d94494021383fbcd4925c11cc1880eb68 $
    • Constructor Detail

      • CommentForm

        public CommentForm​(org.openqa.selenium.By containerLocator)
        Creates a new form instance.
        Parameters:
        containerLocator - the locator to the form
    • Method Detail

      • getContentField

        public org.openqa.selenium.WebElement getContentField()
        Returns:
        the field used to input the comment content
      • clearAndSetContentField

        public void clearAndSetContentField​(String content)
        Replace the current content of the content field with the provided content.
        Parameters:
        content - the content
      • addToContentField

        public void addToContentField​(String content)
        Add some content to the content field.
        Parameters:
        content - the added content
      • clickPreview

        public org.openqa.selenium.WebElement clickPreview()
        Clicks on the preview button and waits for the preview to be ready.
        Returns:
        the element that wraps the content preview
      • clickBack

        public void clickBack()
        Clicks on the back button to cancel the preview and show the content text area
      • clickSubmit

        public void clickSubmit()
        Clicks on the submit button and waits for the operation to take place. The effect depends on the actual form. It could add a new comment, a reply to an existing comment or update an existing comment.
      • clickSubmit

        public void clickSubmit​(boolean wait)
        Clicks on the submit button and optionally waits for the operation to take place. The effect depends on the actual form. It could add a new comment, a reply to an existing comment or update an existing comment.

        Note: Use this method when JavaScript is disabled and the submit is not done asynchronously.

        Parameters:
        wait - true to wait for the success notification, false otherwise
      • clickCancel

        public void clickCancel()
        Clicks on the cancel button.