/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ElementDimensions, ModifierKeys, TestElement, TestKey, TextOptions, EventData } from '@angular/cdk/testing'; /** A `TestElement` implementation for unit tests. */ export declare class UnitTestElement implements TestElement { readonly element: Element; private _stabilize; constructor(element: Element, _stabilize: () => Promise); /** Blur the element. */ blur(): Promise; /** Clear the element's input (for input and textarea elements only). */ clear(): Promise; /** * Click the element at the default location for the current environment. If you need to guarantee * the element is clicked at a specific location, consider using `click('center')` or * `click(x, y)` instead. */ click(modifiers?: ModifierKeys): Promise; /** Click the element at the element's center. */ click(location: 'center', modifiers?: ModifierKeys): Promise; /** * Click the element at the specified coordinates relative to the top-left of the element. * @param relativeX Coordinate within the element, along the X-axis at which to click. * @param relativeY Coordinate within the element, along the Y-axis at which to click. * @param modifiers Modifier keys held while clicking */ click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise; /** * Right clicks on the element at the specified coordinates relative to the top-left of it. * @param relativeX Coordinate within the element, along the X-axis at which to click. * @param relativeY Coordinate within the element, along the Y-axis at which to click. * @param modifiers Modifier keys held while clicking */ rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise; /** Focus the element. */ focus(): Promise; /** Get the computed value of the given CSS property for the element. */ getCssValue(property: string): Promise; /** Hovers the mouse over the element. */ hover(): Promise; /** Moves the mouse away from the element. */ mouseAway(): Promise; /** * Sends the given string to the input as a series of key presses. Also fires input events * and attempts to add the string to the Element's value. */ sendKeys(...keys: (string | TestKey)[]): Promise; /** * Sends the given string to the input as a series of key presses. Also fires input events * and attempts to add the string to the Element's value. */ sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise; /** * Gets the text from the element. * @param options Options that affect what text is included. */ text(options?: TextOptions): Promise; /** Gets the value for the given attribute from the element. */ getAttribute(name: string): Promise; /** Checks whether the element has the given class. */ hasClass(name: string): Promise; /** Gets the dimensions of the element. */ getDimensions(): Promise; /** Gets the value of a property of an element. */ getProperty(name: string): Promise; /** Sets the value of a property of an input. */ setInputValue(value: string): Promise; /** Selects the options at the specified indexes inside of a native `select` element. */ selectOptions(...optionIndexes: number[]): Promise; /** Checks whether this element matches the given selector. */ matchesSelector(selector: string): Promise; /** Checks whether the element is focused. */ isFocused(): Promise; /** * Dispatches an event with a particular name. * @param name Name of the event to be dispatched. */ dispatchEvent(name: string, data?: Record): Promise; /** * Dispatches a pointer event on the current element if the browser supports it. * @param name Name of the pointer event to be dispatched. * @param clientX Coordinate of the user's pointer along the X axis. * @param clientY Coordinate of the user's pointer along the Y axis. * @param button Mouse button that should be pressed when dispatching the event. */ private _dispatchPointerEventIfSupported; /** Dispatches all the events that are part of a mouse event sequence. */ private _dispatchMouseEventSequence; }