Package allurium.primitives
Class Title
java.lang.Object
allurium.primitives.UIElement
allurium.primitives.Title
- All Implemented Interfaces:
AlluriumElement,ListComponent,WebElementMeta
Represents a `Title` element in the UI, extending `, `
UIElement.
This class encapsulates the behavior and attributes of a title element, such as headers or text elements that act as titles in the UI (e.g., `
`, ``). It provides constructors and factory methods for creating and interacting
with title elements.
Features:
- Encapsulates behavior and attributes of a title element.
- Provides constructors for flexible initialization using:
- Selenide locators as strings
- Selenium
By locators
SelenideElement instances
- Includes static factory methods for convenient creation of `Title` instances.
Purpose:
- Standardizes interaction with title elements in the UI.
- Simplifies creation and management of title elements in tests.
Constructors:
Title() - Default constructor.
Title(String) - Creates a `Title` using a Selenide locator string.
Title(String, String) - Creates a `Title` using a Selenide locator string and a name.
Title(By) - Creates a `Title` using a Selenium By locator.
Title(By, String) - Creates a `Title` using a Selenium By locator and a name.
Title(SelenideElement) - Creates a `Title` using a SelenideElement.
Title(SelenideElement, String) - Creates a `Title` using a SelenideElement and a name.
Static Factory Methods:
$title(By) - Creates a `Title` using a Selenium By locator.
$title(By, String) - Creates a `Title` using a Selenium By locator and a name.
$title(SelenideElement) - Creates a `Title` using a SelenideElement.
$title(SelenideElement, String) - Creates a `Title` using a SelenideElement and a name.
$title(String) - Creates a `Title` using a Selenide locator string.
$title(String, String) - Creates a `Title` using a Selenide locator string and a name.
_$title(String) - Creates a `Title` using an XPath expression.
Usage Example:
// Creating a title using a Selenide locator
Title title = $title("h1.page-title");
// Creating a title with a custom name
Title namedTitle = $title(By.cssSelector("h1.page-title"), "Main Page Title");
Features:
- Encapsulates behavior and attributes of a title element.
- Provides constructors for flexible initialization using:
- Selenide locators as strings
- Selenium
Bylocators SelenideElementinstances
- Includes static factory methods for convenient creation of `Title` instances.
Purpose:
- Standardizes interaction with title elements in the UI.
- Simplifies creation and management of title elements in tests.
Constructors:
Title()- Default constructor.Title(String)- Creates a `Title` using a Selenide locator string.Title(String, String)- Creates a `Title` using a Selenide locator string and a name.Title(By)- Creates a `Title` using a SeleniumBylocator.Title(By, String)- Creates a `Title` using a SeleniumBylocator and a name.Title(SelenideElement)- Creates a `Title` using aSelenideElement.Title(SelenideElement, String)- Creates a `Title` using aSelenideElementand a name.
Static Factory Methods:
$title(By)- Creates a `Title` using a SeleniumBylocator.$title(By, String)- Creates a `Title` using a SeleniumBylocator and a name.$title(SelenideElement)- Creates a `Title` using aSelenideElement.$title(SelenideElement, String)- Creates a `Title` using aSelenideElementand a name.$title(String)- Creates a `Title` using a Selenide locator string.$title(String, String)- Creates a `Title` using a Selenide locator string and a name._$title(String)- Creates a `Title` using an XPath expression.
Usage Example:
// Creating a title using a Selenide locator
Title title = $title("h1.page-title");
// Creating a title with a custom name
Title namedTitle = $title(By.cssSelector("h1.page-title"), "Main Page Title");
-
Field Summary
Fields inherited from class allurium.primitives.UIElement
assignNameMethod, description, id, parent, root, stepsConsoleLoggingEnabled, stepsReportLoggingEnabled, uiElementName, uiElementType -
Constructor Summary
ConstructorsConstructorDescriptionTitle()Default constructor.Title(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes a `Title` element using aSelenideElement.Constructor that initializes a `Title` element using aSelenideElementand a name.Constructor that initializes a `Title` element using a Selenide locator string.Constructor that initializes a `Title` element using a Selenide locator string and a name.Title(org.openqa.selenium.By locator) Constructor that initializes a `Title` element using a SeleniumBylocator.Constructor that initializes a `Title` 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
-
Title
public Title()Default constructor. Initializes the element type as "title". -
Title
Constructor that initializes a `Title` element using a Selenide locator string.- Parameters:
selenideLocator- the Selenide locator as a string
-
Title
Constructor that initializes a `Title` element using a Selenide locator string and a name.- Parameters:
selenideLocator- the Selenide locator as a stringname- the name of the title element
-
Title
public Title(org.openqa.selenium.By locator) Constructor that initializes a `Title` element using a SeleniumBylocator.- Parameters:
locator- the Selenium locator for the title element
-
Title
Constructor that initializes a `Title` element using a SeleniumBylocator and a name.- Parameters:
locator- the Selenium locator for the title elementname- the name of the title element
-
Title
public Title(com.codeborne.selenide.SelenideElement selenideElement) Constructor that initializes a `Title` element using aSelenideElement.- Parameters:
selenideElement- the Selenide element representing the title element
-
Title
Constructor that initializes a `Title` element using aSelenideElementand a name.- Parameters:
selenideElement- the Selenide element representing the title elementname- the name of the title element
-
-
Method Details
-
$title
-
$title
-
$title
-
$title
-
$title
-
$title
-
_$title
-