Package com.vaadin.testbench
Interface HasValidation
- All Superinterfaces:
HasCallFunction,HasElementQuery,HasPropertySettersGetters,HasSearchContext,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement
- All Known Implementing Classes:
BigDecimalFieldElement,CheckboxElement,CheckboxGroupElement,ComboBoxElement,CustomFieldElement,DatePickerElement,DateTimePickerElement,EmailFieldElement,IntegerFieldElement,MultiSelectComboBoxElement,NumberFieldElement,PasswordFieldElement,RadioButtonGroupElement,SelectElement,TextAreaElement,TextFieldElement,TimePickerElement
Implement by elements which support a error message, required indicator and
invalid state.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringGets the error message for the element.default booleanChecks if the current element is marked as invalid.default booleanChecks if the current element has the "required" attribute.Methods inherited from interface com.vaadin.testbench.HasCallFunction
callFunctionMethods inherited from interface com.vaadin.testbench.HasElementQuery
$, $Methods inherited from interface com.vaadin.testbench.HasPropertySettersGetters
getProperty, getPropertyBoolean, getPropertyDouble, getPropertyElement, getPropertyElements, getPropertyInteger, getPropertyString, setProperty, setProperty, setProperty, setPropertyMethods inherited from interface com.vaadin.testbench.HasSearchContext
getContextMethods inherited from interface org.openqa.selenium.TakesScreenshot
getScreenshotAsMethods inherited from interface org.openqa.selenium.WebElement
clear, click, findElement, findElements, getAccessibleName, getAriaRole, getAttribute, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getShadowRoot, getSize, getTagName, getText, isDisplayed, isEnabled, isSelected, sendKeys, submit
-
Method Details
-
isInvalid
default boolean isInvalid()Checks if the current element is marked as invalid.- Returns:
trueif the "invalid" attribute exists otherwisefalse
-
isRequired
default boolean isRequired()Checks if the current element has the "required" attribute.- Returns:
trueif the element has the "required" attribute,falseotherwise.
-
getErrorMessage
Gets the error message for the element.- Returns:
- the error message or an empty string if there is no message
-