Package org.xwiki.test.ui.po
Class CommentForm
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.test.ui.po.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 Summary
Constructors Constructor Description CommentForm(org.openqa.selenium.By containerLocator)Creates a new form instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToContentField(String content)Add some content to the content field.voidclearAndSetContentField(String content)Replace the current content of the content field with the provided content.voidclickBack()Clicks on the back button to cancel the preview and show the content text areavoidclickCancel()Clicks on the cancel button.org.openqa.selenium.WebElementclickPreview()Clicks on the preview button and waits for the preview to be ready.voidclickSubmit()Clicks on the submit button and waits for the operation to take place.voidclickSubmit(boolean wait)Clicks on the submit button and optionally waits for the operation to take place.org.openqa.selenium.WebElementgetContentField()-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
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-trueto wait for the success notification,falseotherwise
-
clickCancel
public void clickCancel()
Clicks on the cancel button.
-
-