import {MatInputHarness} from '@angular/material/input/testing';
MatInputHarness
extends
MatFormFieldControlHarness
Harness for interacting with a standard Material inputs in tests.
async
blur
|
|
---|---|
Blurs the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getId
|
|
---|---|
Gets the id of the input. |
|
Returns | |
Promise<string>
|
|
async
getName
|
|
---|---|
Gets the name of the input. |
|
Returns | |
Promise<string>
|
|
async
getPlaceholder
|
|
---|---|
Gets the placeholder of the input. |
|
Returns | |
Promise<string>
|
|
async
getType
|
|
---|---|
Gets the type of the input. Returns "textarea" if the input is a textarea. |
|
Returns | |
Promise<string>
|
|
async
getValue
|
|
---|---|
Gets the value of the input. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Whether the input is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isReadonly
|
|
---|---|
Whether the input is readonly. |
|
Returns | |
Promise<boolean>
|
|
async
isRequired
|
|
---|---|
Whether the input is required. |
|
Returns | |
Promise<boolean>
|
|
async
setValue
|
|
---|---|
Sets the value of the input. The value will be set by simulating keypresses that correspond to the given value. |
|
Parameters | |
newValue string
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
InputHarnessFilters
A set of criteria that can be used to filter a list of MatInputHarness
instances.
Name | Description |
---|---|
|
Filters based on the placeholder text of the input. |
|
Filters based on the value of the input. |