Skip to main content

external@serenity-js/web

NPM Version Build Status Maintainability Code Coverage Contributors Known Vulnerabilities GitHub stars

Follow Serenity/JS on LinkedIn Watch Serenity/JS on YouTube Join Serenity/JS Community Chat Support Serenity/JS on GitHub

@serenity-js/web provides a unified, Screenplay Pattern–based library for interacting with web applications, enabling maintainable end-to-end and component-level tests across multiple automation engines, including Playwright and WebdriverIO.

Learn more about web testing with Serenity/JS!

Features

  • Offers a consistent API for web interactions across different automation engines, making your tests maintainable and portable.
  • Supports both end-to-end and component-level testing of web applications.
  • Integrates seamlessly with popular test runners like Playwright Test, WebdriverIO, Mocha, Jasmine, and Cucumber.js.
  • Supports all Serenity/JS reporting features
  • TypeScript-first design with strong typing for safer and more predictable test code.

Installation

npm install --save-dev @serenity-js/core @serenity-js/web

See the Serenity/JS Installation Guide.

Quick Start

Usage with Playwright Test

import { describe, it } from '@serenity-js/playwright-test'
import { Navigate, Page } from '@serenity-js/web'
import { Ensure, startsWith } from '@serenity-js/assertions'

describe('Website', () => {

it('should have a title', async ({ actor }) => {

await actor.attemptsTo(
Navigate.to('https://serenity-js.org/'),
Ensure.that(Page.current().title(), startsWith('Serenity/JS')),
)
})
})

Usage with WebdriverIO and Mocha

import { describe, it } from 'mocha'
import { Navigate, Page } from '@serenity-js/web'
import { Ensure, startsWith } from '@serenity-js/assertions'

describe('Website', () => {

it('should have a title', async () => {

await actorCalled('Alice').attemptsTo(
Navigate.to('https://serenity-js.org/'),
Ensure.that(Page.current().title(), startsWith('Serenity/JS')),
)
})
})

Documentation

Contributing

Contributions of all kinds are welcome! Get started with the Contributing Guide.

Community

If you enjoy using Serenity/JS, make sure to star ⭐️ Serenity/JS on GitHub to help others discover the framework!

License

The Serenity/JS code base is licensed under the Apache-2.0 license, while its documentation and the Serenity/JS Handbook are licensed under the Creative Commons BY-NC-SA 4.0 International.

See the Serenity/JS License.

Support

Support ongoing development through GitHub Sponsors. Sponsors gain access to Serenity/JS Playbooks and priority help in the Discussions Forum.

For corporate sponsorship or commercial support, please contact Jan Molak.

GitHub Sponsors.

Index

Models

externalByRoleSelectorValue

ByRoleSelectorValue: alert | alertdialog | application | article | banner | blockquote | button | caption | cell | checkbox | code | columnheader | combobox | complementary | contentinfo | definition | deletion | dialog | directory | document | emphasis | feed | figure | form | generic | grid | gridcell | group | heading | img | insertion | link | list | listbox | listitem | log | main | marquee | math | meter | menu | menubar | menuitem | menuitemcheckbox | menuitemradio | navigation | none | note | option | paragraph | presentation | progressbar | radio | radiogroup | region | row | rowgroup | rowheader | scrollbar | search | searchbox | separator | slider | spinbutton | status | strong | subscript | superscript | switch | tab | table | tablist | tabpanel | term | textbox | time | timer | toolbar | tooltip | tree | treegrid | treeitem
Page Options