Protected
Readonly
locatorStatic
hostProtected
documentProtected
forceReturn the text of all the buttons. Note that "default" corresponds to when you explicitly specify that color for the button, and is not the color of a button when you don't specify a color (see DialogButton.color).
Get the text displayed in the content of the dialog. Note this includes text from both the text
and component
options of SlDialogService.open.
Protected
getProtected
locatorCreates an asynchronous locator function that can be used to find a ComponentHarness
instance
or element under the host element of this ComponentHarness
.
Rest
...queries: TA list of queries specifying which harnesses and elements to search for:
string
searches for elements matching the CSS selector specified by the string.ComponentHarness
constructor searches for ComponentHarness
instances matching the
given class.HarnessPredicate
searches for ComponentHarness
instances matching the given
predicate.An asynchronous locator function that searches for and returns a Promise
for the
first element or harness matching the given search criteria. Matches are ordered first by
order in the DOM, and second by order in the queries list. If no matches are found, the
Promise
rejects. The type that the Promise
resolves to is a union of all result types for
each query.
e.g. Given the following DOM: <div id="d1" /><div id="d2" />
, and assuming
DivHarness.hostSelector === 'div'
:
await ch.locatorFor(DivHarness, 'div')()
gets a DivHarness
instance for #d1
await ch.locatorFor('div', DivHarness)()
gets a TestElement
instance for #d1
await ch.locatorFor('span')()
throws because the Promise
rejects.Protected
locatorCreates an asynchronous locator function that can be used to find ComponentHarness
instances
or elements under the host element of this ComponentHarness
.
Rest
...queries: TA list of queries specifying which harnesses and elements to search for:
string
searches for elements matching the CSS selector specified by the string.ComponentHarness
constructor searches for ComponentHarness
instances matching the
given class.HarnessPredicate
searches for ComponentHarness
instances matching the given
predicate.An asynchronous locator function that searches for and returns a Promise
for all
elements and harnesses matching the given search criteria. Matches are ordered first by
order in the DOM, and second by order in the queries list. If an element matches more than
one ComponentHarness
class, the locator gets an instance of each for the same element. If
an element matches multiple string
selectors, only one TestElement
instance is returned
for that element. The type that the Promise
resolves to is an array where each element is
the union of all result types for each query.
e.g. Given the following DOM: <div id="d1" /><div id="d2" />
, and assuming
DivHarness.hostSelector === 'div'
and IdIsD1Harness.hostSelector === '#d1'
:
await ch.locatorForAll(DivHarness, 'div')()
gets [ DivHarness, // for #d1 TestElement, // for #d1 DivHarness, // for #d2 TestElement // for #d2 ]
await ch.locatorForAll('div', '#d1')()
gets [ TestElement, // for #d1 TestElement // for #d2 ]
await ch.locatorForAll(DivHarness, IdIsD1Harness)()
gets [ DivHarness, // for #d1 IdIsD1Harness, // for #d1 DivHarness // for #d2 ]
await ch.locatorForAll('span')()
gets []
.Protected
locatorCreates an asynchronous locator function that can be used to find a ComponentHarness
instance
or element under the host element of this ComponentHarness
.
Rest
...queries: TA list of queries specifying which harnesses and elements to search for:
string
searches for elements matching the CSS selector specified by the string.ComponentHarness
constructor searches for ComponentHarness
instances matching the
given class.HarnessPredicate
searches for ComponentHarness
instances matching the given
predicate.An asynchronous locator function that searches for and returns a Promise
for the
first element or harness matching the given search criteria. Matches are ordered first by
order in the DOM, and second by order in the queries list. If no matches are found, the
Promise
is resolved with null
. The type that the Promise
resolves to is a union of all
result types for each query or null.
e.g. Given the following DOM: <div id="d1" /><div id="d2" />
, and assuming
DivHarness.hostSelector === 'div'
:
await ch.locatorForOptional(DivHarness, 'div')()
gets a DivHarness
instance for #d1
await ch.locatorForOptional('div', DivHarness)()
gets a TestElement
instance for #d1
await ch.locatorForOptional('span')()
gets null
.Protected
waitStatic
withGets a HarnessPredicate
that can be used to search for a SlDialogHarness that meets certain criteria.
Harness for interacting with a dialog opened via SlDialogService.open.