An assertion which checks that an element matching the interactor does not exist. Throws an error if the element exists.
await Link('Next').absent();
Perform a one-off assertion on the given interactor. Takes a function which receives an element. This function converges, which means that it is rerun in a loop until it does not throw an error or times out.
We recommend using this function for debugging only. You should normally define a filter in an InteractorSpecification.
await Link('Next').assert((e) => assert(e.tagName === 'A'));
An assertion which checks that an element matching the interactor exists. Throws an error if the element does not exist.
await Link('Next').exists();
Returns a copy of the given interactor which is scoped to this interactor. When there are multiple matches for an interactor, this makes it possible to make them more specific by limiting the interactor to a section of the page.
await Fieldset('Owner').find(TextField('Name')).fillIn('Jonas');
await Fieldset('Brand').find(TextField('Name')).fillIn('Volkswagen');
the type of the interactor that we are going to scope
the interactor which should be scoped
a scoped copy of the initial interactor
Checks that there is one element matching the interactor, and that this element matches the given filters. The available filters are defined by the InteractorSpecification.
await Link('Home').has({ href: '/' })
Identical to has, but reads better with some filters.
await CheckBox('Accept conditions').is({ checked: true })
Perform a one-off action on the given interactor. Takes a function which receives an element. This function converges, which means that it is rerun in a loop until it does not throw an error or times out.
We recommend using this function for debugging only. You should normally define an action in an InteractorSpecification.
await Link('Next').perform((e) => e.click());
Generated using TypeDoc
Instances of an interactor returned by an InteractorConstructor, use this class as its base. They are also extended with any additional actions defined in their InteractorSpecification.