GithubHelp home page GithubHelp logo

brainhubeu / cucumber-steps Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 6.0 622 KB

๐Ÿฅ’ Quick start for testing with Cucumber.js

Home Page: https://brainhub.eu/

License: MIT License

Gherkin 12.98% JavaScript 87.02%
cucumber cucumber-steps testing-tools testing-practices cucumber-js cucumber-tests cucumber-framework cucumberjs chai mocha sinon superagent

cucumber-steps's Introduction


cucumber-steps

Quick start for testing with cucumber

Hire us

CircleCI Last commit license PRs Welcome Renovate enabled

Downloads Activity Minified npm Contributors

Getting started

Install library

with npm: npm i --save-dev @brainhubeu/cucumber-steps

or with yarn: yarn add --dev @brainhubeu/cucumber-steps

Add following in anywhere in your step-definitions directory

import { defineSupportCode } from 'cucumber';
import stepsSupport from '@brainhubeu/cucumber-steps';

defineSupportCode(stepsSupport);

Available steps

Setting headers

Given I set header "heder-name" with value "header-value"

Sending request

When I send a "METHOD" request to "/path"

Sending request with body

When I send a "METHOD" request to "/path" with body:
  """
  {
    "name": "Wonderful coffee",
    "project": {
      "name": "Coffee"
    }
  }
  """

Chcking response code

Then the response code should be 111

Checking response body

Then the JSON should match pattern
  """
  {
    "name": "Wonderful coffee",
    "project": {
      "name": "Coffee"
    }
  }
  """

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.