Package allurium.inputs
Class RadioButton
java.lang.Object
allurium.primitives.UIElement
allurium.inputs.AbstractInputElement
allurium.inputs.RadioButton
- All Implemented Interfaces:
AlluriumElement,InputElement,ListComponent,WebElementMeta
Represents a radio button input field in the UI, extending
AbstractInputElement.
This class encapsulates the behavior and interactions specific to radio button elements,
providing utility methods for initialization and handling through locators or pre-existing
SelenideElement instances.
Features:
- Encapsulates radio button behavior in the UI.
- Supports multiple initialization options (locators, Selenide elements, etc.).
- Integration-ready with Allure for enhanced reporting.
Usage Example:
// Using a CSS selector
RadioButton radioButton = new RadioButton("#radio1");
radioButton.assertEnabled();
// Using a Selenium By locator
RadioButton radioButtonBy = $radioButton(By.id("radio1"));
radioButtonBy.assertDisabled();
Purpose:
- Standardizes interactions with radio button elements.
- Provides a consistent API for testing radio button inputs.
-
Field Summary
Fields inherited from class allurium.primitives.UIElement
assignNameMethod, description, id, parent, root, stepsConsoleLoggingEnabled, stepsReportLoggingEnabled, uiElementName, uiElementType -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.RadioButton(com.codeborne.selenide.SelenideElement selenideElement) Initializes a radio button using aSelenideElement.RadioButton(com.codeborne.selenide.SelenideElement selenideElement, String name) Initializes a radio button using aSelenideElementand a name.RadioButton(String selenideLocator) Initializes a radio button using a Selenide locator string.RadioButton(String selenideLocator, String name) Initializes a radio button using a Selenide locator string and a name.RadioButton(org.openqa.selenium.By locator) Initializes a radio button using a SeleniumBylocator.RadioButton(org.openqa.selenium.By locator, String name) Initializes a radio button using a SeleniumBylocator and a name. -
Method Summary
Modifier and TypeMethodDescriptionstatic RadioButton_$radioButton(String xpath) static RadioButton$radioButton(com.codeborne.selenide.SelenideElement selenideElement) static RadioButton$radioButton(com.codeborne.selenide.SelenideElement selenideElement, String name) static RadioButton$radioButton(String selenideLocator) static RadioButton$radioButton(String selenideLocator, String name) static RadioButton$radioButton(org.openqa.selenium.By locator) static RadioButton$radioButton(org.openqa.selenium.By locator, String name) Methods inherited from class allurium.inputs.AbstractInputElement
assertDisabled, assertEnabled, isDisabledMethods 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
-
RadioButton
public RadioButton()Default constructor. Initializes the element type as "radiobutton". -
RadioButton
Initializes a radio button using a Selenide locator string.- Parameters:
selenideLocator- the Selenide locator as a string
-
RadioButton
Initializes a radio button using a Selenide locator string and a name.- Parameters:
selenideLocator- the Selenide locator as a stringname- the name of the radio button
-
RadioButton
public RadioButton(org.openqa.selenium.By locator) Initializes a radio button using a SeleniumBylocator.- Parameters:
locator- the Selenium locator for the radio button
-
RadioButton
Initializes a radio button using a SeleniumBylocator and a name.- Parameters:
locator- the Selenium locator for the radio buttonname- the name of the radio button
-
RadioButton
public RadioButton(com.codeborne.selenide.SelenideElement selenideElement) Initializes a radio button using aSelenideElement.- Parameters:
selenideElement- the Selenide element representing the radio button
-
RadioButton
Initializes a radio button using aSelenideElementand a name.- Parameters:
selenideElement- the Selenide element representing the radio buttonname- the name of the radio button
-
-
Method Details
-
$radioButton
-
$radioButton
-
$radioButton
-
$radioButton
public static RadioButton $radioButton(com.codeborne.selenide.SelenideElement selenideElement, String name) -
$radioButton
-
$radioButton
-
_$radioButton
-