UNPKG

@vibe/testkit

Version:
40 lines 1.41 kB
import { Page, Locator } from "@playwright/test"; import { BaseElement } from "./BaseElement"; /** * Class representing a Toggle element. * Extends the BaseElement class. */ export declare class Toggle extends BaseElement { private inputLocator; private buttonLocator; /** * Create a Toggle element. Can handle both wrapper elements that contain input and button elements, * or direct input elements. * @param {Page} page - The Playwright page object. * @param {Locator} locator - The locator for either the wrapper element or the input element directly. * @param {string} elementReportName - The name for reporting purposes. */ constructor(page: Page, locator: Locator, elementReportName: string); /** * Get the input element, dynamically determining the correct locator. * @private */ private getInput; /** * Get the button element, dynamically determining the correct locator. * @private */ private getButton; /** * Set the toggle state. * @param {boolean} isToCheck - True to turn on the toggle, false to turn off. * @returns {Promise<void>} */ set(isToCheck: boolean): Promise<void>; /** * Check if the toggle is on. * @returns {Promise<boolean>} True if the toggle is on, false otherwise. */ isOn(): Promise<boolean>; } //# sourceMappingURL=Toggle.d.ts.map