import {Enter} from '@serenity-js/webdriverio/lib/screenplay/interactions'
public class | source

Enter

Instructs the Actor to enter a value into a form input field.

Extends:

Examples:

Example widget
 <form>
   <input type="text" name="example" id="example" />
 </form>
Lean Page Object describing the widget
 import { by, Target } from '@serenity-js/webdriverio';

 class Form {
     static exampleInput = Target.the('example input')
         .located(by.id('example'));
 }
Entering the value into a form field
 import { actorCalled } from '@serenity-js/core';
 import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';

 actorCalled('Esme')
     .whoCan(BrowseTheWeb.using(browser))
     .attemptsTo(
         Enter.theValue('Hello world!').into(Form.exampleInput),
     );

See also:

Static Method Summary

Static Public Methods
public static

theValue(value: Array<Answerable<string|number|string[]|number[]>>): EnterBuilder

Instantiates this Interaction.

Constructor Summary

Public Constructor
public

constructor(value: Array<Answerable<string|number|string[]|number[]>>, field: Answerable<Element<'async'>>)

Method Summary

Public Methods
public

async performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>

Makes the provided Actor perform this Interaction.

Inherited Summary

From class WebElementInteraction
public

toString(): string

Generates a description to be used when reporting this Activity.

protected

async resolve(actor: AnswersQuestions, element: Answerable<Element<'async'>>): Promise<Element<'async'>>

Returns the resolved Element, or throws a LogicError if the element is undefined.

Static Public Methods

public static theValue(value: Array<Answerable<string|number|string[]|number[]>>): EnterBuilder source

Instantiates this Interaction.

Params:

NameTypeAttributeDescription
value Array<Answerable<string|number|string[]|number[]>>

The value to be entered

Returns:

EnterBuilder

Public Constructors

public constructor(value: Array<Answerable<string|number|string[]|number[]>>, field: Answerable<Element<'async'>>) source

Params:

NameTypeAttributeDescription
value Array<Answerable<string|number|string[]|number[]>>

The value to be entered

field Answerable<Element<'async'>>

The field to enter the value into

Public Methods

public async performAs(actor: UsesAbilities & AnswersQuestions): Promise<void> source

Makes the provided Actor perform this Interaction.

Params:

NameTypeAttributeDescription
actor UsesAbilities & AnswersQuestions

An Actor to perform this Interaction

Returns:

Promise<void>