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

Generating step definitions with Cucumber 6 vs Cucumber 5 #2024

Closed
NicolasLauwereys opened this issue Jun 15, 2020 · 0 comments · Fixed by #2208
Closed

Generating step definitions with Cucumber 6 vs Cucumber 5 #2024

NicolasLauwereys opened this issue Jun 15, 2020 · 0 comments · Fixed by #2208
Labels
⚡ enhancement Request for new functionality
Milestone

Comments

@NicolasLauwereys
Copy link

NicolasLauwereys commented Jun 15, 2020

Description

When executing unimplemented scenarios with Cucumber 5 and JUnit you get an uninterrupted list of all unimplemented steps at the end of the output, so you can copy-paste those directly into your steps definitions class and start implementing.

When using Cucumber 6 however, it seems the generated steps are only displayed with other output inbetween. There is no uninterrupted list at the end of the ouput.

We would like this feature to also be added to Cucumber 6.


Example output with Cucumber 5


You can implement missing steps with the snippets below:

@When("{string} provides all required personal details of a patient:")
public void provides_all_required_personal_details_of_a_patient(String string, io.cucumber.datatable.DataTable dataTable) {
    // Write code here that turns the phrase above into concrete actions
    // For automatic transformation, change DataTable to one of
    // E, List<E>, List<List<E>>, List<Map<K,V>>, Map<K,V> or
    // Map<K, List<V>>. E,K,V must be a String, Integer, Float,
    // Double, Byte, Short, Long, BigInteger or BigDecimal.
    //
    // For other transformations you can register a DataTableType.
    throw new io.cucumber.java.PendingException();
}

@When("she provides the full set of physical details:")
public void she_provides_the_full_set_of_physical_details(io.cucumber.datatable.DataTable dataTable) {
    // Write code here that turns the phrase above into concrete actions
    // For automatic transformation, change DataTable to one of
    // E, List<E>, List<List<E>>, List<Map<K,V>>, Map<K,V> or
    // Map<K, List<V>>. E,K,V must be a String, Integer, Float,
    // Double, Byte, Short, Long, BigInteger or BigDecimal.
    //
    // For other transformations you can register a DataTableType.
    throw new io.cucumber.java.PendingException();
}

@Then("all the details of the patient are added")
public void all_the_details_of_the_patient_are_added() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

@When("{string} provides incorrect details of a patient")
public void provides_incorrect_details_of_a_patient(String string) {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

@Then("the new patient is not added")
public void the_new_patient_is_not_added() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

@Given("a patient is registered with social security number {string}")
public void a_patient_is_registered_with_social_security_number(String string) {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

@When("{string} provides valid details of a patient with the same social security number")
public void provides_valid_details_of_a_patient_with_the_same_social_security_number(String string) {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

@Then("an error is given explaining that {string}")
public void an_error_is_given_explaining_that(String string) {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
@NicolasLauwereys NicolasLauwereys added the ⚡ enhancement Request for new functionality label Jun 15, 2020
@NicolasLauwereys NicolasLauwereys changed the title Generating step definitions with Cucumber 6 in the way it used to be in Cucumber 5 Generating step definitions with Cucumber 6 vs Cucumber 5 Jun 15, 2020
@mpkorstanje mpkorstanje added this to the v6.x.x milestone Jun 23, 2020
mpkorstanje added a commit that referenced this issue Jan 17, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI + summary printer

TODO what about:
 - CLI + summary printer + teamcity plugin?
 - JUnit4 with per-step reporting?
 - #2024
mpkorstanje added a commit that referenced this issue Jan 23, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI + summary printer

TODO what about:
 - CLI + summary printer + teamcity plugin?
 - JUnit4 with per-step reporting?
 - #2024
mpkorstanje added a commit that referenced this issue Jan 23, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI + summary printer

TODO what about:
 - CLI + summary printer + teamcity plugin?
 - JUnit4 with per-step reporting?
 - #2024
mpkorstanje added a commit that referenced this issue Feb 13, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI + summary printer

TODO what about:
 - CLI + summary printer + teamcity plugin?
 - JUnit4 with per-step reporting?
 - #2024
mpkorstanje added a commit that referenced this issue Feb 13, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5
 - Teamcity Plugin

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI

When printing snippets they should be copy-pasted into an IDE without further
editing. This means individual snippets or groups of snippets should not be
separated by spacers, text or anything else.

Fixes: #2024
mpkorstanje added a commit that referenced this issue Feb 13, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5
 - Teamcity Plugin

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI

When printing snippets they should be copy-pasted into an IDE without further
editing. This means individual snippets or groups of snippets should not be
separated by spacers, text or anything else.

Fixes: #2024
mpkorstanje added a commit that referenced this issue Feb 13, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5
 - Teamcity Plugin

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI

When printing snippets they should be copy-pasted into an IDE without further
editing. This means individual snippets or groups of snippets should not be
separated by spacers, text or anything else.

Fixes: #2024
mpkorstanje added a commit that referenced this issue Feb 13, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5
 - Teamcity Plugin

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI

When printing snippets they should be copy-pasted into an IDE without further
editing. This means individual snippets or groups of snippets should not be
separated by spacers, text or anything else.

Fixes: #2024
mpkorstanje added a commit that referenced this issue Feb 13, 2021
The various ways to execute Cucumber report undefined steps inconsistently.
Partially because different tools have different reporting needs. Nevertheless:

When reporting per scenario the suggestion should include snippets for all
undefined steps in that scenario. This applies to:
 - JUnit4
 - TestNG
 - JUnit5
 - Teamcity Plugin

When reporting per test run the suggestion should include snippets for all
undefined steps in the execution. This applies to:
 - CLI

When printing snippets they should be copy-pasted into an IDE without further
editing. This means individual snippets or groups of snippets should not be
separated by spacers, text or anything else.

Fixes: #2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ enhancement Request for new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants