@vibe/testkit
Version:
Vibe e2e testing toolkit
100 lines • 3.44 kB
TypeScript
import { Page, Locator } from "@playwright/test";
import { BaseElement } from "./BaseElement";
/**
* Class representing an EditableText element.
* Extends the BaseElement class.
*/
export declare class EditableText extends BaseElement {
/**
* Create an EditableText element.
* @param {Page} page - The Playwright page object.
* @param {Locator} locator - The locator for the EditableText element.
* @param {string} elementReportName - The name for reporting purposes.
*/
constructor(page: Page, locator: Locator, elementReportName: string);
/**
* Get the input element locator (visible in edit mode).
* @returns {Locator} The input element locator.
*/
private getInputLocator;
/**
* Get the textarea element locator (visible in edit mode for multiline).
* @returns {Locator} The textarea element locator.
*/
private getTextareaLocator;
/**
* Get the active input element (input or textarea based on multiline mode).
* @returns {Locator} The active input element locator.
*/
private getActiveInputLocator;
/**
* Enter edit mode by clicking on the component.
* @returns {Promise<void>}
*/
enterEditMode(): Promise<void>;
/**
* Exit edit mode by pressing Enter key.
* @returns {Promise<void>}
*/
exitEditModeWithEnter(): Promise<void>;
/**
* Exit edit mode by pressing Escape key (cancels changes).
* @returns {Promise<void>}
*/
exitEditModeWithEscape(): Promise<void>;
/**
* Exit edit mode by clicking outside the component.
* @returns {Promise<void>}
*/
exitEditModeWithBlur(): Promise<void>;
/**
* Set the text value in the editable text component.
* Enters edit mode, clears existing text, types new text, and confirms with Enter.
* @param {string} text - The text to set.
* @returns {Promise<void>}
*/
setText(text: string): Promise<void>;
/**
* Clear the text and set new text value.
* @param {string} text - The text to set.
* @returns {Promise<void>}
*/
clearAndSetText(text: string): Promise<void>;
/**
* Get the current text value of the editable text component.
* @returns {Promise<string>} The current text value.
*/
getText(): Promise<string>;
/**
* Get the input value when in edit mode.
* @returns {Promise<string>} The input value.
*/
getInputValue(): Promise<string>;
/**
* Check if the component is currently in edit mode.
* @returns {Promise<boolean>} True if in edit mode, false otherwise.
*/
isInEditMode(): Promise<boolean>;
/**
* Check if the component is in multiline mode.
* @returns {Promise<boolean>} True if in multiline mode, false otherwise.
*/
isMultiline(): Promise<boolean>;
/**
* Check if the component is read-only.
* @returns {Promise<boolean>} True if read-only, false otherwise.
*/
isReadOnly(): Promise<boolean>;
/**
* Type text character by character (useful for testing IME or special input scenarios).
* @param {string} text - The text to type.
* @returns {Promise<void>}
*/
typeText(text: string): Promise<void>;
/**
* Get the placeholder text.
* @returns {Promise<string>} The placeholder text.
*/
getPlaceholder(): Promise<string>;
}
//# sourceMappingURL=EditableText.d.ts.map