UNPKG

webdriverio

Version:

Next-gen browser and mobile automation test framework for Node.js

74 lines • 4.07 kB
/** Check if the experimental Bidi commands capability is enabled. Merges the * `browser.isBidi` check so callers don't need to test both separately. */ export declare function isBidiCommandsEnabled(browser: WebdriverIO.Browser): boolean; /** * Inspired by the Selenium atom: bot.action.clear() * @see https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/atoms/action.js */ export declare function bidiClearValue(element: WebdriverIO.Element): Promise<void>; /** * Inspired by the Selenium atom: bot.action.type(), dispatched via * webdriver.atoms.inputs.sendKeys → webdriver.atoms.element.type. * @see https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/atoms/action.js * * NOTE: The atom dispatches per-character keydown→keypress→keyup events. * We cannot do that from browser.execute() — JS cannot create trusted * KeyboardEvent instances. Use the Actions API (browser.keys()) if your * app relies on individual key events. */ export declare function bidiAddValue(element: WebdriverIO.Element, value: string): Promise<void>; /** * Types `value` through BiDi key actions so the text can be redacted from logs * and `bidiCommand` events via `BIDI_MASK`. `typeKeys` also serves unmasked * values holding special keys. Unlike `elementSendKeys`, this * reaches the element's own tab in parallel mode and held browsing contexts. */ export declare function bidiAddMaskedValue(element: WebdriverIO.Element, value: string): Promise<void>; /** * Restores chromedriver's "element click intercepted" check for Actions-based * clicks: scrolls the element to the center if needed, then verifies the * element (or a descendant) is what sits at its center point. */ export declare function bidiAssertClickable(element: WebdriverIO.Element): Promise<void>; export declare function bidiGetText(element: WebdriverIO.Element): Promise<string>; export declare function bidiGetValue(element: WebdriverIO.Element): Promise<string>; /** * W3C Get Element Attribute: boolean attributes → 'true' if present, else the raw attribute value. * @see https://w3c.github.io/webdriver/#get-element-attribute */ export declare function bidiGetAttribute(element: WebdriverIO.Element, name: string): Promise<string | null>; export declare function bidiGetTagName(element: WebdriverIO.Element): Promise<string>; export declare function bidiGetProperty(element: WebdriverIO.Element, property: string): Promise<unknown>; export declare function bidiGetRect(element: WebdriverIO.Element): Promise<{ x: number; y: number; width: number; height: number; }>; /** * Returns the raw computed CSS value. The caller (`parseCSS`) handles * color conversion, unit parsing, and shorthand expansion — same as * the classic protocol path. */ export declare function bidiGetCSSProperty(element: WebdriverIO.Element, cssProperty: string): Promise<string>; export type BidiDisabledSource = 'option' | 'optgroup' | 'select'; export interface BidiSelectResult { selected: boolean; count: number; disabled?: BidiDisabledSource; } export declare function bidiSelectByVisibleText(element: WebdriverIO.Element, text: string): Promise<BidiSelectResult>; /** * Checks both the HTML attribute (getAttribute) and the DOM property — they * can diverge (e.g. option.value vs option.getAttribute('value')). */ export declare function bidiSelectByAttribute(element: WebdriverIO.Element, attribute: string, value: string): Promise<BidiSelectResult>; export declare function bidiSelectByIndex(element: WebdriverIO.Element, index: number): Promise<BidiSelectResult>; /** * Builds the error for a select command that hit a disabled element, so * the test does not pass on an action a user cannot perform. */ export declare function bidiDisabledSelectError(command: string, option: string, source: BidiDisabledSource): Error; export declare function bidiIsSelected(element: WebdriverIO.Element): Promise<boolean>; export declare function bidiIsEnabled(element: WebdriverIO.Element): Promise<boolean>; //# sourceMappingURL=elementCommands.d.ts.map