Cucumber.Decorators
Typescript Decorators for Cucumber Tests
Cucumber Example
Feature File
Feature: Local server test As a developer I want check the web site Background: Given I open the url "http://www.google.com" Scenario: Google Then I expect that the title is "Google"
Typescript Step File
;; ; ;
Development Prerequisites
- Typescript
- JAVA
- Chromedriver
Run Example
To run the example you will need to clone the repo as the npm package was designed to be as small as possible.
git clone https://github.com/FlippieCoetser/Cucumber.Decoratorsnpm installnpm run buildnpm run demo
Note: When node-gyp produces an error, first install windows-build-tools globally and set the config to the correct version.
npm install --global --production windows-build-tools
npm config set msvs_version 2015 --global
Explanation
The cucumber
Decorator updates the class constuctor to ensure each method within the class is executed during instantiation.
The given
Decorator wraps the provided method and passes the expression into the required cucumber function.
Note: the when
and then
Decorator operates in a similar fashion as the given
Decorator.