Class AbstractRequiredTextField

All Implemented Interfaces:
AlluriumElement, InputElement, ListComponent, RequiredInput, TextInputAsserts, WebElementMeta, Writable

public abstract class AbstractRequiredTextField extends TextField implements RequiredInput
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:
  • 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.
  • Constructor Details

    • AbstractRequiredTextField

      public AbstractRequiredTextField()
      Default constructor. Initializes the element type as "textfield_required".
    • AbstractRequiredTextField

      public AbstractRequiredTextField(String selenideLocator)
      Constructor that initializes a required text field using a Selenide locator string.
      Parameters:
      selenideLocator - the Selenide locator as a string
    • AbstractRequiredTextField

      public AbstractRequiredTextField(String selenideLocator, String name)
      Constructor that initializes a required text field using a Selenide locator string and a name.
      Parameters:
      selenideLocator - the Selenide locator as a string
      name - the name of the required text field
    • AbstractRequiredTextField

      public AbstractRequiredTextField(org.openqa.selenium.By locator)
      Constructor that initializes a required text field using a Selenium By locator.
      Parameters:
      locator - the Selenium locator for the required text field
    • AbstractRequiredTextField

      public AbstractRequiredTextField(org.openqa.selenium.By locator, String name)
      Constructor that initializes a required text field using a Selenium By locator and a name.
      Parameters:
      locator - the Selenium locator for the required text field
      name - 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 field
      name - 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 interface RequiredInput
      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 interface RequiredInput
    • assertNotMarkedAsRequired

      public void assertNotMarkedAsRequired()
      Asserts that the text field is not marked as required.

      Step: Processed by Aspect

      Specified by:
      assertNotMarkedAsRequired in interface RequiredInput