Class CrudElement
java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.crud.testbench.CrudElement
- All Implemented Interfaces:
com.vaadin.testbench.commands.CanCompareScreenshots,com.vaadin.testbench.HasCallFunction,com.vaadin.testbench.HasDriver,com.vaadin.testbench.HasElementQuery,com.vaadin.testbench.HasPropertySettersGetters,com.vaadin.testbench.HasSearchContext,com.vaadin.testbench.HasTestBenchCommandExecutor,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
public class CrudElement
extends com.vaadin.testbench.TestBenchElement
TestBench element for the vaadin-crud element
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.confirmdialog.testbench.ConfirmDialogElementGets the confirm cancel dialogcom.vaadin.flow.component.confirmdialog.testbench.ConfirmDialogElementGets the confirm delete dialogcom.vaadin.testbench.TestBenchElementDeprecated, for removal: This API element is subject to removal in a future version.Pre v25.0, this method returned either the editor overlay, when the editor was displayed as a dialog, or the Crud itself, when the editor was displayed inline.com.vaadin.flow.component.button.testbench.ButtonElementGets the editor cancel buttoncom.vaadin.flow.component.button.testbench.ButtonElementGets the editor delete buttonGets the editor position selected for the CRUD Possible values are "" (default), "bottom" and "aside"com.vaadin.flow.component.button.testbench.ButtonElementGets the editor save buttonList<com.vaadin.flow.component.textfield.testbench.TextFieldElement> Gets the filter fields if the Crud built-in Grid is being used with filters enabledcom.vaadin.testbench.TestBenchElementgetForm()Gets the form element that contains form fields.com.vaadin.flow.component.grid.testbench.GridElementgetGrid()Gets the crud gridOptional<com.vaadin.testbench.TestBenchElement> Gets the new item buttonList<com.vaadin.testbench.TestBenchElement> Gets the toolbar content.booleanGets whether editor can be opened by a click on the row or notbooleanChecks if the editor is open, either as inline editor or as a dialogvoidopenRowForEditing(int row) Opens a grid row for editing using the CRUD edit button on that rowMethods inherited from class com.vaadin.testbench.TestBenchElement
callFunction, clear, click, click, compareScreen, compareScreen, compareScreen, contextClick, dispatchEvent, dispatchEvent, doubleClick, equals, executeScript, findElement, findElements, focus, getAttribute, getCapabilities, getChildren, getClassNames, getCommandExecutor, getContext, getCssValue, getDomAttribute, getDomProperty, getDriver, getId, getLocation, getParent, getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, getRect, getScreenshotAs, getShadowRoot, getSize, getTagName, getText, getWrappedElement, hasAttribute, hasClassName, hashCode, hover, init, init, isChrome, isDisplayed, isEnabled, isFirefox, isFocused, isReadOnly, isSelected, scroll, scrollIntoView, scrollLeft, sendKeys, setProperty, setProperty, setProperty, setProperty, submit, waitForVaadin, waitUntil, waitUntil, wrap, wrapElement, wrapElementsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.testbench.HasElementQuery
$, $Methods inherited from interface org.openqa.selenium.WebElement
getAccessibleName, getAriaRole
-
Constructor Details
-
CrudElement
public CrudElement()
-
-
Method Details
-
getGrid
public com.vaadin.flow.component.grid.testbench.GridElement getGrid()Gets the crud grid- Returns:
- the crud grid
-
getNewItemButton
Gets the new item button- Returns:
- the new item button
-
getFilterFields
Gets the filter fields if the Crud built-in Grid is being used with filters enabled- Returns:
- the filter field for each column
-
getToolbar
Gets the toolbar content.- Returns:
- the toolbar content
-
openRowForEditing
public void openRowForEditing(int row) Opens a grid row for editing using the CRUD edit button on that row- Parameters:
row- the row to open for editing
-
getEditorSaveButton
public com.vaadin.flow.component.button.testbench.ButtonElement getEditorSaveButton()Gets the editor save button- Returns:
- the editor save button
-
getEditorCancelButton
public com.vaadin.flow.component.button.testbench.ButtonElement getEditorCancelButton()Gets the editor cancel button- Returns:
- the editor cancel button
-
getEditorDeleteButton
public com.vaadin.flow.component.button.testbench.ButtonElement getEditorDeleteButton()Gets the editor delete button- Returns:
- the editor delete button
-
isEditorOpen
public boolean isEditorOpen()Checks if the editor is open, either as inline editor or as a dialog- Returns:
trueif the editor is open andfalse, otherwise
-
getEditorPosition
Gets the editor position selected for the CRUD Possible values are "" (default), "bottom" and "aside"- Returns:
- a string containing the value defined for the editor position
-
isEditOnClick
public boolean isEditOnClick()Gets whether editor can be opened by a click on the row or not- Returns:
trueif feature is enabled orfalseotherwise
-
getEditor
Deprecated, for removal: This API element is subject to removal in a future version.Pre v25.0, this method returned either the editor overlay, when the editor was displayed as a dialog, or the Crud itself, when the editor was displayed inline. Since v25.0, the overlay is not accessible as a separate element anymore, and, regardless whether the editor is displayed as a dialog or inline, all editor-related controls can be queried through the Crud element itself. To specifically access the editor fields, usegetForm()instead. To access the editor buttons, usegetEditorSaveButton(),getEditorCancelButton(), andgetEditorDeleteButton().Since v25.0, returns the Crud element itself for backwards compatibility.- Returns:
- the Crud element itself
-
getForm
public com.vaadin.testbench.TestBenchElement getForm()Gets the form element that contains form fields.- Returns:
- the form element
-
getConfirmCancelDialog
public com.vaadin.flow.component.confirmdialog.testbench.ConfirmDialogElement getConfirmCancelDialog()Gets the confirm cancel dialog- Returns:
- the confirm cancel dialog
-
getConfirmDeleteDialog
public com.vaadin.flow.component.confirmdialog.testbench.ConfirmDialogElement getConfirmDeleteDialog()Gets the confirm delete dialog- Returns:
- the confirm delete dialog
-