Class: ContainerDriver<ContentT, T>
@atomic-testing/core.ContainerDriver
Base class for all component drivers. It provides the basic functionality to interact with the component
Type parameters
Name | Type |
---|---|
ContentT | extends ScenePart |
T | extends ScenePart = |
Hierarchy
-
↳
ContainerDriver
Implements
IComponentDriver
<T
>
Constructors
constructor
• new ContainerDriver<ContentT
, T
>(locator
, interactor
, option?
): ContainerDriver
<ContentT
, T
>
Type parameters
Name | Type |
---|---|
ContentT | extends ScenePart |
T | extends ScenePart = |
Parameters
Name | Type |
---|---|
locator | PartLocator |
interactor | Interactor |
option? | Partial <IContainerDriverOption <ContentT , T >> |
Returns
ContainerDriver
<ContentT
, T
>
Overrides
Defined in
packages/core/src/drivers/ContainerDriver.ts:13
Properties
_content
• Private
Readonly
_content: ScenePartDriver
<ContentT
>
Defined in
packages/core/src/drivers/ContainerDriver.ts:11
commutableOption
• Readonly
commutableOption: IComponentDriverOption
<T
>
Option passed to the constructor includes both universal options which can be shared across all component driver tree, and component specific options which are only applicable to the component.
Commutable option is the option that can be shared across all component driver tree.
Inherited from
ComponentDriver.commutableOption
Defined in
packages/core/src/drivers/ComponentDriver.ts:35
interactor
• Readonly
interactor: Interactor
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:39
Accessors
content
• get
content(): ScenePartDriver
<ContentT
>
Returns
ScenePartDriver
<ContentT
>
Defined in
packages/core/src/drivers/ContainerDriver.ts:28
driverName
• get
driverName(): string
Returns
string
Inherited from
ComponentDriver.driverName
Defined in
packages/core/src/drivers/ComponentDriver.ts:247
locator
• get
locator(): PartLocator
Return the locator of the component
Returns
Implementation of
IComponentDriver.locator
Inherited from
ComponentDriver.locator
Defined in
packages/core/src/drivers/ComponentDriver.ts:88
parts
• get
parts(): ScenePartDriver
<T
>
Return driver instance of all the named parts
Returns
Implementation of
IComponentDriver.parts
Inherited from
ComponentDriver.parts
Defined in
packages/core/src/drivers/ComponentDriver.ts:81
Methods
click
▸ click(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <ClickOption > |
Returns
Promise
<void
>
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:155
enforcePartExistence
▸ enforcePartExistence(partName
): Promise
<void
>
Check the specified parts' existences, and throw MissPartError if any of the part is found not existence. Existence is defined by the part's existence in the DOM regardless of its visibility on the screen
Parameters
Name | Type | Description |
---|---|---|
partName | keyof T | readonly keyof T [] | Single or array of the names of the parts to be enforced |
Returns
Promise
<void
>
Inherited from
ComponentDriver.enforcePartExistence
Defined in
packages/core/src/drivers/ComponentDriver.ts:97
exists
▸ exists(): Promise
<boolean
>
Whether the component exists/attached to the DOM
Returns
Promise
<boolean
>
true if the component is attached to the DOM, false otherwise
Implementation of
IComponentDriver.exists
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:151
focus
▸ focus(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <FocusOption > |
Returns
Promise
<void
>
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:191
getAttribute
▸ getAttribute(attributeName
): Promise
<Optional
<string
>>
Parameters
Name | Type |
---|---|
attributeName | string |
Returns
Promise
<Optional
<string
>>
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:143
getMissingPartNames
▸ getMissingPartNames(partName
): Promise
<readonly keyof T
[]>
Get the names of parts not in the DOM
Parameters
Name | Type | Description |
---|---|---|
partName | keyof T | readonly keyof T [] | Single or array of the names of the parts to be examined |
Returns
Promise
<readonly keyof T
[]>
Inherited from
ComponentDriver.getMissingPartNames
Defined in
packages/core/src/drivers/ComponentDriver.ts:110
getText
▸ getText(): Promise
<Optional
<string
>>
Get the combined text content of the component
Returns
Promise
<Optional
<string
>>
If the component exists and has content, it should return the text or otherwise undefined
Implementation of
IComponentDriver.getText
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:139
hover
▸ hover(option?
): Promise
<void
>
Parameters
Name | Type |
---|---|
option? | Partial <HoverOption > |
Returns
Promise
<void
>
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:159
isVisible
▸ isVisible(): Promise
<boolean
>
Whether the component is visible. Visibility is defined
that the component does not have the CSS property display: none
,
visibility: hidden
, or opacity: 0
. However this does not
check wether the component is within the viewport.
Returns
Promise
<boolean
>
true if the component is visible, false otherwise
Implementation of
IComponentDriver.isVisible
Inherited from
Defined in
packages/core/src/drivers/ComponentDriver.ts:203