serenity-js

A next generation, full-stack acceptance testing framework optimised for collaboration, speed and scale!

APACHE-2.0 License

Downloads
412.4K
Stars
535
Committers
57

Bot releases are visible (Hide)

serenity-js - v2.5.2

Published by smartcode-devbot over 4 years ago

2.5.2 (2020-05-16)

Note: Version bump only for package serenity-js-monorepo

serenity-js - v2.5.1

Published by smartcode-devbot over 4 years ago

2.5.1 (2020-05-16)

Bug Fixes

  • protractor: support for Protractor 7.0.0 (cf7518a)
serenity-js - v2.5.0

Published by smartcode-devbot over 4 years ago

2.5.0 (2020-05-14)

Bug Fixes

  • npm: esport ES2018 instead of ES5 since we're supporting Node >= 10 (a77091a)

Features

  • core: discardable Abilities and shared notes (6cc2e2c)
serenity-js - v2.4.1

Published by smartcode-devbot over 4 years ago

2.4.1 (2020-05-03)

Note: Version bump only for package serenity-js-monorepo

serenity-js - v2.4.0

Published by smartcode-devbot over 4 years ago

2.4.0 (2020-05-02)

Bug Fixes

  • core: plain JavaScript/JSON object are now pretty-printed to make them easier to read (c63d64d), closes #509

Features

  • protractor: navigate.to(url).withTimeout(duration) (be23c6e), closes #517
serenity-js - v2.3.6

Published by smartcode-devbot over 4 years ago

2.3.6 (2020-04-28)

Bug Fixes

  • core: an Actor will now complain if given the same ability more than once (d34f4d5)
serenity-js - v2.3.5

Published by smartcode-devbot over 4 years ago

2.3.5 (2020-04-28)

Bug Fixes

  • console-reporter: corrected an issue that might be causing an OOM error (0b60511), closes #550
serenity-js - v2.3.4

Published by smartcode-devbot over 4 years ago

2.3.4 (2020-04-22)

Note: Version bump only for package serenity-js-monorepo

serenity-js - v2.3.3

Published by smartcode-devbot over 4 years ago

2.3.3 (2020-04-22)

Bug Fixes

  • protractor: cleaned up the API docs and introduced interfaces to simplify method signatures (8e85a54)
serenity-js - v1.2.1

Published by jan-molak over 7 years ago

1.2.1 (2017-02-26)

Bug Fixes

  • serenity-protractor: Custom configuration correctly overrides the defaults (031a8ddc)
serenity-js - v1.2.0

Published by jan-molak over 7 years ago

1.2.0 (2017-02-19)

Bug Fixes

  • core: More meaningful reporting on TakeNotes and CompareNotes (9aeefc57)

Features

  • serenity-protractor: Interactions: Execute.asyncScript(), Execute.script() and Evaluate.script() (0a4b08e2)
serenity-js - v1.1.0

Published by jan-molak over 7 years ago

<a name"1.1.0">

1.1.0 (2017-02-11)

Features

  • serenity-protractor: Support for Protractor 5.1.x (a6d9eab3)
serenity-js - v1.0.0

Published by jan-molak over 7 years ago

1.0.0 (2017-02-10)

Bug Fixes

  • core:
    • JSONReporter superseded by SerenityBDDReporter (0b93ff0d)
    • JSONObject interface definition should not reference the static JSON class (ed4fabb6)
  • deps: Pegged Protractor to 5.0.x until backwards compatibility issues intrduced in 5.1 (8c799972)
  • interactions: See is no longer reported by default, as that polluted the report and triggere (3b7efb81)
  • serenity-cucumber: The tags parameter in cucumberOpts is now correctly typed as a list of strin (abdeddad)
  • serenity-mocha: Pending scenarios with no steps are correctly marked as pending instead of passi (a593a84d)

Features

  • integration: Stand-ins enable taking screenshots when there are no Actors on the Stage. (786b3373)
  • screenplay: The actor can now TakeNotes to assert on their contents later. (ab368276, closes #24)
  • serenity: SerenityProtractorFramework takes care of executing cucumber and mocha tests. (6cf0197a)
  • serenity-mocha:
    • A compiler can be registered as a configuration parameter (02a0c6eb)
    • Tests that timed out or failed with an exception are recognised as "Compromised" (532fb86e)
  • serenity-protractor:
    • Serenity can auto-detect the appropriate test dialect (c50a4bf7)
    • SerenityProtractorFramework advises how to install a missing test runner. (b6caf893)

Breaking Changes

  • JSONReporter is now superseded by a cleaner and more focused implementation -

SerenityBDDReporter, which better handles gathering results from tests executed in parallel.

(0b93ff0d)

  • SerenityProtractorPlugin is now removed in favour of the much more flexible SerenityProtractorFramework.

You can use the SerenityProtractorFramework instead of the mocha or the protractor-cucumber-framework modules
as it provides capabilities equivalent to those modules, and also enables an easy integration with Serenity/JS
as well as synchronisation with the WebDriver ControlFlow so that the test reports will show accurate timing.

To enable the framework, add the following configuration to your protractor.conf.js file:

exports.config = {
    framework: 'custom',

    frameworkPath: require.resolve('serenity-js'),
    serenity: {
        dialect: 'cucumber'     // or 'mocha'
    },

    specs: [ 'features/**/*.feature' ],

    cucumberOpts: {             // or 'mochaOpts'
    },

Both cucumberOpts and mochaOpts don't need to change as SerenityProtractorFramework can act as a drop-in replacement.

Please see the todomvc-protractor-cucumber and todomvc-protractor-mocha example project for details.

BREAKING CHANGE: The serenity object should be used instead of the Serenity singleton to initialise
the stage and the actors.

Instead of:

import { Serenity } from 'serenity-js';

const stage = Serenity.callToStageFor(cast);

use:

import { serenity } from 'serenity-js';

const stage = serenity.callToStageFor(cast);

Tutorials and more documentation to follow shortly!

(6cf0197a)

serenity-js - v0.10.5

Published by jan-molak over 7 years ago

<a name"0.10.5">

0.10.5 (2017-01-26)

Bug Fixes

  • npm: Cucumber-related types are exported using the ES5 syntax now (dca8be0a)
serenity-js - v0.10.4

Published by jan-molak over 7 years ago

<a name"0.10.4">

0.10.4 (2017-01-26)

Bug Fixes

  • npm: Serenity/JS compiles to ES5 instead of ES6 to fix issues with the module loader (5a4c1d4d)
  • serenity-cucumber: Cucumber generator steps are correctly recognised and synced (4475c2cc)
serenity-js - v0.10.3

Published by jan-molak over 7 years ago

<a name"0.10.3">

0.10.3 (2017-01-22)

Bug Fixes

  • deps: Updated shrinkwrap to include co, required by serenity-cucumber (fefd26b3)
serenity-js - v0.10.2

Published by jan-molak over 7 years ago

<a name"0.10.2">

0.10.2 (2017-01-22)

Bug Fixes

  • serenity-cucumber: Cucumber data table and docstring steps are correctly reported (053955df, closes #14)

Examples:

Data Tables

Cucumber Data Tables are handy for passing a list of values to a step definition:

  Scenario: Serenity/JS reports DataTable steps

    Given the following accounts:
      | name | email                  | twitter   |
      | Jan  | [email protected]  | @JanMolak |
      | John | [email protected] | @wakaleo  |

and that's what they'll look like in your Serenity Report:

Doc Strings

Doc Strings are handy for passing a larger piece of text to a step definition.

  Scenario: Serenity/JS reports DocString steps

    Given an example.ts file with the following contents:
      """
      export const noop = (_) => _;
      export const sum  = (a, b) => a + b;
      """

Doc Strings are now reported too:


Show your support, give Serenity/JS a star! ★

serenity-js - v0.10.1

Published by jan-molak almost 8 years ago

<a name"0.10.1">

0.10.1 (2017-01-20)

Bug Fixes

  • ci:
    • The release notes should be published correctly now (8f0b4cfb)
    • Travis should be able to correctly test PRs (9829726e, closes #17)
  • coverage: Fix coverage reporting to include files not required from specs (f40a8dc4)
  • cucumber: Add support for generators as step definitions (30fd6528, closes #9)
  • reporting: JSON report is generated even if we couldn't capture a screenshot (f230239e)

Features

  • mocha: Support for running test scenarios with Mocha (168713c7)
  • reporting: AssertionError translated to a Test Failure, not a Test Error (f3b30660)
  • screenplay: See - a screenplay-style way of executing assertions (ade82e5a)
  • serenity-cucumber: Support for generator steps (f3fc2766, closes #13, #15)
serenity-js - v0.8.1

Published by jan-molak almost 8 years ago

0.8.1 (2016-12-30)

Bug Fixes

  • interactions: Is.stale() renamed to Is.absent() to better reflect the purpose of the matcher (8a42a822)
serenity-js - v0.8.0

Published by jan-molak almost 8 years ago

0.8.0 (2016-12-29)

Bug Fixes

  • interactions: Enter.theValue(v: string | number) (c04c5e68)

Features

  • interactions:
    • Active Wait - Screenplay-style equivalent of Protractor's ExpectedConditions (3db8c8ec, closes #7)
    • Clear.theValueOf(t: Target) clears an input field (09712cd2)
    • Passive Wait - Screenplay-style equivalent of Protractor's browser.sleep() (efb1f0cb)

Examples

There are two ways you can wait for things to happen in your test scenarios:

PassiveWait

To make your test wait using a PassiveWait (an equivalent of browser.sleep() in Protractor):

actor.attemptsTo(
  Wait.for(Duration.ofMillis(500)),        // we *assume* that the button will show up during 500ms
  Click.on(InboxNavigation.Compose_Button)
)

Please bear in mind that by using a PassiveWait in your test scenario, you're making an assumption that whatever the condition you're waiting for is, it will be met within the specified timeout. If this assumption turns out to be incorrect (because of the network being slow for instance), your test might result in false negatives. Please try to use ActiveWait instead as it's less prone to assumption-related issues ;-)

Why did I introduce PassiveWait then? Because it's useful with things such as CSS3 animations.

ActiveWait

To make your test wait using an ActiveWait (so actively polling the app until the condition is met):

actor.attemptsTo(
  Wait.until(InboxNavigation.Compose_Button, Is.clickable()),
  Click.on(InboxNavigation.Compose_Button)
)

To specify the maximum timeout:

actor.attemptsTo(
  Wait.upTo(Duration.seconds(10)).until(InboxNavigation.Compose_Button, Is.clickable()),
  Click.on(InboxNavigation.Compose_Button)
)

You might also want to check out the Is class to see what conditions are already defined and find inspiration to write some of your own.

Hope you find the new features useful!
Jan

Many thanks to @npryce for suggesting to introduce the Duration class ✋

Package Rankings
Top 1.64% on Npmjs.org
Badges
Extracted from project README
NPM Version Downloads FOSSA Status CodeFactor Contributors GitHub stars Build Status Coverage Status Known Vulnerabilities Libraries.io dependency status for latest release, scoped npm package semantic-release Serenity/JS on GitHub Serenity/JS on StackOverflow Contribute with Gitpod Follow Serenity/JS on LinkedIn Watch Serenity/JS on YouTube Join Serenity/JS Community Chat Support Serenity/JS on GitHub GitHub stars GitHub Sponsors FOSSA Status