Giter Site home page Giter Site logo

Comments (7)

j8kin avatar j8kin commented on August 24, 2024 1

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.

j8kin avatar j8kin commented on August 24, 2024 1

@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.

bruno-morel avatar bruno-morel commented on August 24, 2024 1

let me look into the PR

from jest-cucumber-fusion.

j8kin avatar j8kin commented on August 24, 2024

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.

hmorey3 avatar hmorey3 commented on August 24, 2024

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.

hmorey3 avatar hmorey3 commented on August 24, 2024

@j8kin any update on whether the PR you opened will fix the issue presented above? Thanks for your help.

from jest-cucumber-fusion.

bruno-morel avatar bruno-morel commented on August 24, 2024

sorry it took so long :(

from jest-cucumber-fusion.

Related Issues (17)

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.