Skip to main content

externalClick

Instructs an actor who has the ability to BrowseTheWeb to scroll the given PageElement into view and then click on it.

Example widget

<form>
<input type="text" name="example" id="example" />
</form>

Lean Page Object describing the widget

import { By, PageElement } from '@serenity-js/webdriverio';

class Form {
static exampleInput = () =>
PageElement.located(by.id('example'))
.describedAs('example input')
}

Clicking on an element

import { actorCalled } from '@serenity-js/core'
import { Click, isSelected } from '@serenity-js/web'
import { Ensure } from '@serenity-js/assertions'

await actorCalled('Chloé')
.attemptsTo(
Click.on(Form.exampleInput()),
Ensure.that(Form.exampleInput(), isSelected()),
)

Learn more

Hierarchy

Index

Methods

staticexternalon

externalinstantiationLocation

  • instantiationLocation(): FileSystemLocation
  • Returns the location where this Activity was instantiated.


    Returns FileSystemLocation

externaldescribedBy

  • Resolves the description of this object in the context of the provided actor.


    Parameters

    Returns Promise<string>

externaltoString

  • toString(): string
  • Returns a human-readable description of this object.


    Returns string

externalperformAs