Package com.znize.platform.test.api
Interface EntityBean
-
- All Superinterfaces:
Bean,Component,PersistenceDataBean
public interface EntityBean extends PersistenceDataBean
EntityBean represents an EntityBackingBean on UI.- Since:
- 5.12
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEntityBean.OrderByOrder by for query.-
Nested classes/interfaces inherited from interface com.znize.platform.test.api.PersistenceDataBean
PersistenceDataBean.LayoutType
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_CHOICEchoice property name
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EntityBeanapplyChange(boolean hidden)Save changes by clicking "ApplyChange" menu node.default voidassertContains(java.lang.String property, java.lang.String text)Assert that the property value contains the specified text.default voidassertEquals(java.lang.String property, java.lang.Comparable expectedValue)Assert that the property value is the expected value.default voidassertEquals(java.lang.String property, java.lang.Number expectedValue, java.text.NumberFormat numberFormat)Assert that the property value is the expected value.default voidassertEqualsAnother(java.lang.String property1, java.lang.String property2)Assert that one property value is equal to another property value.default voidassertMatches(java.lang.String property, java.lang.String regularExpression)Assert that the property value matches the regular expression.default voidassertNotNull(java.lang.String property)Assert that the property value is not null (not empty string)default voidassertNull(java.lang.String property)Assert that the property value is null (empty string)default voidassertPropertyFound(java.lang.String property)Assert that the property is found in this bean.default voidassertPropertyNotFound(java.lang.String property)Assert that the property is not found in this bean.default voidassertPropertyValue(EntityListBean.PropertyValueCriterion propertyValueCriterion)Assert property value by the criterion.default voidbatchPrint(int expectedPages, int expectedEntities)Batch print: click printView if this bean is a batch print query form bean.voidbatchPrint(int expectedPages, int expectedEntities, boolean openPrintDialog)Batch print: click printView if this bean is a batch print query form bean.EntityBeancancelChange(boolean hidden)Cancel changes by clicking "CancelChange" menu node.default EntityBeancreate(boolean hidden)Create entity by click "Create" menu node.EntityBeancreate(boolean expectedSuccess, boolean hidden, ParameterizedMessage errorMessage, boolean wait)Create entity by click "Create" menu node.EntityBeancreateAndContinue()Create entity and then show a new EntityBean for creating a new entity.default EntityBeancreateChildHierarchy()Create child hierarchy entity if this bean is a Hierarchy entity bean.EntityBeancreateOrUpdateFormDesignFooter(boolean showBarcode, java.lang.String footerContent)Create or update the formDesign footer for the entityType of this EntityBean and current user locale.voiddelete(boolean confirmAlert, boolean showSuccessMessage, java.lang.String entityTypeAndName)Delete entity by clicking "Delete" menu node.voiddelete(java.lang.String entityType, java.lang.String entityName)Delete entity by clicking "Delete" menu node.EntityBeanedit()Make this bean in editing mode by clicking "Edit" menu node.default EntityPropertygetAttributeProperty(java.lang.String attrName, boolean errorIfNotFound)Get the attribute property (user-defined property) with the name.default EntityPropertygetChoiceProperty(boolean errorIfNotFound)Get the choice property for EntityChoiceSupportBean.default EntityPropertygetEntityCaptchaProperty(boolean errorIfNotFound)Get the captcha property.java.util.List<java.lang.String>getEntityProperties()Get the list of entity properties.default EntityPropertygetEntityProperty(java.lang.String name)Get the property with the name.EntityPropertygetEntityProperty(java.lang.String name, boolean errorIfNotFound)Get the property with the name.default PersistenceDataBeangetFormBean(java.lang.String formBeanProperty)Get enclosed form bean.PersistenceDataBeangetFormBean(java.lang.String formBeanProperty, boolean errorIfNotFound)Get enclosed form bean.PayUtilgetPayUtil()Get payment util for payment processing.TabViewgetPropertyTabView()Get property tab view.default voidgoBackToListView()Go back to the entity list view from which this bean is navigated from.default voidgroupBy(java.lang.String... properties)Group by the properties for query bean.booleanisCreating()Is this entity bean creating an entity?booleanisLogin()Is this bean a login bean?default voidorderBy(EntityBean.OrderBy... orderByList)Order by for query bean.default voidprint()Print this bean.voidprint(boolean openPrintDialog)Print this bean.default EntityListBeansearch()Search for query bean.default voidselectAsValueOf(EntityProperty entityProperty)Select the entity of this EntityBean as the value of the property.EntityBeanselectFormDesign(java.lang.String formId)Select form design.EntityBeanselectFormDesign(java.lang.String formId, java.lang.StringBuffer currentFormIdBuffer)Select form design.default voidsetPageSizeForQueryResults(int pageSize)Set the pageSize of the query results if this bean is a query bean.EntityPropertywaitUntilPropertyVisible(java.lang.String propertyName)Wait until the property becomes visible.default EntityBeanwaitUntilStale(boolean refresh)Wait until this component is detached from page.-
Methods inherited from interface com.znize.platform.test.api.Bean
getContainerBean, getTitle, speakTitle
-
Methods inherited from interface com.znize.platform.test.api.Component
getAncestorCount, getClosestAncestor, getCurrencyNumberFormat, getCurrencyNumberFormat, getDateTimeFormatter, getDisplayValue, getDriver, getElementText, getLocale, getNumberFormat, getParent, getPercentNumberFormat, getResourceBundle, getRoot, getString, getString, getTextToSpeech, getTextToSpeech, getTimeZone, highlight, highlight, isOverlapped, isStale, isVisible, newAnnotation, refresh, waitUntilAbsent, waitUntilClickable, waitUntilInvisible, waitUntilPresent, waitUntilStale, waitUntilVisible
-
Methods inherited from interface com.znize.platform.test.api.PersistenceDataBean
changeLayoutType, getFooterMenu, getFooterMenu, getHeaderMenu, getHeaderMenu, getLayoutType, getPropertyVisibleName, toggleFeature
-
-
-
-
Field Detail
-
PROPERTY_CHOICE
static final java.lang.String PROPERTY_CHOICE
choice property name- Since:
- 5.14
- See Also:
- Constant Field Values
-
-
Method Detail
-
isCreating
boolean isCreating()
Is this entity bean creating an entity?- Returns:
- true for creating entity, false otherwise
- Since:
- 5.13
-
getFormBean
default PersistenceDataBean getFormBean(java.lang.String formBeanProperty)
Get enclosed form bean.- Parameters:
formBeanProperty- formBean property name- Returns:
- PersistenceDataBean instance
- Throws:
java.lang.IllegalArgumentException- throw if the formBean is not found
-
getFormBean
PersistenceDataBean getFormBean(java.lang.String formBeanProperty, boolean errorIfNotFound)
Get enclosed form bean.- Parameters:
formBeanProperty- formBean property nameerrorIfNotFound- whether to throw exception if the formBean is not found- Returns:
- PersistenceDataBean instance. return null if errorIfNotFound is false and the formBean is not found
- Throws:
java.lang.IllegalArgumentException- throw if errorIfNotFound is true and the formBean is not found- Since:
- 5.14
-
getEntityProperty
default EntityProperty getEntityProperty(java.lang.String name)
Get the property with the name.- Parameters:
name- property name- Returns:
- EntityProperty instance
- Throws:
java.lang.IllegalArgumentException- throw if the property is not found
-
getEntityProperty
EntityProperty getEntityProperty(java.lang.String name, boolean errorIfNotFound)
Get the property with the name.- Parameters:
name- property name- Returns:
- EntityProperty instance. return null if errorIfNotFound is false and the property is not found.
- Throws:
java.lang.IllegalArgumentException- throw if errorIfNotFound is true and the property is not found- Since:
- 5.14
-
getChoiceProperty
default EntityProperty getChoiceProperty(boolean errorIfNotFound)
Get the choice property for EntityChoiceSupportBean.- Returns:
- choice EntityProperty. return null if errorIfNotFound is false and the property is not found.
- Throws:
java.lang.IllegalArgumentException- throw if errorIfNotFound is true and the property is not found- Since:
- 5.14
-
getEntityCaptchaProperty
default EntityProperty getEntityCaptchaProperty(boolean errorIfNotFound)
Get the captcha property.- Parameters:
errorIfNotFound- whether to throw exception if not found- Returns:
- EntityProperty instance. return null if errorIfNotFound is false and the property is not found
- Throws:
java.lang.IllegalArgumentException- throw if errorIfNotFound is true and the property is not found- Since:
- 5.13
-
getAttributeProperty
default EntityProperty getAttributeProperty(java.lang.String attrName, boolean errorIfNotFound)
Get the attribute property (user-defined property) with the name.- Parameters:
attrName- attribute nameerrorIfNotFound- whether to throw exception if not found- Returns:
- EntityProperty instance. return null if errorIfNotFound is false and the property is not found
- Throws:
java.lang.IllegalArgumentException- throw if errorIfNotFound is true and the property is not found- Since:
- 5.17
-
isLogin
boolean isLogin()
Is this bean a login bean?- Returns:
- true for login bean, false otherwise
-
waitUntilPropertyVisible
EntityProperty waitUntilPropertyVisible(java.lang.String propertyName)
Wait until the property becomes visible. Refresh this bean if it is stale.- Parameters:
propertyName- property name- Returns:
- the visible property
-
waitUntilStale
default EntityBean waitUntilStale(boolean refresh)
Description copied from interface:ComponentWait until this component is detached from page.- Specified by:
waitUntilStalein interfaceComponent- Parameters:
refresh- whether to refresh and attach this component to page after detached- Returns:
- this component itself
-
create
default EntityBean create(boolean hidden)
Create entity by click "Create" menu node.- Parameters:
hidden- whether this bean is hidden after entity is created. If hidden, this bean will not be usable.- Returns:
- the created EntityBean in view mode
-
create
EntityBean create(boolean expectedSuccess, boolean hidden, ParameterizedMessage errorMessage, boolean wait)
Create entity by click "Create" menu node.- Parameters:
expectedSuccess- expected success or failurehidden- whether this bean is hidden after entity is successfully created. If hidden, this bean will not be usable.errorMessage- the error message for expected failure (expectedSuccess is false)wait- whether to wait for condition staleness(hidden=false) or absence(hidden=true). If false, a waitUntil should be called after this method.- Returns:
- the created EntityBean in view mode
- Since:
- 5.20
-
createAndContinue
EntityBean createAndContinue()
Create entity and then show a new EntityBean for creating a new entity.- Returns:
- an EntityBean in creating entity mode
- Since:
- 5.13
-
createChildHierarchy
default EntityBean createChildHierarchy()
Create child hierarchy entity if this bean is a Hierarchy entity bean.- Returns:
- the entity bean for creating child hierarchy
- Since:
- 5.17
-
applyChange
EntityBean applyChange(boolean hidden)
Save changes by clicking "ApplyChange" menu node.- Parameters:
hidden- whether this bean is hidden after entity is saved to persistence. If hidden, this bean will not be usable.- Returns:
- the saved EntityBean in view mode
-
cancelChange
EntityBean cancelChange(boolean hidden)
Cancel changes by clicking "CancelChange" menu node.- Parameters:
hidden- whether this bean is hidden after changes are cancelled If hidden, this bean will not be usable.- Returns:
- the EntityBean in view mode after changes are cancelled.
- Since:
- 5.13
-
edit
EntityBean edit()
Make this bean in editing mode by clicking "Edit" menu node.- Returns:
- this EntityBean in edit mode
-
delete
void delete(java.lang.String entityType, java.lang.String entityName)Delete entity by clicking "Delete" menu node. entityType/entityName as the parameter value of delete confirm alert message.- Parameters:
entityType- entity type (not localized)entityName- entity name (localized)
-
delete
void delete(boolean confirmAlert, boolean showSuccessMessage, java.lang.String entityTypeAndName)Delete entity by clicking "Delete" menu node.- Parameters:
confirmAlert- whether confirming deletion alert will be shownshowSuccessMessage- whether a successful message will be shown after deletionentityTypeAndName- the parameter value of confirm alert message and success message- Since:
- 5.20
-
goBackToListView
default void goBackToListView()
Go back to the entity list view from which this bean is navigated from.- Since:
- 5.17
-
selectAsValueOf
default void selectAsValueOf(EntityProperty entityProperty)
Select the entity of this EntityBean as the value of the property. This bean is shown in the input dialog of the property. This method will wait until the input dialog is closed.- Parameters:
entityProperty- an EntityProperty
-
selectFormDesign
EntityBean selectFormDesign(java.lang.String formId)
Select form design.- Parameters:
formId- the formId of the form design to be selected- Returns:
- refreshed EntityBean with the new form design
-
selectFormDesign
EntityBean selectFormDesign(java.lang.String formId, java.lang.StringBuffer currentFormIdBuffer)
Select form design.- Parameters:
formId- the formId of the form design to be selectedcurrentFormIdBuffer- if not null, return the formId of current formDesign before change- Returns:
- refreshed EntityBean with the new form design
- Since:
- 5.14
-
createOrUpdateFormDesignFooter
EntityBean createOrUpdateFormDesignFooter(boolean showBarcode, java.lang.String footerContent)
Create or update the formDesign footer for the entityType of this EntityBean and current user locale. After it is created/updated, new entity view will be verified.- Parameters:
showBarcode- whether to show barcodefooterContent- footer content HTML- Returns:
- refreshed entityBean with the new footer
- Since:
- 5.20
-
getPropertyTabView
TabView getPropertyTabView()
Get property tab view.- Returns:
- TabView instance
-
getEntityProperties
java.util.List<java.lang.String> getEntityProperties()
Get the list of entity properties.- Returns:
- property names
- Since:
- 5.14
-
print
void print(boolean openPrintDialog)
Print this bean. Show this bean in print view and optionally open platform print dialog.- Parameters:
openPrintDialog- whether to open platform print dialog- Since:
- 5.14
-
print
default void print()
Print this bean. Whether to open platform print dialog can be configured in test.properties, default is false.- Since:
- 5.16
- See Also:
Configurations.isPrintViewOpenPrintDialog()
-
batchPrint
void batchPrint(int expectedPages, int expectedEntities, boolean openPrintDialog)Batch print: click printView if this bean is a batch print query form bean.- Parameters:
expectedPages- expected total number of pages to printexpectedEntities- expected total number of entities to printopenPrintDialog- whether to open platform print dialog- Since:
- 5.16
-
batchPrint
default void batchPrint(int expectedPages, int expectedEntities)Batch print: click printView if this bean is a batch print query form bean. Whether to open platform print dialog can be configured in test.properties, default is false.- Parameters:
expectedPages- expected total number of pages to printexpectedEntities- expected total number of entities to print- Since:
- 5.16
- See Also:
Configurations.isPrintViewOpenPrintDialog()
-
getPayUtil
PayUtil getPayUtil()
Get payment util for payment processing.- Returns:
- PayUtil instance
- Since:
- 5.13
-
assertPropertyValue
default void assertPropertyValue(EntityListBean.PropertyValueCriterion propertyValueCriterion)
Assert property value by the criterion.- Since:
- 5.20
-
assertEquals
default void assertEquals(java.lang.String property, java.lang.Comparable expectedValue)Assert that the property value is the expected value.- Parameters:
property- property nameexpectedValue- expected property value- Since:
- 5.16
-
assertMatches
default void assertMatches(java.lang.String property, java.lang.String regularExpression)Assert that the property value matches the regular expression.- Parameters:
property- property nameregularExpression- the regular expression to match property value- Since:
- 5.16
-
assertContains
default void assertContains(java.lang.String property, java.lang.String text)Assert that the property value contains the specified text.- Parameters:
property- property name- Since:
- 5.16
-
assertEquals
default void assertEquals(java.lang.String property, java.lang.Number expectedValue, java.text.NumberFormat numberFormat)Assert that the property value is the expected value.- Parameters:
property- property nameexpectedValue- expected property valuenumberFormat- the NumberFormat to format property value as string for comparison- Since:
- 5.16
-
assertEqualsAnother
default void assertEqualsAnother(java.lang.String property1, java.lang.String property2)Assert that one property value is equal to another property value.- Parameters:
property1- property nameproperty2- the other property name to compare value with- Since:
- 5.16
-
assertPropertyNotFound
default void assertPropertyNotFound(java.lang.String property)
Assert that the property is not found in this bean.- Parameters:
property- property name- Since:
- 5.16
-
assertPropertyFound
default void assertPropertyFound(java.lang.String property)
Assert that the property is found in this bean.- Parameters:
property- property name- Since:
- 5.16
-
assertNotNull
default void assertNotNull(java.lang.String property)
Assert that the property value is not null (not empty string)- Parameters:
property- property name- Since:
- 5.16
-
assertNull
default void assertNull(java.lang.String property)
Assert that the property value is null (empty string)- Parameters:
property- property name- Since:
- 5.16
-
groupBy
default void groupBy(java.lang.String... properties)
Group by the properties for query bean.- Parameters:
properties- a list of property names (can be name path)- Since:
- 5.20
-
orderBy
default void orderBy(EntityBean.OrderBy... orderByList)
Order by for query bean.- Parameters:
orderByList- a list of orderBy(s)- Since:
- 5.20
-
setPageSizeForQueryResults
default void setPageSizeForQueryResults(int pageSize)
Set the pageSize of the query results if this bean is a query bean.- Since:
- 5.20
-
search
default EntityListBean search()
Search for query bean.- Returns:
- entity list bean as query results.
- Since:
- 5.20
-
-