@serenity-js/protractor
| Install | |
|---|---|
npm install @serenity-js/protractor |
|
| Latest Version: | 3.49.0 |
| License: | Apache-2.0 |
| Last Updated: | Oct 21, 2026 |
| Links: | GitHub · npm |
Serenity/JS Protractor
@serenity-js/protractor brings full Serenity reporting capabilities to Protractor framework and enables writing tests using the Screenplay Pattern.
Learn more about integrating Serenity/JS with Protractor.
Features
- Integrates Serenity/JS with Protractor providing standardised Screenplay Web API
- Supports Angular and non-Angular apps
- Enables Screenplay Pattern APIs in Protractor tests
- 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/protractor
See the Serenity/JS Installation Guide.
Quick Start
Usage with Cucumber.js
To use Serenity/JS Protractor with Cucumber.js, install the following adapter:
npm install --save-dev @serenity-js/cucumber
Please note that Serenity/JS Protractor / Cucumber integration supports both Serenity/JS reporting services and native Cucumber.js reporters, so you can use this module as a drop-in replacement of protractor-cucumber-framework.
Learn more about integrating Serenity/JS Protractor with Cucumber.
Usage with Jasmine
To use Serenity/JS Protractor with Jasmine, install the following adapter:
npm install --save-dev @serenity-js/jasmine
Learn more about integrating Serenity/JS Protractor with Cucumber.
Usage with Mocha
To use Serenity/JS Protractor with Mocha, install the following adapter:
npm install --save-dev @serenity-js/mocha
Learn more about integrating Serenity/JS Protractor with Mocha.
Configuration
// protractor.conf.js
exports.config = {
// Tell Protractor to use the Serenity/JS framework Protractor Adapter
framework: 'custom',
frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
// Configure Serenity/JS to use an appropriate test runner
// and the Stage Crew Members we've imported at the top of this file
serenity: {
runner: 'jasmine',
// runner: 'cucumber',
// runner: 'mocha',
crew: [
'@serenity-js/console-reporter',
[ '@serenity-js/html-reporter', { outputDirectory: './reports/serenity-js' } ],
[ '@serenity-js/web:Photographer', {
strategy: 'TakePhotosOfFailures', // or: 'TakePhotosOfInteractions'
} ],
]
},
// configure Cucumber runner
cucumberOpts: {
// see the Cucumber configuration options below
},
// or configure Jasmine runner
jasmineNodeOpts: {
// see the Jasmine configuration options below
},
// or configure Mocha runner
mochaOpts: {
// see the Mocha configuration options below
},
// ... other Protractor-specific configuration
}
Learn more about:
- Cucumber configuration options
- Jasmine configuration options
- Mocha configuration options
- Protractor configuration file.
Interacting with websites and web apps
import { actorCalled } from '@serenity-js/core'
import { Ensure, equals } from '@serenity-js/assertions'
import { By, Navigate, Target, Text } from '@serenity-js/web'
// example Lean Page Object describing a widget we interact with in the test
class SerenityJSWebsite {
static header = () =>
PageElement.located(By.css('h1')) // selector to identify the interactable element
.describedAs('header') // description to be used in reports
}
// example Jasmine test
describe('Serenity/JS', () => {
it('works with Protractor and Jasmine', async () => {
await actorCalled('Priya').attemptsTo(
Navigate.to('https://serenity-js.org'),
Ensure.that(
Text.of(SerenityJSWebsite.header()),
equals('Enable collaborative test automation at any scale!')
),
)
})
})
Documentation
- API Reference
- Screenplay Pattern Guide
- Serenity/JS Project Templates
- More examples and reference implementations
- Tutorial: First Web Scenario
- Tutorial: First API Scenario
Contributing
Contributions of all kinds are welcome! Get started with the Contributing Guide.
Community
- Community Chat
- Discussions Forum
- Visit the 💡How to... ? section for answers to common questions
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.
Related Packages
Serenity/JS test runner adapter for Playwright Test, combining Playwright's deve...
Adapter that integrates @serenity-js/web with Playwright, enabling Serenity/JS r...
Easy to use Node.js based end-to-end testing solution for web applications using...
Simple and complete DOM testing utilities that encourage good testing practices.
Browser-native library to fetch GitHub repositories and custom metadata for dyna...
Version History
| Version | Released | License |
|---|---|---|
| 3.49.0 | Apache-2.0 | |
| 3.48.2 | Apache-2.0 | |
| 3.48.1 | Apache-2.0 | |
| 3.48.0 | Apache-2.0 | |
| 3.47.2 | Apache-2.0 | |
| 3.47.0 | Apache-2.0 | |
| 3.46.1 | Apache-2.0 | |
| 3.46.0 | Apache-2.0 | |
| 3.45.9 | Apache-2.0 | |
| 3.45.8 | Apache-2.0 | |
| 3.45.7 | Apache-2.0 | |
| 3.45.6 | Apache-2.0 | |
| 3.45.5 | Apache-2.0 | |
| 3.45.4 | Apache-2.0 | |
| 3.45.3 | Apache-2.0 | |
| 3.45.2 | Apache-2.0 | |
| 3.45.1 | Apache-2.0 | |
| 3.45.0 | Apache-2.0 | |
| 3.44.3 | Apache-2.0 | |
| 3.44.2 | Apache-2.0 | |
| 3.44.1 | Apache-2.0 | |
| 3.44.0 | Apache-2.0 | |
| 3.43.4 | Apache-2.0 | |
| 3.43.3 | Apache-2.0 | |
| 3.43.2 | Apache-2.0 | |
| 3.43.1 | Apache-2.0 | |
| 3.43.0 | Apache-2.0 | |
| 3.42.2 | Apache-2.0 | |
| 3.42.1 | Apache-2.0 | |
| 3.42.0 | Apache-2.0 |
Showing the latest 30 of 288. See every release on npm
Pre-releases (164)
| Version | Released | License |
|---|---|---|
| 3.0.0-rc.45 | Apache-2.0 | |
| 3.0.0-rc.44 | Apache-2.0 | |
| 3.0.0-rc.43 | Apache-2.0 | |
| 3.0.0-rc.42 | Apache-2.0 | |
| 3.0.0-rc.41 | Apache-2.0 | |
| 3.0.0-rc.40 | Apache-2.0 | |
| 3.0.0-rc.39 | Apache-2.0 | |
| 3.0.0-rc.38 | Apache-2.0 | |
| 3.0.0-rc.37 | Apache-2.0 | |
| 3.0.0-rc.36 | Apache-2.0 | |
| 3.0.0-rc.35 | Apache-2.0 | |
| 3.0.0-rc.34 | Apache-2.0 | |
| 3.0.0-rc.33 | Apache-2.0 | |
| 3.0.0-rc.32 | Apache-2.0 | |
| 3.0.0-rc.31 | Apache-2.0 | |
| 3.0.0-rc.30 | Apache-2.0 | |
| 3.0.0-rc.29 | Apache-2.0 | |
| 3.0.0-rc.28 | Apache-2.0 | |
| 3.0.0-rc.27 | Apache-2.0 | |
| 3.0.0-rc.26 | Apache-2.0 | |
| 3.0.0-rc.25 | Apache-2.0 | |
| 3.0.0-rc.24 | Apache-2.0 | |
| 3.0.0-rc.23 | Apache-2.0 | |
| 3.0.0-rc.22 | Apache-2.0 | |
| 3.0.0-rc.21 | Apache-2.0 | |
| 3.0.0-rc.20 | Apache-2.0 | |
| 3.0.0-rc.19 | Apache-2.0 | |
| 3.0.0-rc.18 | Apache-2.0 | |
| 3.0.0-rc.17 | Apache-2.0 | |
| 3.0.0-rc.16 | Apache-2.0 |
Showing the latest 30 of 164. See every release on npm