Class ModuleTestBase
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.openxava.tests.ModuleTestBase
-
- All Implemented Interfaces:
junit.framework.Test
public abstract class ModuleTestBase extends junit.framework.TestCaseBase class for creating a junit test that runs against an OpenXava module.Look at Automated testing with OpenXava.
- Author:
- Javier Paniza
-
-
Constructor Summary
Constructors Constructor Description ModuleTestBase(java.lang.String module)Constructor for JUnit 4 style tests.ModuleTestBase(java.lang.String nameTest, java.lang.String module)To test the specified module of the default application.ModuleTestBase(java.lang.String nameTest, java.lang.String application, java.lang.String module)To test the specified module of the specified application.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean_collectionHasFilterHeader(java.lang.String collection)protected voidassertAction(java.lang.String action)protected voidassertAction(java.lang.String action, java.lang.String arguments)protected voidassertActions(java.lang.String[] expectedActions)protected voidassertAllChecked()protected voidassertAllCollectionChecked(java.lang.String collection)protected voidassertAllCollectionUnchecked(java.lang.String collection)protected voidassertAllGroupBys(java.lang.String... expectedTitles)protected voidassertAllUnchecked()protected voidassertCollectionColumnCount(java.lang.String collection, int expected)protected voidassertCollectionNotEmpty(java.lang.String collection)protected voidassertCollectionRowCount(java.lang.String collection, int expectedCount)Row count displayed with data.protected voidassertContentType(java.lang.String type)Util for web applications, but using it make the test web dependent.protected voidassertContentTypeForPopup(int popup, java.lang.String type)Util for web applications, but using it makes the test web dependent.protected voidassertContentTypeForPopup(java.lang.String type)Util for web applications, but using it makes the test web dependent.protected voidassertDescriptionValue(java.lang.String name, java.lang.String value)protected voidassertDialog()protected voidassertDialogTitle(java.lang.String expectedTitle)protected voidassertDiscussionCommentContentText(java.lang.String name, int row, java.lang.String expectedText)Assert the content of a comment of DISCUSSION property as text, just the content of the comment excluding header data.protected voidassertDiscussionCommentsCount(java.lang.String name, int expectedCount)Assert the amount of comments in a DISCUSSION property.protected voidassertDiscussionCommentText(java.lang.String name, int row, java.lang.String extendedText)Assert the content of a comment of DISCUSSION property as text, including header data like user and date.protected voidassertEditable(java.lang.String name)protected voidassertEditableInCollection(java.lang.String collection, int row, int column)protected voidassertEditableInCollection(java.lang.String collection, int row, java.lang.String name)protected voidassertEditableInList(int row, int column)Asserts that a property in a specific row and column of the list is editable.protected voidassertEditableInList(int row, java.lang.String name)Asserts that a property in a specific row of the list is editable.protected voidassertError(java.lang.String message)protected voidassertErrorsCount(int expectedCount)protected voidassertExists(java.lang.String name)protected voidassertFile(java.lang.String property)Assert if the property with an upload editor has a file associated.protected voidassertFile(java.lang.String property, int index, java.lang.String expectedType)Assert if the property with an upload editor with multiple files has a file associated in certain position.protected voidassertFile(java.lang.String property, java.lang.String contentType)Assert if the property with an upload editor of has a file associated.protected voidassertFilesCount(java.lang.String property, int expectedCount)Assert the amount of files in a property with an upload multiple editor.protected voidassertFocusOn(java.lang.String name)protected voidassertInfo(java.lang.String message)protected voidassertInfosCount(int expectedCount)protected voidassertLabel(int sectionIndex, java.lang.String expectedLabel)protected voidassertLabel(java.lang.String name, java.lang.String expectedLabel)protected voidassertLabelInCollection(java.lang.String collection, int column, java.lang.String label)protected voidassertLabelInList(int column, java.lang.String label)protected voidassertListAllConfigurations(java.lang.String... expectedTitles)protected voidassertListColumnCount(int expected)protected voidassertListNotEmpty()protected voidassertListRowCount(int expected)Rows count displayed with data.protected voidassertListSelectedConfiguration(java.lang.String expectedTitle)protected voidassertListTitle(java.lang.String expectedTitle)protected voidassertMessage(java.lang.String message)protected voidassertMessagesCount(int expectedCount)protected voidassertNoAction(java.lang.String action)protected voidassertNoAction(java.lang.String action, java.lang.String arguments)protected voidassertNoDialog()protected voidassertNoEditable(java.lang.String name)protected voidassertNoEditableInCollection(java.lang.String collection, int row, int column)protected voidassertNoEditableInCollection(java.lang.String collection, int row, java.lang.String name)protected voidassertNoEditableInList(int row, int column)Asserts that a property in a specific row and column of the list is NOT editable.protected voidassertNoEditableInList(int row, java.lang.String name)Asserts that a property in a specific row of the list is NOT editable.protected voidassertNoError(java.lang.String message)protected voidassertNoErrors()protected voidassertNoFile(java.lang.String property)Assert if the property with an upload editor has not a file associated.protected voidassertNoInfo(java.lang.String message)protected voidassertNoInfos()protected voidassertNoLabel(java.lang.String name)protected voidassertNoListTitle()protected voidassertNoMessage(java.lang.String message)protected voidassertNoMessages()protected voidassertNoPopup()protected voidassertNoRowStyleInCollection(java.lang.String collection, int row)protected voidassertNoRowStyleInList(int row)protected voidassertNotEquals(java.lang.String msg, java.lang.String value1, java.lang.String value2)protected voidassertNotExists(java.lang.String name)protected voidassertNoWarning(java.lang.String message)protected voidassertNoWarnings()protected voidassertPopupCount(int count)protected voidassertPopupPDFLine(int lineNumber, java.lang.String expectedContent)Assert the value for the specified line as text of PDF in the popup window.protected voidassertPopupPDFLinesCount(int expectedCount)Assert the count of lines of the PDF in the popup window.protected voidassertRowChecked(int row)protected voidassertRowCollectionChecked(java.lang.String collection, int row)protected voidassertRowCollectionUnchecked(java.lang.String collection, int row)protected voidassertRowsChecked(int[] rows)protected voidassertRowsChecked(int f1, int f2)protected voidassertRowStyleInCollection(java.lang.String collection, int row, java.lang.String expectedStyle)protected voidassertRowStyleInList(int row, java.lang.String expectedStyle)protected voidassertRowUnchecked(int row)protected voidassertTotalInCollection(java.lang.String collection, int row, int column, java.lang.String total)protected voidassertTotalInCollection(java.lang.String collection, int column, java.lang.String total)protected voidassertTotalInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String total)protected voidassertTotalInCollection(java.lang.String collection, java.lang.String name, java.lang.String total)protected voidassertTotalInList(int column, java.lang.String total)protected voidassertTotalInList(java.lang.String name, java.lang.String total)protected voidassertValidValueExists(java.lang.String name, java.lang.String key, java.lang.String description)protected voidassertValidValueNotExists(java.lang.String name, java.lang.String key)protected voidassertValidValues(java.lang.String name, java.lang.String[][] values)protected voidassertValidValuesCount(java.lang.String name, int count)protected voidassertValidValuesCountInCollection(java.lang.String collection, int row, java.lang.String name, int count)protected voidassertValidValuesInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String[][] values)protected voidassertValue(java.lang.String name, java.lang.String value)protected voidassertValue(java.lang.String model, java.lang.String name, java.lang.String value)protected voidassertValueIgnoringCase(java.lang.String name, java.lang.String value)protected voidassertValueInCollection(java.lang.String collection, int row, int column, java.lang.String value)protected voidassertValueInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String value)protected voidassertValueInCollectionIgnoringCase(java.lang.String collection, int row, int column, java.lang.String value)protected voidassertValueInList(int row, int column, java.lang.String value)protected voidassertValueInList(int row, java.lang.String value)protected voidassertValueInList(int row, java.lang.String name, java.lang.String value)protected voidassertValues(java.lang.String name, java.lang.String[] values)For multiple values property.protected voidassertValuesInList(int row, java.lang.String... values)protected voidassertWarning(java.lang.String message)protected voidassertWarningsCount(int expectedCount)protected voidchangeModule(java.lang.String module)protected voidchangeModule(java.lang.String application, java.lang.String module)protected voidcheckAll()protected voidcheckAllCollection(java.lang.String collection)protected voidcheckRow(int row)protected voidcheckRow(java.lang.String id, java.lang.String value)protected voidcheckRowCollection(java.lang.String collection, int row)protected voidclearCondition()protected voidcloseDialog()protected org.htmlunit.WebClientcreateWebClient()It creates and returns a new WebClient each time you call it.protected java.lang.StringdecorateId(java.lang.String name)Decorate the name to produced an unique identifier as the used by OX for HTML elements.protected voidexecute(java.lang.String action)Execute the action clicking in the link or button.protected voidexecute(java.lang.String action, java.lang.String arguments)protected voidexecuteClicking(java.lang.String action, java.lang.String arguments)Deprecated.Since 7.2 the regular execute() uses clicking always, so you can use execute() insteadprotected voidexecuteDefaultAction()protected booleanexistsAction(java.lang.String action)protected org.htmlunit.BrowserVersiongetBrowserVersion()The browser emulation used for the test.protected intgetCollectionColumnCount(java.lang.String collection)protected intgetCollectionRowCount(java.lang.String collection)Row count displayed with data.protected java.lang.StringgetContextPath()protected java.lang.StringgetDescriptionValue(java.lang.String name)In the case of combo (descriptionsEditor.jsp) (or his read only version) the value that is visualized to user.protected java.lang.StringgetDiscussionCommentContentText(java.lang.String name, int row)Get the content of a comment of DISCUSSION property as text, just the content of the comment excluding header data.protected java.lang.StringgetDiscussionCommentText(java.lang.String name, int row)Get the content of a comment of DISCUSSION property as text, including header data like user and date.protected org.htmlunit.html.HtmlFormgetForm()Current HtmlForm (of HtmlUnit).protected static java.lang.StringgetHost()protected java.lang.StringgetHtml()Current HTML code.protected org.htmlunit.html.HtmlPagegetHtmlPage()This allows you testing using HtmlUnit APIs directly.protected java.lang.String[]getKeysValidValues(java.lang.String name)protected java.lang.StringgetLabel(java.lang.String name)protected intgetListColumnCount()protected intgetListRowCount()Rows count displayed with data.protected java.lang.StringgetLocale()protected java.lang.StringgetMessage()The first messageprotected java.lang.StringgetModuleURL()protected java.io.InputStreamgetPopupContentAsStream()The content of the response for popup window.protected java.lang.StringgetPopupPDFAsText()The content of the PDF in the popup window as text.protected java.lang.StringgetPopupPDFLine(int lineNumber)The specified line as text of PDF in the popup window.protected intgetPopupPDFLinesCount()The count of lines of the PDF in the popup window.protected intgetPopupPDFPageCount()Number of pages of the PDF in the popup windowprotected java.lang.StringgetPopupText()The text of the response for popup window.protected static java.lang.StringgetPort()protected java.lang.StringgetText()The text of the response.protected java.lang.StringgetValue(java.lang.String name)protected java.lang.StringgetValue(java.lang.String model, java.lang.String name)Deprecated.The model is automatically deduced, so you can use just getValue(String name)protected java.lang.StringgetValueInCollection(java.lang.String collection, int row, int column)protected java.lang.StringgetValueInCollection(java.lang.String collection, int row, java.lang.String name)protected java.lang.StringgetValueInList(int row)protected java.lang.StringgetValueInList(int row, int column)protected java.lang.StringgetValueInList(int row, java.lang.String name)protected java.lang.String[]getValues(java.lang.String name)For properties with multiple valuesprotected org.htmlunit.WebClientgetWebClient()This allows you testing using HtmlUnit APIs directly.static java.lang.StringgetXavaJUnitProperty(java.lang.String id)From file xava-junit.propertiesstatic java.lang.StringgetXavaJUnitProperty(java.lang.String id, java.lang.String defaultValue)From file xava-junit.propertiesprotected voidlogin(java.lang.String user, java.lang.String password)protected voidlogout()User logout.protected voidmoveRow(java.lang.String collection, int from, int to)Move an element of collection from a row to another.protected voidmoveRow(java.lang.String collection, int from, int to, boolean classRequired)Move an element of collection from a row to another.protected voidpostDiscussionComment(java.lang.String name, java.lang.String commentContent)Post a new comment into a DISCUSSION property.protected voidprintHtml()Only for debug.protected voidprintPopupPDFAsText()Only for debug.protected voidreload()Like clicking on the reload button of the browser.protected voidremoveFile(java.lang.String property)Remove the current file from a property with an upload editor.protected voidremoveFile(java.lang.String property, int index)Remove a file from a property with an upload multiple editor.protected voidresetModule()Like close navigator, open again, and reexecute the module.protected voidselectGroupBy(java.lang.String title)protected voidselectListConfiguration(java.lang.String title)protected voidselectModuleInPage(java.lang.String module)protected voidsetConditionComparators(java.lang.String... values)protected voidsetConditionComparators(java.lang.String collection, java.lang.String[] values)protected voidsetConditionComparators(java.util.List values)To be used from Groovy, that does not work with setConditionComparators(String ... values).protected voidsetConditionValues(java.lang.String... values)protected voidsetConditionValues(java.lang.String collection, java.lang.String[] values)protected voidsetConditionValues(java.util.List values)To be used from Groovy, that does not work with setConditionValues(String ... values).protected voidsetConditionValuesTo(java.lang.String... values)protected voidsetFileValue(java.lang.String name, java.lang.String filePath)protected voidsetLocale(java.lang.String locale)protected voidsetModel(java.lang.String defaultModel)Deprecated.Now the model is deduced automaticallyprotected voidsetModelToModuleSetting()Deprecated.Now this is done automaticallyprotected voidsetUp()protected voidsetValue(java.lang.String name, java.lang.String value)protected voidsetValue(java.lang.String model, java.lang.String name, java.lang.String value)Deprecated.Now model is deduced automatically, so you can use setValue(String model, String value)protected voidsetValueInCollection(java.lang.String collection, int row, int column, java.lang.String value)protected voidsetValueInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String value)protected voidsetValueInList(int row, int column, java.lang.String value)Sets the value of a property in a specific row and column of the list.protected voidsetValueInList(int row, java.lang.String name, java.lang.String value)Sets the value of a property in a specific row of the list.protected voidsetValueNotNotify(java.lang.String name, java.lang.String value)protected voidsetValues(java.lang.String name, java.lang.String[] values)For multiple values propertiesprotected voidtearDown()protected java.lang.StringtoKeyString(java.lang.Object pojo)Returns a string representations of the key of a POJO from the POJO itself.protected voiduncheckAll()protected voiduncheckAllCollection(java.lang.String collection)protected voiduncheckRow(int row)protected voiduncheckRowCollection(java.lang.String collection, int row)protected voiduploadFile(java.lang.String property, java.lang.String fileURL)Upload a file in a property with an upload editor.protected voidwaitAJAX()Wait until the current AJAX request is done and update the page if needed.-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
-
-
-
-
Constructor Detail
-
ModuleTestBase
public ModuleTestBase(java.lang.String nameTest, java.lang.String application, java.lang.String module)To test the specified module of the specified application.You can send
nullfornullin such a case you must usechangeModule(java.lang.String)at the very first of your test methods.
-
ModuleTestBase
public ModuleTestBase(java.lang.String nameTest, java.lang.String module)To test the specified module of the default application.In this case the application is obtained from the
applicationproperty inxava-junit.propertiesfile.
You can sendnullfornullin such a case you must usechangeModule(java.lang.String)at the very first of your test methods.
-
ModuleTestBase
public ModuleTestBase(java.lang.String module)
Constructor for JUnit 4 style tests.The module must be set in the subclass constructor by calling the appropriate constructor with module parameter.
- Since:
- 7.6.2
-
-
Method Detail
-
setUp
protected void setUp() throws java.lang.Exception- Overrides:
setUpin classjunit.framework.TestCase- Throws:
java.lang.Exception
-
tearDown
protected void tearDown() throws java.lang.Exception- Overrides:
tearDownin classjunit.framework.TestCase- Throws:
java.lang.Exception
-
login
protected void login(java.lang.String user, java.lang.String password) throws java.lang.Exception- Throws:
java.lang.Exception
-
logout
protected void logout() throws java.lang.ExceptionUser logout.- Throws:
java.lang.Exception
-
resetModule
protected void resetModule() throws java.lang.ExceptionLike close navigator, open again, and reexecute the module.- Throws:
java.lang.Exception
-
getBrowserVersion
protected org.htmlunit.BrowserVersion getBrowserVersion() throws java.lang.ExceptionThe browser emulation used for the test.If you overwrite this method maybe some methods of ModuleTestBase would not work correctly. Usually you overwrite it to test using directly the HtmlUnit API.
The use of this method is discouraged because binds your test to a HTML implementation. Before to use this method look for another more abstract method in this class.- Throws:
java.lang.Exception- Since:
- 5.5
-
reload
protected void reload() throws java.lang.ExceptionLike clicking on the reload button of the browser.- Throws:
java.lang.Exception- Since:
- 4.1.2
-
selectModuleInPage
protected void selectModuleInPage(java.lang.String module) throws java.lang.Exception- Throws:
java.lang.Exception
-
changeModule
protected void changeModule(java.lang.String module) throws java.lang.Exception- Throws:
java.lang.Exception
-
changeModule
protected void changeModule(java.lang.String application, java.lang.String module) throws java.lang.Exception- Throws:
java.lang.Exception
-
getModuleURL
protected java.lang.String getModuleURL() throws XavaException- Throws:
XavaException
-
setModel
protected void setModel(java.lang.String defaultModel)
Deprecated.Now the model is deduced automaticallyThe model used as prefix to method like getValue, assertValue, etc.By default is the model of module. The effect of the this setting is only for the life of one test.
-
setModelToModuleSetting
protected void setModelToModuleSetting()
Deprecated.Now this is done automaticallyPut the model of the module as the default model of the test.This is the default setting, hence this method is called to restore the original setting.
-
execute
protected void execute(java.lang.String action) throws java.lang.ExceptionExecute the action clicking in the link or button.- Throws:
java.lang.Exception
-
waitAJAX
protected void waitAJAX() throws java.lang.ExceptionWait until the current AJAX request is done and update the page if needed.Usually is only needed to call this method when you use directly HtmlUnit APIs.
- Throws:
java.lang.Exception- Since:
- 5.7
-
decorateId
protected java.lang.String decorateId(java.lang.String name)
Decorate the name to produced an unique identifier as the used by OX for HTML elements.
-
assertFocusOn
protected void assertFocusOn(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
executeClicking
@Deprecated protected void executeClicking(java.lang.String action, java.lang.String arguments) throws java.lang.ExceptionDeprecated.Since 7.2 the regular execute() uses clicking always, so you can use execute() insteadExecutes an action simulating a real click in the button or link.In addition to execute the action this method throws the corresponding events of clicking the real link, like the focus lost of the current editor, for example.
- Throws:
java.lang.Exception
-
execute
protected void execute(java.lang.String action, java.lang.String arguments) throws java.lang.Exception- Throws:
java.lang.Exception
-
executeDefaultAction
protected void executeDefaultAction() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertExists
protected void assertExists(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNotExists
protected void assertNotExists(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
getDescriptionValue
protected java.lang.String getDescriptionValue(java.lang.String name) throws java.lang.ExceptionIn the case of combo (descriptionsEditor.jsp) (or his read only version) the value that is visualized to user.- Returns:
- Throws:
java.lang.Exception
-
getValue
protected java.lang.String getValue(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
getValues
protected java.lang.String[] getValues(java.lang.String name) throws java.lang.ExceptionFor properties with multiple values- Throws:
java.lang.Exception
-
getLabel
protected java.lang.String getLabel(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
getValue
protected java.lang.String getValue(java.lang.String model, java.lang.String name) throws java.lang.ExceptionDeprecated.The model is automatically deduced, so you can use just getValue(String name)In case we does not work with main view.- Throws:
java.lang.Exception
-
printHtml
protected void printHtml() throws java.lang.ExceptionOnly for debug.- Throws:
java.lang.Exception
-
assertContentType
protected void assertContentType(java.lang.String type)
Util for web applications, but using it make the test web dependent.- Parameters:
type- text/html, application/pdf, etc.
-
assertContentTypeForPopup
protected void assertContentTypeForPopup(int popup, java.lang.String type)Util for web applications, but using it makes the test web dependent.- Parameters:
popup- The window numbertype- text/html, application/pdf, etc.- Since:
- 4.3
-
assertContentTypeForPopup
protected void assertContentTypeForPopup(java.lang.String type)
Util for web applications, but using it makes the test web dependent.- Parameters:
type- text/html, application/pdf, etc.
-
assertPopupCount
protected void assertPopupCount(int count) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
assertNoPopup
protected void assertNoPopup() throws java.lang.Exception- Throws:
java.lang.Exception
-
getHtml
protected java.lang.String getHtml() throws java.lang.ExceptionCurrent HTML code.It is not very advisable because this will cause dependency to HTML and it will be difficult migrate to another presentation technology.
- Throws:
java.lang.Exception
-
getText
protected java.lang.String getText() throws java.io.IOExceptionThe text of the response.- Throws:
java.io.IOException
-
getPopupText
protected java.lang.String getPopupText() throws java.lang.ExceptionThe text of the response for popup window.- Throws:
java.lang.Exception
-
getPopupContentAsStream
protected java.io.InputStream getPopupContentAsStream() throws java.lang.ExceptionThe content of the response for popup window.- Throws:
java.lang.Exception- Since:
- 6.4.2
-
getPopupPDFAsText
protected java.lang.String getPopupPDFAsText() throws java.lang.ExceptionThe content of the PDF in the popup window as text.- Throws:
java.lang.Exception- Since:
- 4.6
-
printPopupPDFAsText
protected void printPopupPDFAsText() throws java.lang.ExceptionOnly for debug.- Throws:
java.lang.Exception- Since:
- 4.6
-
getPopupPDFPageCount
protected int getPopupPDFPageCount() throws java.lang.ExceptionNumber of pages of the PDF in the popup window- Throws:
java.lang.Exception- Since:
- 5.0
-
getPopupPDFLine
protected java.lang.String getPopupPDFLine(int lineNumber) throws java.lang.ExceptionThe specified line as text of PDF in the popup window.- Throws:
java.lang.Exception- Since:
- 4.6
-
assertPopupPDFLine
protected void assertPopupPDFLine(int lineNumber, java.lang.String expectedContent) throws java.lang.ExceptionAssert the value for the specified line as text of PDF in the popup window.- Throws:
java.lang.Exception- Since:
- 4.6
-
assertPopupPDFLinesCount
protected void assertPopupPDFLinesCount(int expectedCount) throws java.lang.ExceptionAssert the count of lines of the PDF in the popup window.- Throws:
java.lang.Exception- Since:
- 4.6
-
getPopupPDFLinesCount
protected int getPopupPDFLinesCount() throws java.lang.ExceptionThe count of lines of the PDF in the popup window.- Throws:
java.lang.Exception- Since:
- 4.6
-
setConditionValues
protected void setConditionValues(java.lang.String... values) throws java.lang.Exception- Parameters:
Varargs- since 4m5.- Throws:
java.lang.Exception
-
setConditionValuesTo
protected void setConditionValuesTo(java.lang.String... values) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.4
-
setConditionValues
protected void setConditionValues(java.util.List values) throws java.lang.ExceptionTo be used from Groovy, that does not work with setConditionValues(String ... values).- Throws:
java.lang.Exception- Since:
- 4.0.1
-
setConditionComparators
protected void setConditionComparators(java.util.List values) throws java.lang.ExceptionTo be used from Groovy, that does not work with setConditionComparators(String ... values).- Throws:
java.lang.Exception- Since:
- 4.0.1
-
clearCondition
protected void clearCondition() throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.6
-
setConditionComparators
protected void setConditionComparators(java.lang.String... values) throws java.lang.Exception- Parameters:
values- varargs since 4m5- Throws:
java.lang.Exception
-
setConditionValues
protected void setConditionValues(java.lang.String collection, java.lang.String[] values) throws java.lang.Exception- Throws:
java.lang.Exception
-
setConditionComparators
protected void setConditionComparators(java.lang.String collection, java.lang.String[] values) throws java.lang.Exception- Throws:
java.lang.Exception
-
setValueNotNotify
protected void setValueNotNotify(java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
setValue
protected void setValue(java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
setValues
protected void setValues(java.lang.String name, java.lang.String[] values) throws java.lang.ExceptionFor multiple values properties- Throws:
java.lang.Exception
-
setFileValue
protected void setFileValue(java.lang.String name, java.lang.String filePath) throws java.lang.Exception- Throws:
java.lang.Exception
-
setValue
protected void setValue(java.lang.String model, java.lang.String name, java.lang.String value) throws java.lang.ExceptionDeprecated.Now model is deduced automatically, so you can use setValue(String model, String value)In case we do not work with main view.- Throws:
java.lang.Exception
-
assertLabel
protected void assertLabel(java.lang.String name, java.lang.String expectedLabel) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertLabel
protected void assertLabel(int sectionIndex, java.lang.String expectedLabel) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 6.4
-
assertNoLabel
protected void assertNoLabel(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValue
protected void assertValue(java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValues
protected void assertValues(java.lang.String name, java.lang.String[] values) throws java.lang.ExceptionFor multiple values property.- Throws:
java.lang.Exception
-
assertValueIgnoringCase
protected void assertValueIgnoringCase(java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValue
protected void assertValue(java.lang.String model, java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertDescriptionValue
protected void assertDescriptionValue(java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
existsAction
protected boolean existsAction(java.lang.String action) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertAction
protected void assertAction(java.lang.String action) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertAction
protected void assertAction(java.lang.String action, java.lang.String arguments) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoAction
protected void assertNoAction(java.lang.String action) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoAction
protected void assertNoAction(java.lang.String action, java.lang.String arguments) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertActions
protected void assertActions(java.lang.String[] expectedActions) throws java.lang.Exception- Throws:
java.lang.Exception
-
getValueInList
protected java.lang.String getValueInList(int row, java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
getValueInList
protected java.lang.String getValueInList(int row, int column) throws java.lang.Exception- Throws:
java.lang.Exception
-
getValueInList
protected java.lang.String getValueInList(int row) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.7
-
getValueInCollection
protected java.lang.String getValueInCollection(java.lang.String collection, int row, java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
setValueInList
protected void setValueInList(int row, java.lang.String name, java.lang.String value) throws java.lang.ExceptionSets the value of a property in a specific row of the list. This method allows you to modify the value of a property directly in the list view, simulating the user editing the cell in-place. Works with properties that are configured as editable in the list. For reference properties using @DescriptionsList, note that even though the list displays the description or name of the reference, when setting a value you must use the key property of the reference. For example, if you have a family reference that shows descriptions in the list, you would read the value using family.description but set it using family.number. Example:// Simple property setValueInList(0, "unitPrice", "17.00"); // Sets the first row's unitPrice to 17.00 // Reference property with @DescriptionsList assertValueInList(1, "family.description", "HARDWARE"); // Reading shows the description setValueInList(1, "family.number", "3"); // Setting uses the key property // Reference property with multiple keys Warehouse warehouse = new Warehouse(); warehouse.setZoneNumber(4); warehouse.setNumber(13); setValueInList(1, "warehouse.KEY", toKeyString(warehouse)); // For composite keys
- Parameters:
row- The row number (0-based) in the listname- The property name to set, can be a simple property or a qualified property (e.g. "family.number")value- The value to set for the property- Throws:
java.lang.Exception- Since:
- 7.6
-
setValueInList
protected void setValueInList(int row, int column, java.lang.String value) throws java.lang.ExceptionSets the value of a property in a specific row and column of the list. This method allows you to modify the value of a property directly in the list view by specifying the column index instead of the property name. The column index corresponds to the order of properties displayed in the list. Example:setValueInList(0, 2, "17.00"); // Sets the first row's third column to 17.00
- Parameters:
row- The row number (0-based) in the listcolumn- The column number (0-based) in the listvalue- The value to set for the property- Throws:
java.lang.Exception- Since:
- 7.6
-
assertEditableInList
protected void assertEditableInList(int row, java.lang.String name) throws java.lang.ExceptionAsserts that a property in a specific row of the list is editable. This method verifies that a property in the list can be edited in-place by the user. It fails the test if the property is not editable in the specified row. Example:assertEditableInList(0, "unitPrice"); // Verifies the unitPrice in first row is editable assertEditableInList(1, "family.description"); // Verifies a reference property is editable
- Parameters:
row- The row number (0-based) in the listname- The property name to check, can be a simple property or a qualified property- Throws:
java.lang.Exception- If the property is not editable or if any error occurs during verification- Since:
- 7.6
-
assertNoEditableInList
protected void assertNoEditableInList(int row, java.lang.String name) throws java.lang.ExceptionAsserts that a property in a specific row of the list is NOT editable. This method verifies that a property in the list cannot be edited in-place by the user. It fails the test if the property is editable in the specified row when it should not be. Example:assertNoEditableInList(0, "extendedDescription"); // Verifies the property is not editable assertNoEditableInList(1, "id"); // Verifies a key property is not editable
This is particularly useful for testing properties that should be read-only in the list, such as calculated fields, formula properties, or properties explicitly excluded from the editable properties configuration.- Parameters:
row- The row number (0-based) in the listname- The property name to check, can be a simple property or a qualified property- Throws:
java.lang.Exception- If the property is editable or if any error occurs during verification- Since:
- 7.6
-
assertEditableInList
protected void assertEditableInList(int row, int column) throws java.lang.ExceptionAsserts that a property in a specific row and column of the list is editable. This method verifies that a property in the list can be edited in-place by the user, using column index instead of property name. The column index corresponds to the order of properties displayed in the list. Example:assertEditableInList(0, 2); // Verifies the third column in first row is editable
- Parameters:
row- The row number (0-based) in the listcolumn- The column number (0-based) in the list- Throws:
java.lang.Exception- If the property is not editable or if any error occurs during verification- Since:
- 7.6
-
assertNoEditableInList
protected void assertNoEditableInList(int row, int column) throws java.lang.ExceptionAsserts that a property in a specific row and column of the list is NOT editable. This method verifies that a property in the list cannot be edited in-place by the user, using column index instead of property name. It fails the test if the property is editable in the specified row and column when it should not be. Example:assertNoEditableInList(0, 3); // Verifies the fourth column in first row is not editable
This is particularly useful for testing properties that should be read-only in the list, such as calculated fields, formula properties, or properties explicitly excluded from the editable properties configuration.- Parameters:
row- The row number (0-based) in the listcolumn- The column number (0-based) in the list- Throws:
java.lang.Exception- If the property is editable or if any error occurs during verification- Since:
- 7.6
-
setValueInCollection
protected void setValueInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.0
-
setValueInCollection
protected void setValueInCollection(java.lang.String collection, int row, int column, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.0
-
getValueInCollection
protected java.lang.String getValueInCollection(java.lang.String collection, int row, int column) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertRowStyleInList
protected void assertRowStyleInList(int row, java.lang.String expectedStyle) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertRowStyleInCollection
protected void assertRowStyleInCollection(java.lang.String collection, int row, java.lang.String expectedStyle) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoRowStyleInList
protected void assertNoRowStyleInList(int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoRowStyleInCollection
protected void assertNoRowStyleInCollection(java.lang.String collection, int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
_collectionHasFilterHeader
protected boolean _collectionHasFilterHeader(java.lang.String collection) throws java.lang.Exception- Throws:
java.lang.Exception
-
getListRowCount
protected int getListRowCount() throws java.lang.ExceptionRows count displayed with data.Exclude heading and footing, and the not displayed data (maybe in cache).
- Throws:
java.lang.Exception
-
getListColumnCount
protected int getListColumnCount() throws java.lang.Exception- Throws:
java.lang.Exception
-
getCollectionColumnCount
protected int getCollectionColumnCount(java.lang.String collection) throws java.lang.Exception- Throws:
java.lang.Exception
-
getCollectionRowCount
protected int getCollectionRowCount(java.lang.String collection) throws java.lang.ExceptionRow count displayed with data.Excludes heading and footing, and not displayed data (but cached).
- Throws:
java.lang.Exception
-
assertCollectionRowCount
protected void assertCollectionRowCount(java.lang.String collection, int expectedCount) throws java.lang.ExceptionRow count displayed with data.Excludes heading and footing, and not displayed data (but cached).
- Throws:
java.lang.Exception
-
assertListRowCount
protected void assertListRowCount(int expected) throws java.lang.ExceptionRows count displayed with data.Exclude headers and footing, and the not displayed data (maybe cached).
- Throws:
java.lang.Exception
-
assertListColumnCount
protected void assertListColumnCount(int expected) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertCollectionColumnCount
protected void assertCollectionColumnCount(java.lang.String collection, int expected) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValueInList
protected void assertValueInList(int row, java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValueInList
protected void assertValueInList(int row, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.7
-
assertValuesInList
protected void assertValuesInList(int row, java.lang.String... values) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.8
-
assertValueInList
protected void assertValueInList(int row, int column, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValueInCollection
protected void assertValueInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValueInCollection
protected void assertValueInCollection(java.lang.String collection, int row, int column, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValueInCollectionIgnoringCase
protected void assertValueInCollectionIgnoringCase(java.lang.String collection, int row, int column, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertLabelInCollection
protected void assertLabelInCollection(java.lang.String collection, int column, java.lang.String label) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertLabelInList
protected void assertLabelInList(int column, java.lang.String label) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertTotalInList
protected void assertTotalInList(int column, java.lang.String total) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.1
-
assertTotalInList
protected void assertTotalInList(java.lang.String name, java.lang.String total) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.1
-
assertTotalInCollection
protected void assertTotalInCollection(java.lang.String collection, int column, java.lang.String total) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.1
-
assertTotalInCollection
protected void assertTotalInCollection(java.lang.String collection, int row, int column, java.lang.String total) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.1
-
assertTotalInCollection
protected void assertTotalInCollection(java.lang.String collection, java.lang.String name, java.lang.String total) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.1
-
assertTotalInCollection
protected void assertTotalInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String total) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
checkRow
protected void checkRow(int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
checkAll
protected void checkAll() throws java.lang.Exception- Throws:
java.lang.Exception
-
uncheckRow
protected void uncheckRow(int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
uncheckAll
protected void uncheckAll() throws java.lang.Exception- Throws:
java.lang.Exception
-
checkRowCollection
protected void checkRowCollection(java.lang.String collection, int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
checkAllCollection
protected void checkAllCollection(java.lang.String collection) throws java.lang.Exception- Throws:
java.lang.Exception
-
uncheckAllCollection
protected void uncheckAllCollection(java.lang.String collection) throws java.lang.Exception- Throws:
java.lang.Exception
-
uncheckRowCollection
protected void uncheckRowCollection(java.lang.String collection, int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
checkRow
protected void checkRow(java.lang.String id, java.lang.String value) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertRowChecked
protected void assertRowChecked(int row)
-
assertAllChecked
protected void assertAllChecked()
-
assertRowCollectionChecked
protected void assertRowCollectionChecked(java.lang.String collection, int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertAllCollectionChecked
protected void assertAllCollectionChecked(java.lang.String collection) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertRowsChecked
protected void assertRowsChecked(int f1, int f2)
-
assertRowsChecked
protected void assertRowsChecked(int[] rows)
-
assertRowUnchecked
protected void assertRowUnchecked(int row)
-
assertAllUnchecked
protected void assertAllUnchecked()
-
assertRowCollectionUnchecked
protected void assertRowCollectionUnchecked(java.lang.String collection, int row) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertAllCollectionUnchecked
protected void assertAllCollectionUnchecked(java.lang.String collection) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertError
protected void assertError(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertMessage
protected void assertMessage(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertInfo
protected void assertInfo(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
assertWarning
protected void assertWarning(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
assertErrorsCount
protected void assertErrorsCount(int expectedCount) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertMessagesCount
protected void assertMessagesCount(int expectedCount) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertInfosCount
protected void assertInfosCount(int expectedCount) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
assertWarningsCount
protected void assertWarningsCount(int expectedCount) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
assertNoError
protected void assertNoError(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoMessage
protected void assertNoMessage(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoInfo
protected void assertNoInfo(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
assertNoWarning
protected void assertNoWarning(java.lang.String message) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4.3
-
getMessage
protected java.lang.String getMessage() throws java.lang.ExceptionThe first message- Throws:
java.lang.Exception
-
assertNoErrors
protected void assertNoErrors() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoMessages
protected void assertNoMessages() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoWarnings
protected void assertNoWarnings() throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.4
-
assertNoInfos
protected void assertNoInfos() throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.4
-
assertValidValuesInCollection
protected void assertValidValuesInCollection(java.lang.String collection, int row, java.lang.String name, java.lang.String[][] values) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.1
-
assertValidValuesCountInCollection
protected void assertValidValuesCountInCollection(java.lang.String collection, int row, java.lang.String name, int count) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.1
-
assertValidValueNotExists
protected void assertValidValueNotExists(java.lang.String name, java.lang.String key) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValidValues
protected void assertValidValues(java.lang.String name, java.lang.String[][] values) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValidValuesCount
protected void assertValidValuesCount(java.lang.String name, int count) throws java.lang.Exception- Throws:
java.lang.Exception
-
getKeysValidValues
protected java.lang.String[] getKeysValidValues(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertEditable
protected void assertEditable(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoEditable
protected void assertNoEditable(java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertEditableInCollection
protected void assertEditableInCollection(java.lang.String collection, int row, java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.0
-
assertNoEditableInCollection
protected void assertNoEditableInCollection(java.lang.String collection, int row, java.lang.String name) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.0
-
assertEditableInCollection
protected void assertEditableInCollection(java.lang.String collection, int row, int column) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.0
-
assertNoEditableInCollection
protected void assertNoEditableInCollection(java.lang.String collection, int row, int column) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.0
-
assertListTitle
protected void assertListTitle(java.lang.String expectedTitle) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertNoListTitle
protected void assertNoListTitle() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertListNotEmpty
protected void assertListNotEmpty() throws java.lang.Exception- Throws:
java.lang.Exception
-
assertCollectionNotEmpty
protected void assertCollectionNotEmpty(java.lang.String collection) throws java.lang.Exception- Throws:
java.lang.Exception
-
assertValidValueExists
protected void assertValidValueExists(java.lang.String name, java.lang.String key, java.lang.String description) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.3
-
getPort
protected static java.lang.String getPort()
-
getHost
protected static java.lang.String getHost()
-
getContextPath
protected java.lang.String getContextPath()
- Since:
- 6.3
-
getXavaJUnitProperty
public static java.lang.String getXavaJUnitProperty(java.lang.String id)
From file xava-junit.properties- Since:
- 4m6 Before it was called getProperty()
-
getXavaJUnitProperty
public static java.lang.String getXavaJUnitProperty(java.lang.String id, java.lang.String defaultValue)From file xava-junit.properties- Since:
- 4m6 Before it was called getProperty()
-
getForm
protected org.htmlunit.html.HtmlForm getForm()
Current HtmlForm (of HtmlUnit).This allow you to access directly to html form elements, but it is not very advisable because this will cause dependency to HTML and HtmlUnit so it will be difficult migrate to another presentation technology.
-
getWebClient
protected org.htmlunit.WebClient getWebClient()
This allows you testing using HtmlUnit APIs directly.The use of this method is discoraged because binds your test to a HTML implementation. Before to use this method look for another more abstract method in this class.
By default CSS is disabled for performance, if you need that CSS works for your test, write this line:getWebClient().setCssEnabled(true);
-
createWebClient
protected org.htmlunit.WebClient createWebClient() throws java.lang.ExceptionIt creates and returns a new WebClient each time you call it.Also, it's the method used to create the WebClient used for the test, so you can overwrite it to refine the WebClient used for your test.
This allows you testing using HtmlUnit APIs directly.
The use of this method is discoraged because binds your test to a HTML implementation. Before to use this method look for another more abstract method in this class.
By default CSS is disabled for performance, if you need that CSS works for your test, write this line:WebClient webClient = createWebClient(); webClient.setCssEnabled(true);
- Throws:
java.lang.Exception- Since:
- 7.3
-
getLocale
protected java.lang.String getLocale()
-
setLocale
protected void setLocale(java.lang.String locale) throws java.lang.Exception- Throws:
java.lang.Exception
-
toKeyString
protected java.lang.String toKeyString(java.lang.Object pojo) throws java.lang.ExceptionReturns a string representations of the key of a POJO from the POJO itself.Useful for obtaining the value to put into a combo (a descriptions list) from a POJO object.
- Throws:
java.lang.Exception
-
assertNotEquals
protected void assertNotEquals(java.lang.String msg, java.lang.String value1, java.lang.String value2)
-
assertDialog
protected void assertDialog() throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4m1
-
assertNoDialog
protected void assertNoDialog() throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4m1
-
closeDialog
protected void closeDialog() throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4m1
-
assertDialogTitle
protected void assertDialogTitle(java.lang.String expectedTitle) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 4m1
-
getHtmlPage
protected org.htmlunit.html.HtmlPage getHtmlPage()
This allows you testing using HtmlUnit APIs directly.The use of this method is discouraged because binds your test to a HTML implementation. Before to use this method look for another more abstract method in this class.
- Since:
- 4m4
-
assertDiscussionCommentText
protected void assertDiscussionCommentText(java.lang.String name, int row, java.lang.String extendedText)Assert the content of a comment of DISCUSSION property as text, including header data like user and date.- Since:
- 5.6
-
getDiscussionCommentText
protected java.lang.String getDiscussionCommentText(java.lang.String name, int row)Get the content of a comment of DISCUSSION property as text, including header data like user and date.- Since:
- 5.7
-
getDiscussionCommentContentText
protected java.lang.String getDiscussionCommentContentText(java.lang.String name, int row)Get the content of a comment of DISCUSSION property as text, just the content of the comment excluding header data.- Since:
- 5.7
-
assertDiscussionCommentContentText
protected void assertDiscussionCommentContentText(java.lang.String name, int row, java.lang.String expectedText)Assert the content of a comment of DISCUSSION property as text, just the content of the comment excluding header data.- Since:
- 5.7
-
assertDiscussionCommentsCount
protected void assertDiscussionCommentsCount(java.lang.String name, int expectedCount)Assert the amount of comments in a DISCUSSION property.- Since:
- 5.6
-
postDiscussionComment
protected void postDiscussionComment(java.lang.String name, java.lang.String commentContent) throws java.lang.ExceptionPost a new comment into a DISCUSSION property.- Throws:
java.lang.Exception- Since:
- 5.6
-
selectListConfiguration
protected void selectListConfiguration(java.lang.String title) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.6
-
assertListSelectedConfiguration
protected void assertListSelectedConfiguration(java.lang.String expectedTitle)
- Since:
- 5.6
-
assertListAllConfigurations
protected void assertListAllConfigurations(java.lang.String... expectedTitles) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.6
-
selectGroupBy
protected void selectGroupBy(java.lang.String title) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.8
-
assertAllGroupBys
protected void assertAllGroupBys(java.lang.String... expectedTitles) throws java.lang.Exception- Throws:
java.lang.Exception- Since:
- 5.8
-
assertFile
protected void assertFile(java.lang.String property, java.lang.String contentType) throws java.lang.ExceptionAssert if the property with an upload editor of has a file associated. For properties with stereotypes IMAGE, PHOTO, FILE, etc. Example:assertFile("photo", "image");It tries to recover the file from the server and verify if it is of contentType.- Parameters:
property- The property name of the current view with an upload editorcontentType- The content type, such as image, image/png, text/html, etc.- Throws:
java.lang.Exception- Since:
- 6.2
-
assertFile
protected void assertFile(java.lang.String property) throws java.lang.ExceptionAssert if the property with an upload editor has a file associated. For properties with stereotypes IMAGE, PHOTO, FILE, etc. Example:assertFile("photo");It tries to recover the file from the server.- Parameters:
property- The property name of the current view with an upload editor- Throws:
java.lang.Exception- Since:
- 6.2
-
assertFile
protected void assertFile(java.lang.String property, int index, java.lang.String expectedType) throws java.lang.ExceptionAssert if the property with an upload editor with multiple files has a file associated in certain position. For properties with stereotypes IMAGES_GALLERY, FILES, etc. Example:assertFile("attachments", 2, "text/html");It tries to recover the file from the server and verify if it is of contentType.- Parameters:
property- The property name of the current view with an upload editorindex- Position of the filecontentType- The content type, such as image, image/png, text/html, etc.- Throws:
java.lang.Exception- Since:
- 6.2
-
assertNoFile
protected void assertNoFile(java.lang.String property) throws java.lang.ExceptionAssert if the property with an upload editor has not a file associated. For properties with stereotypes IMAGE, PHOTO, FILE, etc. Example:assertNoFile("photo");- Parameters:
property- The property name of the current view with an upload editor- Throws:
java.lang.Exception- Since:
- 6.2
-
uploadFile
protected void uploadFile(java.lang.String property, java.lang.String fileURL) throws java.lang.ExceptionUpload a file in a property with an upload editor. For properties with stereotypes IMAGE, PHOTO, IMAGES_GALLERY, FILE, FILES, etc. Example:uploadFile("photo", "test-images/cake.gif");- Parameters:
property- The property name of the current view with an upload editorfileURL- If the URL is relative it starts from the current project, if it is absolute (starts with /) it is used 'as is'.- Throws:
java.lang.Exception- Since:
- 6.2
-
removeFile
protected void removeFile(java.lang.String property) throws java.lang.ExceptionRemove the current file from a property with an upload editor. For properties with stereotypes IMAGE, PHOTO, FILE, etc. Example:removeFile("photo");It's like clicking in the X button of the file, if the file is actually deleted from database depends on the concrete editor.- Parameters:
property- The property name of the current view with an upload editor- Throws:
java.lang.Exception- Since:
- 6.2
-
assertFilesCount
protected void assertFilesCount(java.lang.String property, int expectedCount) throws java.lang.ExceptionAssert the amount of files in a property with an upload multiple editor. For properties with stereotypes IMAGES_GALLERY, FILES, etc. Example:assertFilesCount("screenshots", 5);- Parameters:
property- The property name of the current view with an upload multiple editorexpectedCount- The expected number of files- Throws:
java.lang.Exception- Since:
- 6.2
-
removeFile
protected void removeFile(java.lang.String property, int index) throws java.lang.ExceptionRemove a file from a property with an upload multiple editor. For properties with stereotypes IMAGES_GALLERY, FILES, etc. Example:removeFile("screenshots", 2);It's like clicking in the X button of the file, if the file is actually deleted from database depends on the concrete editor.- Parameters:
property- The property name of the current view with an upload multiple editorindex- The position (0 based) of the file to remove- Throws:
java.lang.Exception- Since:
- 6.2
-
moveRow
protected void moveRow(java.lang.String collection, int from, int to) throws java.lang.ExceptionMove an element of collection from a row to another.It is for @OrderColumn collection where the user can reorder the rows with the mouse.
WARNING! This method does not work for all "from, to" combinations, so if it does not work just try with other combination. Example:moveRow("details", 2, 0);- Parameters:
collection- The name of the collectionfrom- Index of the origin rowto- Index of the target row- Throws:
java.lang.Exception- Since:
- 6.6
-
moveRow
protected void moveRow(java.lang.String collection, int from, int to, boolean classRequired) throws java.lang.ExceptionMove an element of collection from a row to another.It is for @OrderColumn collection where the user can reorder the rows with the mouse.
WARNING! This method does not work for all "from, to" combinations, so if it does not work just try with other combination. Example:moveRow("details", 2, 0);- Parameters:
collection- The name of the collectionfrom- Index of the origin rowto- Index of the target rowclassRequired- If true it verifies the CSS class of target row to assures it is sortable- Throws:
java.lang.Exception- Since:
- 6.6
-
-