import { a11ySnapshot as snap } from '@web/test-runner-commands'; export interface A11yTreeSnapshot { name: string; role: string; children?: A11yTreeSnapshot[]; checked?: boolean; disabled?: boolean; description?: string; expanded?: boolean; focused?: boolean; haspopup?: string; level?: number; selected?: boolean; value?: number; valuetext?: string; valuemin?: number; valuemax?: number; } /** * @param payload e.g. { selector: 'pf-select' } */ export declare function a11ySnapshot(payload?: Parameters[0]): Promise; type SnapshotQuery = Partial>; /** * Deeply search an accessibility tree snapshot for an object matching your query * @param snapshot the snapshot root to recurse through * @param query object with properties matching the snapshot child you seek */ export declare function querySnapshot(snapshot: A11yTreeSnapshot, query: SnapshotQuery): A11yTreeSnapshot | null; /** * Deeply search an accessibility tree snapshot for all objects matching your query * @param snapshot the snapshot root to recurse through * @param query object with properties matching the snapshot children you seek */ export declare function querySnapshotAll(snapshot: A11yTreeSnapshot, query: SnapshotQuery): A11yTreeSnapshot[]; /** @see https://w3c.github.io/aria/#ref-for-dom-ariamixin-ariaactivedescendantelement-1 */ declare global { interface ARIAMixin { ariaActiveDescendantElement: Element | null; ariaControlsElements: readonly Element[] | null; ariaDescribedByElements: readonly Element[] | null; ariaDetailsElements: readonly Element[] | null; ariaErrorMessageElements: readonly Element[] | null; ariaFlowToElements: readonly Element[] | null; ariaLabelledByElements: readonly Element[] | null; ariaOwnsElements: readonly Element[] | null; } } declare global { namespace Chai { interface Assertion { /** Assert that the a11ySnapshot contains a node with the given name */ axContainName(name: string, msg?: string): Assertion; /** Assert that a given role exists in the ax tree */ axContainRole(role: string, msg?: string): Assertion; /** Assert that a node matching a given query object exists in the ax tree */ axContainQuery(query: SnapshotQuery, msg?: string): Assertion; /** * Assert that an AX Tree node that matches the query object exists in the tre */ axQuery(query: SnapshotQuery, msg?: string): Assertion; /** * Assert that the a11ySnapshot shows that a given element has focus. * This assertion ultimately matches on the accessible name of the given element, * so test authors must ensure that every element has a unique accessible name * (i.e. aria-label or textContent). */ axTreeFocusOn(element?: Element | null, msg?: string): Assertion; /** * Assert that the a11ySnapshot shows that a given element has focus. * This assertion ultimately matches on the accessible name of the given element, * so test authors must ensure that every element has a unique accessible name * (i.e. aria-label or textContent). */ axTreeFocusedNode: Assertion; /** Assert that an AX Tree node has a given role */ axRole(role: string, msg?: string): Assertion; /** Assert that an AX Tree node has a given name */ axName(role: string, msg?: string): Assertion; /** Assert that an AX Tree node has a given description */ axDescription(description: string, msg?: string): Assertion; /** Assert that an AX Tree node has a given property with a given value */ axProperty(propName: keyof A11yTreeSnapshot, value: A11yTreeSnapshot[keyof A11yTreeSnapshot], msg?: string): Assertion; } } } export {};