Class: DOMInteractor
@atomic-testing/dom-core.DOMInteractor
Implements
Interactor
Constructors
constructor
• new DOMInteractor(rootEl?
): DOMInteractor
Parameters
Name | Type | Default value |
---|---|---|
rootEl | HTMLElement | document.documentElement |
Returns
Defined in
packages/dom-core/src/DOMInteractor.ts:27
Properties
rootEl
• Protected
Readonly
rootEl: HTMLElement
= document.documentElement
Defined in
packages/dom-core/src/DOMInteractor.ts:27
Methods
calculateMousePosition
▸ calculateMousePosition(el
, preferredPoint?
): Point
Parameters
Name | Type |
---|---|
el | Element |
preferredPoint? | Point |
Returns
Point
Defined in
packages/dom-core/src/DOMInteractor.ts:55
click
▸ click(locator
, option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
option? | ClickOption |
Returns
Promise
<void
>
Implementation of
Interactor.click
Defined in
packages/dom-core/src/DOMInteractor.ts:64
clone
▸ clone(): Interactor
Returns
Interactor
Implementation of
Interactor.clone
Defined in
packages/dom-core/src/DOMInteractor.ts:348
enterText
▸ enterText(locator
, text
, option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
text | string |
option? | Partial <EnterTextOption > |
Returns
Promise
<void
>
Implementation of
Interactor.enterText
Defined in
packages/dom-core/src/DOMInteractor.ts:194
exists
▸ exists(locator
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<boolean
>
Implementation of
Interactor.exists
Defined in
packages/dom-core/src/DOMInteractor.ts:229
focus
▸ focus(locator
, _option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
_option? | Partial <FocusOption > |
Returns
Promise
<void
>
Implementation of
Interactor.focus
Defined in
packages/dom-core/src/DOMInteractor.ts:186
getAttribute
▸ getAttribute(locator
, name
, isMultiple
): Promise
<readonly string
[]>
Parameters
Name | Type |
---|---|
locator | PartLocator |
name | string |
isMultiple | true |
Returns
Promise
<readonly string
[]>
Implementation of
Interactor.getAttribute
Defined in
packages/dom-core/src/DOMInteractor.ts:28
▸ getAttribute(locator
, name
, isMultiple
): Promise
<Optional
<string
>>
Parameters
Name | Type |
---|---|
locator | PartLocator |
name | string |
isMultiple | false |
Returns
Promise
<Optional
<string
>>
Implementation of
Interactor.getAttribute
Defined in
packages/dom-core/src/DOMInteractor.ts:29
▸ getAttribute(locator
, name
): Promise
<Optional
<string
>>
Parameters
Name | Type |
---|---|
locator | PartLocator |
name | string |
Returns
Promise
<Optional
<string
>>
Implementation of
Interactor.getAttribute
Defined in
packages/dom-core/src/DOMInteractor.ts:30
getElement
▸ getElement<T
>(locator
, isMultiple
): Promise
<readonly T
[]>
Type parameters
Name | Type |
---|---|
T | extends Element = Element |
Parameters
Name | Type |
---|---|
locator | PartLocator |
isMultiple | true |
Returns
Promise
<readonly T
[]>
Defined in
packages/dom-core/src/DOMInteractor.ts:234
▸ getElement<T
>(locator
, isMultiple
): Promise
<Optional
<T
>>
Type parameters
Name | Type |
---|---|
T | extends Element = Element |
Parameters
Name | Type |
---|---|
locator | PartLocator |
isMultiple | false |
Returns
Promise
<Optional
<T
>>
Defined in
packages/dom-core/src/DOMInteractor.ts:235
▸ getElement<T
>(locator
): Promise
<Optional
<T
>>
Type parameters
Name | Type |
---|---|
T | extends Element = Element |
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<Optional
<T
>>
Defined in
packages/dom-core/src/DOMInteractor.ts:236
getInputValue
▸ getInputValue(locator
): Promise
<Optional
<string
>>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<Optional
<string
>>
Implementation of
Interactor.getInputValue
Defined in
packages/dom-core/src/DOMInteractor.ts:248
getSelectLabels
▸ getSelectLabels(locator
): Promise
<Optional
<readonly string
[]>>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<Optional
<readonly string
[]>>
Implementation of
Interactor.getSelectLabels
Defined in
packages/dom-core/src/DOMInteractor.ts:269
getSelectValues
▸ getSelectValues(locator
): Promise
<Optional
<readonly string
[]>>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<Optional
<readonly string
[]>>
Implementation of
Interactor.getSelectValues
Defined in
packages/dom-core/src/DOMInteractor.ts:259
getStyleValue
▸ getStyleValue(locator
, propertyName
): Promise
<Optional
<string
>>
Parameters
Name | Type |
---|---|
locator | PartLocator |
propertyName | CssProperty |
Returns
Promise
<Optional
<string
>>
Implementation of
Interactor.getStyleValue
Defined in
packages/dom-core/src/DOMInteractor.ts:47
getText
▸ getText(locator
): Promise
<Optional
<string
>>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<Optional
<string
>>
Implementation of
Interactor.getText
Defined in
packages/dom-core/src/DOMInteractor.ts:279
hasAttribute
▸ hasAttribute(locator
, name
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
name | string |
Returns
Promise
<boolean
>
Implementation of
Interactor.hasAttribute
Defined in
packages/dom-core/src/DOMInteractor.ts:340
hasCssClass
▸ hasCssClass(locator
, className
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
className | string |
Returns
Promise
<boolean
>
Implementation of
Interactor.hasCssClass
Defined in
packages/dom-core/src/DOMInteractor.ts:332
hover
▸ hover(locator
, _option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
_option? | HoverOption |
Returns
Promise
<void
>
Implementation of
Interactor.hover
Defined in
packages/dom-core/src/DOMInteractor.ts:86
isChecked
▸ isChecked(locator
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<boolean
>
Implementation of
Interactor.isChecked
Defined in
packages/dom-core/src/DOMInteractor.ts:286
isDisabled
▸ isDisabled(locator
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<boolean
>
Implementation of
Interactor.isDisabled
Defined in
packages/dom-core/src/DOMInteractor.ts:294
isReadonly
▸ isReadonly(locator
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<boolean
>
Implementation of
Interactor.isReadonly
Defined in
packages/dom-core/src/DOMInteractor.ts:304
isVisible
▸ isVisible(locator
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
Returns
Promise
<boolean
>
Implementation of
Interactor.isVisible
Defined in
packages/dom-core/src/DOMInteractor.ts:308
mouseDown
▸ mouseDown(locator
, option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
option? | Partial <MouseDownOption > |
Returns
Promise
<void
>
Implementation of
Interactor.mouseDown
Defined in
packages/dom-core/src/DOMInteractor.ts:109
mouseEnter
▸ mouseEnter(locator
, _option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
_option? | Partial <MouseEnterOption > |
Returns
Promise
<void
>
Implementation of
Interactor.mouseEnter
Defined in
packages/dom-core/src/DOMInteractor.ts:166
mouseLeave
▸ mouseLeave(locator
, _option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
_option? | Partial <MouseLeaveOption > |
Returns
Promise
<void
>
Implementation of
Interactor.mouseLeave
Defined in
packages/dom-core/src/DOMInteractor.ts:177
mouseMove
▸ mouseMove(locator
, option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
option? | Partial <MouseMoveOption > |
Returns
Promise
<void
>
Implementation of
Interactor.mouseMove
Defined in
packages/dom-core/src/DOMInteractor.ts:93
mouseOut
▸ mouseOut(locator
, _option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
_option? | Partial <MouseOutOption > |
Returns
Promise
<void
>
Implementation of
Interactor.mouseOut
Defined in
packages/dom-core/src/DOMInteractor.ts:157
mouseOver
▸ mouseOver(locator
, option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
option? | Partial <HoverOption > |
Returns
Promise
<void
>
Implementation of
Interactor.mouseOver
Defined in
packages/dom-core/src/DOMInteractor.ts:141
mouseUp
▸ mouseUp(locator
, option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
option? | Partial <MouseUpOption > |
Returns
Promise
<void
>
Implementation of
Interactor.mouseUp
Defined in
packages/dom-core/src/DOMInteractor.ts:125
selectOptionValue
▸ selectOptionValue(locator
, values
): Promise
<void
>
Parameters
Name | Type |
---|---|
locator | PartLocator |
values | string [] |
Returns
Promise
<void
>
Implementation of
Interactor.selectOptionValue
Defined in
packages/dom-core/src/DOMInteractor.ts:218
wait
▸ wait(ms
): Promise
<void
>
Parameters
Name | Type |
---|---|
ms | number |
Returns
Promise
<void
>
Implementation of
Interactor.wait