Skip to main content

externalHover

Instructs an actor who has the ability to BrowseTheWeb to hover the mouse pointer over a given PageElement.

Example widget

 <a data-test="example-link"
class="off"
onmouseover="this.className='on';"
onmouseout="this.className='off';"
href="/">hover over me</a>

Lean Page Object describing the widget

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

class Example {
static link = () =>
PageElement.located(By.css('[data-test="example-link"]'))
.describedAs('example link')
}

Hovering over an element

import { actorCalled } from '@serenity-js/core'
import { Hover, CssClasses } from '@serenity-js/web'
import { Ensure, equals } from '@serenity-js/assertions'

await actorCalled('Hank')
.whoCan(BrowseTheWeb.using(browser))
.attemptsTo(
Ensure.that(CssClasses.of(Example.link()), equals([ 'off' ])),

Hover.over(Example.link),
Ensure.that(CssClasses.of(Example.link()), equals([ 'on' ])),
)

Learn more

Hierarchy

Index

Methods

staticexternalover

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