Class MenuItem

java.lang.Object
allurium.primitives.UIElement
allurium.primitives.MenuItem
All Implemented Interfaces:
AlluriumElement, ListComponent, WebElementMeta

public class MenuItem extends UIElement
Represents a `MenuItem` element in the UI, extending UIElement.

This class encapsulates the behavior and attributes of menu item elements (`

  • ` or similar elements) commonly used in navigation menus or dropdowns in a user interface.

    Features:

    • Encapsulates behavior and attributes of menu item elements.
    • Supports initialization using various constructors and static factory methods.
    • Provides a consistent interface for interacting with menu items in UI tests.

    Purpose:

    • Standardizes the interaction with menu item elements in the UI.
    • Simplifies the creation and manipulation of menu item elements in tests.

    Constructors:

    Static Factory Methods:

    Usage Example:

     
     // Creating a menu item using a Selenide locator
     MenuItem menuItem = MenuItem.$menuItem("ul > li.menu-item");
    
     // Creating a menu item with a custom name
     MenuItem namedMenuItem = MenuItem.$menuItem(By.cssSelector(".menu-item"), "Custom Menu Item");
     
     
    • Constructor Details

      • MenuItem

        public MenuItem()
      • MenuItem

        public MenuItem(String selenideLocator)
      • MenuItem

        public MenuItem(String selenideLocator, String name)
      • MenuItem

        public MenuItem(org.openqa.selenium.By locator)
      • MenuItem

        public MenuItem(org.openqa.selenium.By locator, String name)
      • MenuItem

        public MenuItem(com.codeborne.selenide.SelenideElement selenideElement)
      • MenuItem

        public MenuItem(com.codeborne.selenide.SelenideElement selenideElement, String name)
    • Method Details

      • _$menuItem

        public static MenuItem _$menuItem(String xpath)
      • $menuItem

        public static MenuItem $menuItem(org.openqa.selenium.By locator)
      • $menuItem

        public static MenuItem $menuItem(org.openqa.selenium.By locator, String name)
      • $menuItem

        public static MenuItem $menuItem(com.codeborne.selenide.SelenideElement selenideElement)
      • $menuItem

        public static MenuItem $menuItem(com.codeborne.selenide.SelenideElement selenideElement, String name)
      • $menuItem

        public static MenuItem $menuItem(String selenideLocator)
      • $menuItem

        public static MenuItem $menuItem(String selenideLocator, String name)