Comments (7)
I suppose yes here is an example from the same test scenario (it use the same step definition):
Scenario: Complex Scenario
This scenario is necessary to make sure that related steps are working without examples.
Given I have 0 items for sale
When I bought the following items:
| Item |
| Mist written by Stephen King |
| Metallica. ReLoad. |
| Sabaton. Great War |
Then I have 3 items for sale
Then I want to sell 2 items if they in list
| Item |
| Sabaton. Great War |
| Cucumber for dummies |
And by the way actually I faced with the same issue as you are but with scenario outline.
I need to double check the solution after my PR will be merge I'm not 100% sure it will fix it )))
from jest-cucumber-fusion.
@hmorey3,
I'm not the owner. Just contribute the code. @bruno-morel should approve, merge and deploy new version into NPM.
from jest-cucumber-fusion.
let me look into the PR
from jest-cucumber-fusion.
Hi,
In my PR:
https://github.com/b-yond-infinite-network/jest-cucumber-fusion/pull/31/files
You may see step definition:
Then(/^I want to sell (\d+) items if they in list$/, (nItems, table) => {
if (typeof nItems !== "string") return;
if (typeof table === "string") return;
let iNumber = Number(nItems);
table.forEach((row) => {
if (iNumber > 0 && onlineSales.listedItems.includes(row.Item)) {
onlineSales.sellItem(row.Item);
iNumber--;
}
});
});
And usage:
Then I want to sell <nSale> items if they in list
| Item |
| Sabaton. Great War |
| <SaleItemName> |
Then I have <NItems> items for sale
Examples:
| nSale | SaleItemName | NItems |
| 2 | Cucumber for dummies | 2 |
And it seems this test pass.
I suppose that you are talking about this behavior.
If you want to pass Gherkin table in second parameter it shouldn't be 'string' as in your example:
result_CucumberInput: string
from jest-cucumber-fusion.
Ah yes, you're right about the string being the wrong type but I believe the issue is still there regardless.
The example you gave looks like what I want to be able to do though, although I wasn't using a scenario outline. Will your PR fix it in the case I'm not using a scenario outline?
from jest-cucumber-fusion.
@j8kin any update on whether the PR you opened will fix the issue presented above? Thanks for your help.
from jest-cucumber-fusion.
sorry it took so long :(
from jest-cucumber-fusion.
Related Issues (17)
- Possibility of using semantic release ? HOT 3
- [Question] Can I execute one scenario only? HOT 2
- [Question] Multiple scenarios HOT 1
- [Request] Outline Scenario Title Variables HOT 1
- language support HOT 12
- Background support HOT 1
- RegEx With Databale HOT 1
- Non-outline expression bracket-enclosed (<>) with multiple words separated by a space HOT 1
- Add support for jest-cucumber 3.0.0 HOT 4
- Ability to find and load all feature files and to define steps independently from feature file paths HOT 1
- Scenario examples are incorrectly parsed when using in step with tables HOT 1
- Jest-cucumber doesn't allow a mix of more then 1 variable and 1 outline variable on the same steps HOT 1
- Autopublishing in npmjs is not working
- Expression written with a potential value in their text will fail with the variable undefined HOT 1
- Cucumber fusion for multiple feature files in Step definition HOT 2
- Complex array reg exp do not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest-cucumber-fusion.