Package allurium.primitives
Class TextLine
java.lang.Object
allurium.primitives.UIElement
allurium.primitives.TextLine
- All Implemented Interfaces:
AlluriumElement,ListComponent,WebElementMeta
Represents a single-line text element in the UI, extending
UIElement.
This class encapsulates the behavior and attributes of a single-line text-based UI component, such as labels, input hints, or other single-line text elements.
Features:
- Encapsulates behavior and attributes of a single-line text element.
- Provides multiple constructors for flexible initialization using:
- Selenide locators as strings
- Selenium
Bylocators SelenideElementinstances
- Includes static factory methods for convenient creation of `TextLine` instances.
Purpose:
- Standardizes interaction with single-line text elements in the UI.
- Simplifies the creation and validation of single-line text elements in tests.
Constructors:
TextLine()- Default constructor.TextLine(String)- Creates a `TextLine` using a Selenide locator string.TextLine(String, String)- Creates a `TextLine` using a Selenide locator string and a name.TextLine(By)- Creates a `TextLine` using a SeleniumBylocator.TextLine(By, String)- Creates a `TextLine` using a SeleniumBylocator and a name.TextLine(SelenideElement)- Creates a `TextLine` using aSelenideElement.TextLine(SelenideElement, String)- Creates a `TextLine` using aSelenideElementand a name.
Static Factory Methods:
$textLine(By)- Creates a `TextLine` using a SeleniumBylocator.$textLine(By, String)- Creates a `TextLine` using a SeleniumBylocator and a name.$textLine(SelenideElement)- Creates a `TextLine` using aSelenideElement.$textLine(SelenideElement, String)- Creates a `TextLine` using aSelenideElementand a name.$textLine(String)- Creates a `TextLine` using a Selenide locator string.$textLine(String, String)- Creates a `TextLine` using a Selenide locator string and a name._$textLine(String)- Creates a `TextLine` using an XPath expression.
Usage Example:
// Creating a text line using a Selenide locator
TextLine textLine = $textLine(".text-line-class");
// Creating a text line with a custom name
TextLine namedTextLine = $textLine(By.cssSelector(".text-line-class"), "Header Text");
-
Field Summary
Fields inherited from class allurium.primitives.UIElement
assignNameMethod, description, id, parent, root, stepsConsoleLoggingEnabled, stepsReportLoggingEnabled, uiElementName, uiElementType -
Constructor Summary
ConstructorsConstructorDescriptionTextLine()Default constructor.TextLine(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes a `TextLine` element using aSelenideElement.Constructor that initializes a `TextLine` element using aSelenideElementand a name.Constructor that initializes a `TextLine` element using a Selenide locator string.Constructor that initializes a `TextLine` element using a Selenide locator string and a name.TextLine(org.openqa.selenium.By locator) Constructor that initializes a `TextLine` element using a SeleniumBylocator.Constructor that initializes a `TextLine` element using a SeleniumBylocator and a name. -
Method Summary
Methods inherited from class allurium.primitives.UIElement
_$uiElement, $uiElement, $uiElement, $uiElement, $uiElement, $uiElement, $uiElement, applyName, applyName, as, assertEmpty, 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, getId, getStepText, getUiElementName, getWidth, hover, hover, hover, isDisplayed, logStep, logStepToReport, logStepToReport, scrollTo, scrollTo, scrollTo, setRoot, setRoot, text, verifyEmpty, verifyIsNotEmpty, wrappedNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface allurium.interfaces.AlluriumElement
getRootMethods inherited from interface allurium.interfaces.WebElementMeta
getDescription, getMetaKeys, getParent, setAssignNameMethod, setDescription, setParent, setUiElementName
-
Constructor Details
-
TextLine
public TextLine()Default constructor. Initializes the element type as "string". -
TextLine
Constructor that initializes a `TextLine` element using a Selenide locator string.- Parameters:
selenideLocator- the Selenide locator as a string
-
TextLine
Constructor that initializes a `TextLine` element using a Selenide locator string and a name.- Parameters:
selenideLocator- the Selenide locator as a stringname- the name of the text line
-
TextLine
public TextLine(org.openqa.selenium.By locator) Constructor that initializes a `TextLine` element using a SeleniumBylocator.- Parameters:
locator- the Selenium locator for the text line
-
TextLine
Constructor that initializes a `TextLine` element using a SeleniumBylocator and a name.- Parameters:
locator- the Selenium locator for the text linename- the name of the text line
-
TextLine
public TextLine(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes a `TextLine` element using aSelenideElement.- Parameters:
selenideElement- the Selenide element representing the text line
-
TextLine
Constructor that initializes a `TextLine` element using aSelenideElementand a name.- Parameters:
selenideElement- the Selenide element representing the text linename- the name of the text line
-
-
Method Details
-
$textLine
-
$textLine
-
$textLine
-
$textLine
-
$textLine
-
$textLine
-
_$textLine
-