Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data tables #149

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Data tables #149

wants to merge 9 commits into from

Conversation

ilyapuchka
Copy link
Collaborator

@ilyapuchka ilyapuchka commented Dec 17, 2018

Resolves #41, resolves #146

This PR adds support for data tables. Examples of supported formats can be found in the doc comments for the new StepDefiner methods in NativeDataTable.swift and in ExampleFeatures tests. Both native and swift tests can use data tables. Examples are taken from a cucumber reference

The main difference of data tables and a step in an outline with values in examples is that the step in the outline will be invoked multiple times and each time will receive one element of example values, when with data tables it will be invoked once with all values in one collection.

Example:

Given("I add the following numbers:") {
    [1, 2, 3]
}
Given I have the following array:
| 1 |
| 2 |
| 3 |

@ianrhamilton
Copy link

How close are we to getting this feature merged?

@EfrainAndres
Copy link

EfrainAndres commented Apr 2, 2019

Hello man,
the changes you made are in the master branch?

@kerrmarin
Copy link
Member

👋 Sorry for the delay. Will review/test today.

Copy link
Contributor

@deanWombourne deanWombourne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm loving this :)

The only issue I have is that in the step definitions (i.e. Tests/StepDefinitions.swift:194) the step needs to know whether it's been invoked from a Swift or a Native gherkin file (i.e. whether it should use DataTable or NativeDataTable as it's match type.

Is there any way of unifying these types somehow?

@ilyapuchka
Copy link
Collaborator Author

I think it won't be an issue in a reality as if one need to use the same step both with native and swift features with data tables (i.e. migrating from one format to another) they can extract code in this step into a reusable function or just call one step from another. But I think in most cases only one type of features is used.
I've improved docs around native data tables though.

@bbe02
Copy link

bbe02 commented Apr 27, 2021

Hey @ilyapuchka, it will be nice if this PR can be merged after resolving the conflicts. Really looking forward to use the cucumber datatable facility.

@ianrhamilton
Copy link

Been a couple of years now - will this ever be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to expand a capture group into a custom type when using NativeTestCase? Data Tables?
6 participants