Gathering detailed insights and metrics for cucumber-generator
Gathering detailed insights and metrics for cucumber-generator
Gathering detailed insights and metrics for cucumber-generator
Gathering detailed insights and metrics for cucumber-generator
cucumber-html-report-generator
Generate beautiful cucumberjs html reports for multiple instances (browsers / devices)
cucumber-steps-generator
cucumber steps generator
cucumber-spec-generator
A script, designed to run with npx, to generate cucumber test spec using a feature file as reference.
generator-cucumber-js
Yeoman generator for setting up cucumber functional tests
npm install cucumber-generator
Typescript
Module System
Node Version
NPM Version
TypeScript (88.89%)
EJS (5.18%)
Gherkin (3.76%)
JavaScript (1.9%)
Shell (0.27%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
159 Commits
3 Forks
1 Watchers
8 Branches
1 Contributors
Updated on Feb 14, 2022
Latest Version
2.0.1
Package Id
cucumber-generator@2.0.1
Unpacked Size
30.55 kB
Size
8.13 kB
File Count
21
NPM Version
10.2.3
Node Version
20.10.0
Published on
Apr 07, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Simple generator for cucumber features. It's still under development and currently can transform only simple features to following templates:
but basicaly there can be any yours template given as parameter.
Of course you can use jest-cucumber
templates but if you're using other library
or you have many feature files and you don't want to copy-paste the code from console
then this tool is made for you. :)
Generator will lookup for all features in given directory and generate .spec.ts
files accordingly.
Do I need to state the obvious? :smile:
1yarn add -D cucumber-generator
or
1npm install -D cucumber-generator
Usage: npx cucumber-generator [parameters]
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
--includeDirectory If present, the file is generated into the directory
with same name as feature name (within output
folder) [boolean] [default: false]
--output [required] [choices: "stdio", "file"]
-f, --featuresDirectory [string] [required]
--templatesDirectory [string]
--template [string] [default: "jest-cucumber"]
--relativePathToFeatures [string] [default: "./"]
--maintainStructure [boolean] [default: true]
--verbose [boolean] [default: false]
Consider this feature file
1Feature: Car 2 This feature describes how a car works 3 Scenario: Unlock car 4 Given keys 5 Given locked car 6 When person presses an unlock button 7 And tries to open the door 8 Then the door should open 9 10 Scenario: Start engine 11 Given unlocked car 12 When person inserts key into ignition 13 And turns the key 14 Then car should start
after running npx cucumber-generator
(with additional parameters described before) the
result will be
1import { defineFeature, loadFeature } from 'jest-cucumber'; 2 3const feature = loadFeature('../src/fixtures/Simple.feature'); 4 5defineFeature(feature, test => { 6 test('Unlock car', ({ given, when, and, then }) => { 7 given('keys', () => { 8 }); 9 given('locked car', () => { 10 }); 11 when('person presses an unlock button', () => { 12 }); 13 and('tries to open the door', () => { 14 }); 15 then('the door should open', () => { 16 }); 17 }); 18 test('Start engine', ({ given, when, and, then }) => { 19 given('unlocked car', () => { 20 }); 21 when('person inserts key into ignition', () => { 22 }); 23 and('turns the key', () => { 24 }); 25 then('car should start', () => { 26 }); 27 }); 28});
There is TemplateGenerator
class available with following constructor params:
template: string
- mandatory parameter, defines a template to generate (currently just jest-cucumber
)options
:
featuresDirectory: string
- defines root for searching featuresoutputDirectory: string
- defines where the files will be generatedmaintainStructure: string | undefined
- whether copy directory tree when generating spec files (default: true
). If set to false
, spec files will be generated all in single directory.variables: Record<string, any>
- variables passed to template file when generating
relativePathToFeatures: string
- mandatory variable, defines where are feature files stored relatively to spec files (needed due to loadFeature
function in jest-cucumber
)1import {TemplateGenerator} from 'cucumber-generator'; 2 3const outputDirectory = './out'; 4const featuresDirectory = './src/test/features'; 5const relativePathToFeatures = '../src/test/features'; 6 7const generator = new TemplateGenerator('jest-cucumber', { 8 outputDirectory, 9 featuresDirectory, 10 variables: { 11 relativePathToFeatures, 12 }, 13}); 14const result = await generator.generate();
Any help with the package is always welcome, just be sure to write and run the tests.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More