npm.io
3.46.0 • Published 4d ago

@serenity-js/web

Licence
Apache-2.0
Version
3.46.0
Deps
0
Vulns
0
Weekly
0
Stars
614

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

Keywords