@vibe/testkit
Version:
Vibe e2e testing toolkit
59 lines • 2.28 kB
TypeScript
import { Page, Locator } from "@playwright/test";
import { MenuItem } from "./MenuItem";
import { BaseElement } from "./BaseElement";
/**
* Class representing a Menu element.
* Extends the BaseElement class.
*/
export declare class Menu extends BaseElement {
/**
* Create a Menu element.
* @param {Page} page - The Playwright page object.
* @param {Locator} locator - The locator for the Menu element.
* @param {string} elementReportName - The name for reporting purposes.
*/
constructor(page: Page, locator: Locator, elementReportName: string);
/**
* Get all menu items.
* @returns {Promise<MenuItem[]>} An array of menu items.
*/
getAllMenuItems(): Promise<MenuItem[]>;
/**
* Get a menu item by its name.
* @param {string} itemName - The name of the item to retrieve.
* @returns {Promise<MenuItem>} The menu item with the specified name.
*/
getItemByName(itemName: string): Promise<MenuItem>;
/**
* Get a menu item by its index.
* @param {number} index - The index of the item to retrieve.
* @returns {Promise<MenuItem>} The menu item with the specified index.
*/
getItemByIndex(index: number): Promise<MenuItem>;
/**
* Click a menu item by its name.
* @param {string} itemName - The name of the item to click.
* @returns {Promise<void>}
*/
selectItem(itemName: string): Promise<void>;
/**
* Select a sub menu item.
* @param {string} rootItem - The name of the root item.
* @param {string} subItem - The name of the sub item.
* @returns {Promise<void>}
*/
selectSubItem(rootItem: string, subItem: string): Promise<void>;
/**
* Check if a menu item is disabled.
* @param {string} itemName - The name of the item to check.
* @returns {Promise<boolean>} True if the menu item is disabled, false otherwise.
*/
isMenuItemDisabled(itemName: string): Promise<boolean>;
/**
* Get the name of a menu item by its index.
* @param {number} index - The index of the item to retrieve.
* @returns {Promise<string>} The name of the menu item with the specified index.
*/
getMenuItemNameByIndex(index: number): Promise<string>;
}
//# sourceMappingURL=Menu.d.ts.map