UNPKG

@vibe/testkit

Version:
76 lines 2.61 kB
import { Page, Locator } from "@playwright/test"; import { BaseElement } from "./BaseElement"; /** * Class representing an ExpandCollapse element. * Extends the BaseElement class. */ export declare class ExpandCollapse extends BaseElement { private headerButton; private content; /** * Create an ExpandCollapse element. * @param {Page} page - The Playwright page object. * @param {Locator} locator - The locator for the ExpandCollapse element. * @param {string} elementReportName - The name for reporting purposes. */ constructor(page: Page, locator: Locator, elementReportName: string); /** * Click the header to toggle expand/collapse state. * @returns {Promise<void>} */ toggle(): Promise<void>; /** * Expand the component if it's currently collapsed. * @returns {Promise<void>} */ expand(): Promise<void>; /** * Collapse the component if it's currently expanded. * @returns {Promise<void>} */ collapse(): Promise<void>; /** * Check if the component is collapsed. * @returns {Promise<boolean>} True if collapsed, false if expanded. */ isCollapsed(): Promise<boolean>; /** * Get the header/title text. * @returns {Promise<string>} The header text content. */ getHeaderText(): Promise<string>; /** * Check if the content section is visible. * @returns {Promise<boolean>} True if content is visible, false otherwise. */ isContentVisible(): Promise<boolean>; /** * Get the content element for further interactions. * @returns {BaseElement} The content element wrapped in BaseElement. */ getContentElement(): BaseElement; /** * Get the content text. * @returns {Promise<string>} The content text. */ getContentText(): Promise<string>; /** * Click on an item within the content area by its text. * @param {string} itemText - The text of the item to click. * @returns {Promise<void>} */ clickItemByText(itemText: string): Promise<void>; /** * Click on an item within the content area by exact text match. * @param {string} itemText - The exact text of the item to click. * @returns {Promise<void>} */ clickItemByExactText(itemText: string): Promise<void>; /** * Click on a link within the content area by its text. * @param {string} linkText - The text of the link to click. * @returns {Promise<void>} */ clickLinkInContent(linkText: string): Promise<void>; } //# sourceMappingURL=ExpandCollapse.d.ts.map