@wdio/appium-service
Version:
A WebdriverIO service to start & stop Appium Server
37 lines • 1.5 kB
TypeScript
/**
* Checks if a command is an element find command ($, $$, custom$, etc.).
* These commands return elements and should NOT be tracked as element actions.
* Based on WebdriverIO source: packages/webdriverio/src/commands/element/
* - $, $$, custom$, custom$$, shadow$, shadow$$ are marked as @type utility
* - getElement, getElements, nextElement, previousElement, parentElement are also @type utility
*/
export declare function isElementFindCommand(commandName: string): boolean;
/**
* Extracts a selector string from command arguments.
*/
export declare function extractSelectorFromArgs(args: unknown[]): string | null;
/**
* Checks if a selector is an XPath selector.
* Uses pattern matching to distinguish XPath from CSS selectors.
*
* XPath patterns detected:
* - Absolute path: /html, //div, //*
* - Relative path: ./div, ../parent
* - Descendant any: asterisk followed by slash, e.g. asterisk/child
* - Grouped expressions: (//div)[1] - must contain XPath-like content
*
* Not XPath (CSS selectors):
* - Pseudo-selectors starting with (: e.g., (:has(...))
* - Class selectors: .class
* - ID selectors: #id
* - Tag selectors: div, button
*/
export declare function isXPathSelector(selector: unknown): selector is string;
/**
* Parses an optimized selector string into WebDriver using/value format.
*/
export declare function parseOptimizedSelector(optimizedSelector: string): {
using: string;
value: string;
} | null;
//# sourceMappingURL=selector-utils.d.ts.map