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
,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 String
Gets the error message for the element.default boolean
Checks if the current element is marked as invalid.default boolean
Checks if the current element has the "required" attribute.Methods inherited from interface com.vaadin.testbench.HasCallFunction
callFunction
Methods 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, setProperty
Methods inherited from interface com.vaadin.testbench.HasSearchContext
getContext
Methods inherited from interface org.openqa.selenium.TakesScreenshot
getScreenshotAs
Methods 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:
true
if the "invalid" attribute exists otherwisefalse
-
isRequired
default boolean isRequired()Checks if the current element has the "required" attribute.- Returns:
true
if the element has the "required" attribute,false
otherwise.
-
getErrorMessage
Gets the error message for the element.- Returns:
- the error message or an empty string if there is no message
-