Available Interactions

Below is a brief description of the various interactions available out-of-the-box with interactors. Clicking the name of an interaction will take you to the corresponding API docs which include more details and examples.

Default Interactions

These default interaction properties and methods are available on all interactors, but may be safely overwritten when defining your own, custom, interactors.

Properties

All properties, with the exception of isPresent, will throw an error if the element cannot be located within the interactor's root element.

Methods

All default interactor methods accept an optional selector as the first argument. Given a selector, the interaction will be made on the matching element within the parent interactor's root element.

Note: Interaction methods return new instances of the interactor and do not preform any interactions until the #run() method is invoked on the new instance.

Property Creators

Property creators can be utilized when creating your own custom interactors using the @interactor class decorator. The creator functions accept an optional selector just like the default methods do. However, the resulting instance methods do not have an optional selector argument.

Properties

Creators for interactor properties return getters that are lazily evaluated. Just like the default properties, with the exception of isPresent, all properties will throw an error if the element cannot be located within the interactor's root element.

Methods

Creators for interactor methods return chainable functions that then return new instances with the specific interaction added to it's queue. The interactions are not run until the interactor's #run() method is invoked, or when using the async/await syntax.

Interactors

Nested interactor creators return interactor instances scoped to the parent interactor's root element. The second argument is an optional hash of additional interactor properties to add to the returned interactor. The second argument may also be an interactor class with it's own methods and properties used when creating the nested, scoped, interactor.

Helpers

Property creator helpers may be used to define your own custom interactions. Defining methods and getters directly on an interactor class is supported. However, using these helpers allows you to create reusable property creators like the above interactions.