Giter Club home page Giter Club logo

Comments (2)

roskee avatar roskee commented on September 25, 2024

On what scenarios would it help you to use a step definition that has no data table but is implemented with a function receiving a table? godog generates functions based on the feature file step definitions - that means the source of the function structure are the step definitions. if a step has no data table associated with it godog assumes it needs none. And by the way you can pass empty tables by providing only the table column names.

Feature:
        Scenario:
              Given an example step
              | name | age | gender |

from godog.

xenomote avatar xenomote commented on September 25, 2024

there are heavily reused stepdefs where it is convenient to express extra named values in the data table in a key-value format. this saves needing to define multiple stepdefs for every possible combination of optional values as part of a step:

Feature:
        Scenario:
              Given an example step
              | value x | 123  |
              | value y | 345 |
              | value z | 546 |

This is useful in cases where there are unknown numbers and possible combinations of these optional values

In these cases, it would be convenient to allow the table to be omitted if no optional values are required, otherwise another step with slightly different wording is needed in order to pass the table or not.

The step function is already able to define how it interprets the table. all that would be required is the scenario parser to check if the function expects a data table, and to pass an empty table if none is provided in the cucumber

from godog.

Related Issues (20)

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.