import {MatInputHarness} from '@angular/material/input/testing';
MatInputHarness
extends
MatFormFieldControlHarness
Harness for interacting with a standard Material inputs in tests.
Name | Description |
---|---|
|
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
isFocused
|
|
---|---|
Whether the input is focused. |
|
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. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options InputHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatInputHarness>
|
a |
MatNativeSelectHarness
extends
MatFormFieldControlHarness
Harness for interacting with a native select
in tests.
Name | Description |
---|---|
|
async
blur
|
|
---|---|
Blurs the select and returns a void promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the select and returns a void 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 select. |
|
Returns | |
Promise<string>
|
|
async
getName
|
|
---|---|
Gets the name of the select. |
|
Returns | |
Promise<string>
|
|
async
getOptions
|
|
---|---|
Gets the options inside the select panel. |
|
Parameters | |
filter NativeOptionHarnessFilters = {}
|
|
Returns | |
Promise<MatNativeOptionHarness[]>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Gets a boolean promise indicating if the select is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isFocused
|
|
---|---|
Whether the select is focused. |
|
Returns | |
Promise<boolean>
|
|
async
isMultiple
|
|
---|---|
Gets a boolean promise indicating if the select is in multi-selection mode. |
|
Returns | |
Promise<boolean>
|
|
async
isRequired
|
|
---|---|
Gets a boolean promise indicating if the select is required. |
|
Returns | |
Promise<boolean>
|
|
async
selectOptions
|
|
---|---|
Selects the options that match the passed-in filter. If the select is in multi-selection mode all options will be clicked, otherwise the harness will pick the first matching option. |
|
Parameters | |
filter NativeOptionHarnessFilters = {}
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options NativeSelectHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatNativeSelectHarness>
|
a |
MatNativeOptionHarness
extends
ComponentHarness
Harness for interacting with a native option
in tests.
Name | Description |
---|---|
|
Selector used to locate option instances. |
async
getIndex
|
|
---|---|
Index of the option within the native |
|
Returns | |
Promise<number>
|
|
async
getText
|
|
---|---|
Gets the option's label text. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isDisabled
|
|
---|---|
Gets whether the option is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isSelected
|
|
---|---|
Gets whether the option is selected. |
|
Returns | |
Promise<boolean>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options NativeOptionHarnessFilters = {}
|
|
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. |
NativeSelectHarnessFilters
A set of criteria that can be used to filter a list of MatNativeSelectHarness
instances.
NativeOptionHarnessFilters
A set of criteria that can be used to filter a list of MatNativeOptionHarness
instances.
Name | Description |
---|---|
|
|
|
|
|