Skip to main content

externalScroll

Instructs an actor who has the ability to BrowseTheWeb to scroll until a given PageElement comes into view.

Example widget

<!--
an element somewhere at the bottom of the page,
outside of the visible area
-->
<input type="submit" id="submit" />

Lean Page Object describing the widget

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

class Form {
static submitButton = () => {
PageElement.located(By.id('submit'))
.describedAs('submit button')
}

Scrolling to element

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

await actorCalled('Sara')
.attemptsTo(
Scroll.to(Form.submitButton()),
Ensure.that(Form.submitButton(), isVisible()),
)

Learn more

Hierarchy

Index

Methods

staticexternalto

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