Class CrudElement

java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.crud.testbench.CrudElement
All Implemented Interfaces:
CanCompareScreenshots, HasCallFunction, HasDriver, HasElementQuery, HasPropertySettersGetters, HasSearchContext, HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement

public class CrudElement extends TestBenchElement
TestBench element for the vaadin-crud element
  • Constructor Details

    • CrudElement

      public CrudElement()
  • Method Details

    • getGrid

      public GridElement getGrid()
      Gets the crud grid
      Returns:
      the crud grid
    • getNewItemButton

      public Optional<TestBenchElement> getNewItemButton()
      Gets the new item button
      Returns:
      the new item button
    • getFilterFields

      public List<TextFieldElement> 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

      public List<TestBenchElement> 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 ButtonElement getEditorSaveButton()
      Gets the editor save button
      Returns:
      the editor save button
    • getEditorCancelButton

      public ButtonElement getEditorCancelButton()
      Gets the editor cancel button
      Returns:
      the editor cancel button
    • getEditorDeleteButton

      public 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:
      true if the editor is open and false, otherwise
    • getEditorPosition

      public String 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:
      true if feature is enabled or false otherwise
    • getEditor

      @Deprecated(since="25.0", forRemoval=true) public TestBenchElement 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, use getForm() instead. To access the editor buttons, use getEditorSaveButton(), getEditorCancelButton(), and getEditorDeleteButton().
      Since v25.0, returns the Crud element itself for backwards compatibility.
      Returns:
      the Crud element itself
    • getForm

      public TestBenchElement getForm()
      Gets the form element that contains form fields.
      Returns:
      the form element
    • getConfirmCancelDialog

      public ConfirmDialogElement getConfirmCancelDialog()
      Gets the confirm cancel dialog
      Returns:
      the confirm cancel dialog
    • getConfirmDeleteDialog

      public ConfirmDialogElement getConfirmDeleteDialog()
      Gets the confirm delete dialog
      Returns:
      the confirm delete dialog