Package allurium.inputs
Class AbstractRequiredTextField
java.lang.Object
allurium.primitives.UIElement
allurium.inputs.AbstractInputElement
allurium.inputs.TextField
allurium.inputs.AbstractRequiredTextField
- All Implemented Interfaces:
AlluriumElement
,InputElement
,ListComponent
,RequiredInput
,TextInputAsserts
,WebElementMeta
,Writable
Represents an abstract class for a required text field in the UI, extending
TextField
.
This class implements the RequiredInput
interface, adding functionality specific to
required text fields, such as methods to check if the field is marked as required and assert its state.
Features:
- Checks for required field indicators using
isMarked()
. - Assertions to validate the required state of the field:
assertMarkedAsRequired()
ensures the field is marked as required.assertNotMarkedAsRequired()
ensures the field is not marked as required.
- Designed for extension to implement specific behaviors of required text fields.
Purpose:
- Encapsulates behavior specific to required text fields.
- Provides utility methods for asserting required field states in tests.
-
Field Summary
Fields inherited from class allurium.primitives.UIElement
assignNameMethod, description, id, parent, root, stepsConsoleLoggingEnabled, stepsReportLoggingEnabled, uiElementName, uiElementType
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AbstractRequiredTextField
(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes a required text field using a Selenide element.AbstractRequiredTextField
(com.codeborne.selenide.SelenideElement selenideElement, String name) Constructor that initializes a required text field using a Selenide element and a name.AbstractRequiredTextField
(String selenideLocator) Constructor that initializes a required text field using a Selenide locator string.AbstractRequiredTextField
(String selenideLocator, String name) Constructor that initializes a required text field using a Selenide locator string and a name.AbstractRequiredTextField
(org.openqa.selenium.By locator) Constructor that initializes a required text field using a SeleniumBy
locator.AbstractRequiredTextField
(org.openqa.selenium.By locator, String name) Constructor that initializes a required text field using a SeleniumBy
locator and a name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Asserts that the text field is marked as required.void
Asserts that the text field is not marked as required.abstract boolean
isMarked()
Checks if the text field is marked as required.Methods inherited from class allurium.inputs.TextField
_$textField, $textField, $textField, $textField, $textField, $textField, $textField, assertCurrentValue, assertCurrentValueContains, assertEmpty, assertNotEmpty, clear, clearAndWrite, getId, pressEnter, value, write
Methods inherited from class allurium.inputs.AbstractInputElement
assertDisabled, assertEnabled, isDisabled
Methods inherited from class allurium.primitives.UIElement
_$uiElement, $uiElement, $uiElement, $uiElement, $uiElement, $uiElement, $uiElement, applyName, applyName, as, assertEquals, assertExists, assertExists, assertHasCssClass, assertHasCssClass, assertHasNotCssClass, assertHasNotCssClass, assertHasNotCssClass, assertHasText, assertIsNotEmpty, assertNotExist, assertNotExist, assertNotVisible, assertNotVisible, assertNotVisible, assertText, assertVisible, assertVisible, assertVisible, assertVisible, assertVisibleInViewport, click, click, click, click, click, clickAndHold, clickAndHold, clickAndHold, contextClick, contextClick, contextClick, doubleClick, doubleClick, doubleClick, get, getAllureCompiledStep, getAttribute, getHeight, getStepText, getUiElementName, getWidth, hover, hover, hover, isDisplayed, logStep, logStepToReport, logStepToReport, scrollTo, scrollTo, scrollTo, setRoot, setRoot, text, verifyEmpty, verifyIsNotEmpty, wrappedName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface allurium.interfaces.AlluriumElement
getRoot
Methods inherited from interface allurium.interfaces.InputElement
isDisabled
Methods inherited from interface allurium.interfaces.WebElementMeta
getDescription, getMetaKeys, getParent, setAssignNameMethod, setDescription, setParent, setUiElementName
-
Constructor Details
-
AbstractRequiredTextField
public AbstractRequiredTextField()Default constructor. Initializes the element type as "textfield_required". -
AbstractRequiredTextField
Constructor that initializes a required text field using a Selenide locator string.- Parameters:
selenideLocator
- the Selenide locator as a string
-
AbstractRequiredTextField
Constructor that initializes a required text field using a Selenide locator string and a name.- Parameters:
selenideLocator
- the Selenide locator as a stringname
- the name of the required text field
-
AbstractRequiredTextField
public AbstractRequiredTextField(org.openqa.selenium.By locator) Constructor that initializes a required text field using a SeleniumBy
locator.- Parameters:
locator
- the Selenium locator for the required text field
-
AbstractRequiredTextField
Constructor that initializes a required text field using a SeleniumBy
locator and a name.- Parameters:
locator
- the Selenium locator for the required text fieldname
- the name of the required text field
-
AbstractRequiredTextField
public AbstractRequiredTextField(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes a required text field using a Selenide element.- Parameters:
selenideElement
- the Selenide element representing the required text field
-
AbstractRequiredTextField
public AbstractRequiredTextField(com.codeborne.selenide.SelenideElement selenideElement, String name) Constructor that initializes a required text field using a Selenide element and a name.- Parameters:
selenideElement
- the Selenide element representing the required text fieldname
- the name of the required text field
-
-
Method Details
-
isMarked
public abstract boolean isMarked()Checks if the text field is marked as required.- Specified by:
isMarked
in interfaceRequiredInput
- Returns:
true
if the field is marked as required,false
otherwise
-
assertMarkedAsRequired
public void assertMarkedAsRequired()Asserts that the text field is marked as required.Step: Processed by Aspect
- Specified by:
assertMarkedAsRequired
in interfaceRequiredInput
-
assertNotMarkedAsRequired
public void assertNotMarkedAsRequired()Asserts that the text field is not marked as required.Step: Processed by Aspect
- Specified by:
assertNotMarkedAsRequired
in interfaceRequiredInput
-