Skip to content

Test your React components with Serenity/JS and Playwright Test

License

Notifications You must be signed in to change notification settings

serenity-js/serenity-js-playwright-ct-react-template

Serenity/JS Playwright Component Test Template for React

Build Status

This template helps you test React components using Serenity/JS and the Playwright Test runner in Component-Test mode, with a fully configured TypeScript setup.

Features

  • Preconfigured Serenity/JS + Playwright CT + TypeScript setup
  • Example React components and corresponding tests
  • Linting and CI-friendly scripts
  • Ready-to-use GitHub Codespaces environment using the official Serenity/JS Docker image for quick exploration
  • Integrated reporting via Serenity BDD and Playwright, with live examples:

Quick Start

Explore instantly in GitHub Codespaces

Launch this project in an online development environment:

Open in GitHub Codespaces

Run locally

npm ci
  • Run the example tests
npm test
  • View the generated reports:
    • Serenity BDD: ./target/site/serenity/index.html
    • Playwright Test: ./playwright-report/index.html
  • Serve the Serenity BDD report locally:
npm run start

Then open http://localhost:8080 in your browser.

Corporate networks

If your environment requires proxy configuration or an internal registry like Artifactory or Nexus, add an .npmrc file file with the appropriate configuration to your home directory:

proxy=http://user:[email protected]:8080/
https-proxy=http://user:[email protected]:8080/
strict-ssl=false
registry=https://artifactory.mycompany.com/artifactory/

Execution

The project provides several NPM scripts defined in package.json:

npm run lint            # runs code linter
npm run lint:fix        # attempts to automatically fix linting issues
npm run clean           # removes reports from any previous test run
npm test                # executes the example test suite
                        # and generates the report under ./target/site/serenity
npm start               # starts a mini HTTP server and serves the test reports
                        # at http://localhost:8080

Next steps

  • Replace the sample components with your own UI elements
  • Add new tasks, interactions, and assertions using Serenity/JS
  • Extend the test suite or integrate it into CI/CD pipelines
  • Use the sample reports to understand expected testing and reporting workflows

Documentation

Contributing

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

Community

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

Connect with other developers using Serenity/JS:

Follow Serenity/JS to learn about new features, tutorials, and releases!

⭐ Star the main Serenity/JS repository to help others discover the framework!

GitHub stars

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 commercial support or corporate sponsorship, please contact Jan Molak.

GitHub Sponsors

About

Test your React components with Serenity/JS and Playwright Test

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •