UNPKG

e2ed

Version:

E2E testing framework over Playwright

66 lines (65 loc) 2.77 kB
import { type AttributesOptions, type Stringifiable } from '../../createLocator'; import type { Locator as PlaywrightLocator } from '@playwright/test'; type Args = readonly (RegExp | number | string)[]; type Kind = 'css' | 'filter' | 'find' | 'nth' | 'parent' | 'withText'; type Options = Readonly<{ args?: Args | undefined; cssString: string; kind?: Kind; parentSelector?: Selector; }> & AttributesOptions; /** * Selector. */ declare class Selector { readonly description: string; private readonly args; private readonly cssString; private readonly kind; private readonly locator; private readonly parameterAttributePrefix; private readonly parentSelector; private readonly testIdAttribute; private readonly testIdSeparator; protected constructor({ args, cssString, kind, parameterAttributePrefix, parentSelector, testIdAttribute, testIdSeparator, }: Options); get boundingClientRect(): Promise<DOMRectReadOnly>; get checked(): Promise<boolean | null>; get count(): Promise<number>; get exists(): Promise<boolean>; get scrollHeight(): Promise<number>; get scrollLeft(): Promise<number>; get scrollTop(): Promise<number>; get scrollWidth(): Promise<number>; get textContent(): Promise<string>; get value(): Promise<string | null>; get visible(): Promise<boolean>; static create({ cssString, parameterAttributePrefix, testIdAttribute, testIdSeparator, }: Pick<Options, keyof AttributesOptions | 'cssString'>): Selector; createSelector(cssString: string): Selector; filter(cssSelectorString: string): Selector; filterByLocatorParameter(parameter: string, value: string): Selector; filterByTestId(...args: readonly [Stringifiable, ...Stringifiable[]]): Selector; find(cssSelectorString: string): Selector; findByLocatorParameter(parameter: string, value: string): Selector; findByTestId(...args: readonly [Stringifiable, ...Stringifiable[]]): Selector; getAttribute(attributeName: string): Promise<string | null>; getLocatorParameter(parameter: string): Promise<string | null>; getPlaywrightLocator(): PlaywrightLocator; getStyleProperty(propertyName: string): Promise<string>; getTestId(): Promise<string | null>; hasAttribute(attributeName: string): Promise<boolean>; hasLocatorParameter(parameter: string): Promise<boolean>; hasTestId(): Promise<boolean>; nth(index: number): Selector; parent(): Selector; toJSON(): { description: string; }; /** * Custom string presentation of selector. */ toString(): string; withText(textOrRegExp: RegExp | string): Selector; private createChildSelector; private getParameterAttribute; } export { Selector };