API reference for Angular CDK testing-protractor

import {} from '@angular/cdk/testing/protractor';

A TestElement implementation for Protractor.

Properties
Name Description

element: ElementFinder

Methods
async
blur
Returns
Promise<void>

Promise that resolves when the action completes.

async
clear
Returns
Promise<void>

Promise that resolves when the action completes.

async
click
Parameters

...args

number[]

Returns
Promise<void>

Promise that resolves when the action completes.

async
focus
Returns
Promise<void>

Promise that resolves when the action completes.

async
getAttribute
Parameters

name

string

Returns
Promise<string | null>

async
getCssValue
Parameters

property

string

Returns
Promise<string>

async
getDimensions
Returns
Promise<ElementDimensions>

async
getProperty
Parameters

name

string

Returns
Promise<any>

async
hasClass
Parameters

name

string

Returns
Promise<boolean>

async
hover
Returns
Promise<void>

Promise that resolves when the action completes.

async
isFocused
Returns
Promise<boolean>

async
matchesSelector
Parameters

selector

string

Returns
Promise<boolean>

async
sendKeys
Parameters

...keys

(string | TestKey)[]

Returns
Promise<void>

Promise that resolves when the action completes.

async
sendKeys
Parameters

modifiers

ModifierKeys

...keys

(string | TestKey)[]

Returns
Promise<void>

Promise that resolves when the action completes.

async
setInputValue
Parameters

value

string

Returns
Promise<void>

Promise that resolves when the action completes.

async
text
Returns
Promise<string>

A HarnessEnvironment implementation for Protractor.

Properties
Name Description

rootElement: TestElement

Methods
createEnvironment
Parameters

element

any

Returns
HarnessEnvironment<ElementFinder>

createTestElement
Parameters

element

any

Returns
TestElement

documentRootLocatorFactory
Returns
LocatorFactory

async
forceStabilize
Returns
Promise<void>

Promise that resolves when the action completes.

async
getAllChildLoaders
Parameters

selector

string

Returns
Promise<HarnessLoader[]>

async
getAllHarnesses
Parameters

query

HarnessQuery<T>

Returns
Promise<T[]>

async
getAllRawElements
Parameters

selector

string

Returns
Promise<ElementFinder[]>

async
getChildLoader
Parameters

selector

string

Returns
Promise<HarnessLoader>

getDocumentRoot
Returns
ElementFinder

async
getHarness
Parameters

query

HarnessQuery<T>

Returns
Promise<T>

async
harnessLoaderFor
Parameters

selector

string

Returns
Promise<HarnessLoader>

async
harnessLoaderForAll
Parameters

selector

string

Returns
Promise<HarnessLoader[]>

async
harnessLoaderForOptional
Parameters

selector

string

Returns
Promise<HarnessLoader | null>

locatorFor
Parameters

...queries

T

Returns
AsyncFactoryFn<LocatorFnResult<T>>

locatorForAll
Parameters

...queries

T

Returns
AsyncFactoryFn<LocatorFnResult<T>[]>

locatorForOptional
Parameters

...queries

T

Returns
AsyncFactoryFn<LocatorFnResult<T> | null>

async
waitForTasksOutsideAngular
Returns
Promise<void>

Promise that resolves when the action completes.

Options to configure the environment.

Properties
Name Description

queryFn: (selector: string, root: ElementFinder) => ElementArrayFinder

The query function used to find DOM elements.