b-yond-infinite-network / jest-cucumber-fusion Goto Github PK
View Code? Open in Web Editor NEWWrite cucumber test the natural way but still have them part of a jest run (including coverage)
License: Apache License 2.0
Write cucumber test the natural way but still have them part of a jest run (including coverage)
License: Apache License 2.0
Similarly to https://github.com/TheBrainFamily/cypress-cucumber-preprocessor and https://github.com/sjmeverett/gherkin-jest , I would like to have the capability of loading all features files by the testing framework, as well as the ability of reusing steps across features so they only need to be implemented once.
This library however, makes feature files dependent on where they come from. Because we export our features from an bug tracking system from time to time, I find it inconvenient that I have to hardcode the feature file paths.
When we try something like this:
Scenario Outline: whatever Scenario
When some <variable> is also used with 'another_variable'
Then ....
....
Example Outline:
| variable |
| value1 |
| value2 |
It seem that the regexp priority in jest-cucumber is wrong when there's more than 1 entity in the sentence
When Scenario Outline contains step with RegExp in Definition and using example value in Table at the same time then during execution example value is not substituted in step.
For example:
Scenario Outline: <description>
Given Some step with <exampleValue> and use table:
| field | value |
| SomeField | <exampleValue> |
Examples:
| exampleValue |
| myValue |
then during the execution scenario step contains: { field: 'SomeField', value: '<exampleValue>'} instead of { field: 'SomeField', value: 'myValue'}
Hi,
I am able to successfully use capture groups in regex stepdefs and separately gherkin tables in a different step def, but I can not use both in the same step def. This is something that is available in jest-cucumber, and so it's something I think should be supported here.
When I try the step def below, only the first parameter is given a value.
Then(/^a (\d+) result is returned from the endpoint&/, ((httpCode_CucumberInput: string, result_CucumberInput: string) => {
...
}))
Hello,
Happy New Year !
I added the possibility of having a sentence can be matched with regEx when it is a datatable.
It is useful in my project to have only one parameterizable sentence example:
[...]
Then I should see the following 2 todos in my list:
| TaskName | Priority |
| Watch the cat | high |
| Registration | high |
and another Scanario
[...]
Then I should see the following 3 todos in my list:
| TaskName | Priority |
| Watch the cat | high |
| Registration | high |
| Journal | high |
It allows me to have only 1 sentence
Then(/^I should see the following (\d) todos in my list:$/, (param1, table) => {
expect(table[0].TaskName).toBe('Watch the cat')
})
The datatable should always be the last parameter.
PR is Here: #18 (comment)
Trying to use an array definition regex fails: ([(?: \d+(?: |, |,))+])
We should be able to do
Scenario: Folding ourselves in 2D
Given I am Elon Musk attempting to launch a rocket into space
And my position in 2D space is [ 0, 2 ]
When I launch the rocket
Then the rocket should end up in space
I'm trying to add tests in another language (than english) but this doesn't work.
I dived in this problem and came to the conclusion that this should be fixed in jest-cucumber: bencompton/jest-cucumber#107
Any thoughts?
First of all, nice stuff. I've been using BDD and cucumber for 5 years now and am a huge fan of the approach.
So, do you support multi-scenario feature files? if yes, what's the syntax?
Thanks.
A tricky one:
Scenario: Testing simple inception
Given my account name is 'a'
When I get an new account name 'name' with a type Test from my old account named 'a'
Then my account name should be "name" and have a type Test
Currently fusion keyword in stepdefinition file is to include only 1 feature. Can we include all the feature files in stepdefinitions file.
For standard scenario (non-outline) like this:
Feature: Rocket Launching
Scenario: Launching a SpaceX rocket
Given I am Elon Musk attempting to launch a rocket into space
When I launch the '<personal rocket>'
Then the rocket should end up in space
And the booster(s) should land back on the launch pad
But nobody should doubt me ever again
The 2d steps will be broken and fail execution everytime.!
Describe the feature you'd like:
I would like to add semantic release (the way we are using for infinity-ui-lib. So the process for generating releases, change log is fully automated.
If this is something that you think will work, i can do a PR.
The latest version on https://www.npmjs.com/ is 0.8.1 which is published 2 years ago.
It seems autopublishing as result of merge pull request is not working.
Is it possible to fix this problem and upload a new version in npmjs
Eugene...
Hi,
Gherkin Background keyword is very useful for avoiding repeating Given steps in features. It is supported in jest-cucumber. Any luck adding to jest-cucumber-fusion?
Thank you.
I have a feature with one or more scenarios (let's call them X, Y an Z)
I'm developing a test suite
I want to add a new scenario: W
I want to execute only scenario W for faster development cycle
There's actually no way to tell jest
to only run scenario W but temporary removing X, Y and Z from the feature file.
Basically, I'm missing the concept of scenario
in my tests code. Using regular jest
's describe
I can isolate test cases during development (and even debug it). I'm looking for the same behaviour, but using cucumber-like test definitions.
Is it even possible?
jest-cucumber 2.0.0 does not support updated Gherkin syntax
Including Rule
Error parsing feature Gherkin: Parser errors:
(34:5): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'Rule: User must authenticate'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.