Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cucumber-enhancement

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cucumber-enhancement

Enhances cucumber.js to make it easier to interact between steps

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

cucumber-enhancement

Enhances cucumber.js to make it easier to interact between steps.

Simple usage

  • Create a file features/step_definitions/world-enhance.js as follows
const {setWorldConstructor} = require('cucumber');

setWorldConstructor(require('cucumber-enhancement'));

This modifies the World object to do the following:

  • Write attributes for later retrieval:
Given(/^I am on the "([^/"]*)\/([^"]*)" repository on GitHub$/, function (owner, repo) {
    // This saves owner and repo for use in other steps
    this.setAttributes({
        owner,
        repo
    });
});
  • Read attributes from previous steps:
Then(/^I should see "([^"]*)" as one of the branches$/, function (branch) {
    const data = this.getAttributes({
        branches: this.joi.array()
    });

    // data.branches contains data saved from another step
    expect(data.branches).to.contain(branch);
});
  • Exposes joi interface for quick access during step definition (see above).

Keywords

FAQs

Package last updated on 15 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc