Skip to main content

externalDoubleClick

Instructs an actor who has the ability to BrowseTheWeb to perform a double click on a given PageElement.

Example widget

<!--
The editor shows up when the user double-clicks
on one of the properties of their profile
and lets them change the value of that property.
-->
<div id="user-profile">
<ul>
<li id="display-name" ondblclick="edit(this)">User12345</li>
<li id="email-address" ondblclick="edit(this)">tester@example.org</li>
</ul>
<form id="editor" class="hidden">
<input type="text" value="" />
</form>
</div>

Lean Page Object describing the widget

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

class UserProfile {
static displayName = () =>
PageElement.located(by.id('display-name'))
.describedAs('display name')

static emailAddress = () =>
PageElement.located(by.id('email-address'))
.describedAs('email address')

static editor = () =>
PageElement.located(by.id('editor'))
.describedAs('editor')
}

Double-clicking on an element

import { actorCalled, Wait } from '@serenity-js/core'
import { DoubleClick, isVisible, Enter, Text } from '@serenity-js/web'
import { Ensure, equals, not } from '@serenity-js/assertions'

await actorCalled('Dorothy')
.whoCan(BrowseTheWeb.using(browser))
.attemptsTo(
DoubleClick.on(UserProfile.displayName),
Wait.until(UserProfile.editor(), isVisible()),

Enter.theValue('New username').into(UserProfile.editor),

Ensure.that(Text.of(UserProfile.displayName()), equals('New username')),
Ensure.that(UserProfile.editor, not(isVisible()))
)

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