Package org.xwiki.test.ui.po.editor
Class ObjectEditPane
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.test.ui.po.FormContainerElement
-
- org.xwiki.test.ui.po.editor.ObjectEditPane
-
public class ObjectEditPane extends FormContainerElement
Represents a group of form fields that are used to edit an object of a specific type.- Since:
- 5.1RC1
- Version:
- $Id: 35275b61f64959345055e5734efd853f23a53f4f $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.xwiki.test.ui.po.FormContainerElement
FormContainerElement.SelectElement
-
-
Constructor Summary
Constructors Constructor Description ObjectEditPane(org.openqa.selenium.By containerLocator, String className, int objectNumber)
Creates a new edit pane for an object of the specified type.ObjectEditPane(org.openqa.selenium.WebElement container, String className, int objectNumber)
Creates a new edit pane for an object of the specified type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openqa.selenium.By
byPropertyName(String propertyName)
Creates a locator for the input fields corresponding to the given object property.void
displayObject()
Click on the xobject div to expand it, and waits until the information are loaded and displayed.int
getObjectNumber()
SuggestInputElement
getSuggestInput(String userPropertyName)
boolean
isDeleteLinkDisplayed()
boolean
isEditLinkDisplayed()
boolean
isObjectDisplayed()
Checks if the information are loaded and displayed.BootstrapDateTimePicker
openDatePicker(String datePropertyName)
Opens the date picker for the specified date property of the edited object.ObjectEditPane
setPropertyValue(String propertyName, String propertyValue)
Helper to fill property values quickly.-
Methods inherited from class org.xwiki.test.ui.po.FormContainerElement
fillFieldsByElements, fillFieldsByName, getFieldValue, getFormAction, getFormElement, getSelectElement, hasField, setCheckBox, setCheckBox, setFieldValue, setFieldValue
-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Constructor Detail
-
ObjectEditPane
public ObjectEditPane(org.openqa.selenium.By containerLocator, String className, int objectNumber)
Creates a new edit pane for an object of the specified type. The form fields from the given container should correspond to properties of the specified type.- Parameters:
containerLocator
- the element that locates the form fields used to edit the objectclassName
- the object typeobjectNumber
- the object number (identifies the object in the set of objects of the same type)
-
ObjectEditPane
public ObjectEditPane(org.openqa.selenium.WebElement container, String className, int objectNumber)
Creates a new edit pane for an object of the specified type. The form fields from the given container should correspond to properties of the specified type.- Parameters:
container
- the element that wraps the form fields used to edit the objectclassName
- the object typeobjectNumber
- the object number (identifies the object in the set of objects of the same type)
-
-
Method Detail
-
isObjectDisplayed
@Unstable public boolean isObjectDisplayed()
Checks if the information are loaded and displayed.- Returns:
true
if the object information are displayed (i.e. the object is expanded)- Since:
- 13.1RC1
-
displayObject
@Unstable public void displayObject()
Click on the xobject div to expand it, and waits until the information are loaded and displayed. This method checks if the information are already displayed to avoid collapsing them if it's already the case.- Since:
- 13.1RC1
-
openDatePicker
public BootstrapDateTimePicker openDatePicker(String datePropertyName)
Opens the date picker for the specified date property of the edited object.- Parameters:
datePropertyName
- the name of a date property of the edited object- Returns:
- the date picker
-
getSuggestInput
public SuggestInputElement getSuggestInput(String userPropertyName)
- Parameters:
userPropertyName
- the name of a property- Returns:
- a
suggest input
for the given property
-
byPropertyName
public org.openqa.selenium.By byPropertyName(String propertyName)
Creates a locator for the input fields corresponding to the given object property.- Parameters:
propertyName
- the name of an object property- Returns:
- the locator for the input field corresponding to the specified property
-
setPropertyValue
public ObjectEditPane setPropertyValue(String propertyName, String propertyValue)
Helper to fill property values quickly.- Parameters:
propertyName
- the name of the property to setpropertyValue
- the value of the property- Returns:
- the current instance.
-
isDeleteLinkDisplayed
public boolean isDeleteLinkDisplayed()
- Returns:
true
if the delete link is displayed for this object.- Since:
- 12.4RC1
-
isEditLinkDisplayed
public boolean isEditLinkDisplayed()
- Returns:
true
if the edit link is displayed for this object.- Since:
- 12.4RC1
-
getObjectNumber
public int getObjectNumber()
- Returns:
- the current object number.
- Since:
- 12.4RC1
-
-