Virgomax / reuse-cucumber-scenarios

Reuse cucumber scenarios by using "Given the scenario [scenario's tag]"
MIT License
10 stars 1 forks source link

Assigning Tag to Feature Breaks Reuse #4

Closed bliles closed 5 years ago

bliles commented 6 years ago

I hit an odd issue when I tagged a whole feature, I started getting the error: The scenario "..." has to be defined and executed before calling it.

I'm assuming this is likely due to how cucumber handles the tags when there is a tag on the feature file. Removing the tag on the feature resolves the problem.

Virgomax commented 5 years ago

Hi @bliles, Yes, I can see the error now. For now, I'd leave it like that unless you really need to tag the feature itself. Glad to know you find this library helpful, thanks.

bliles commented 5 years ago

HI @Virgomax thanks very much for responding.

Let me explain why I need to be able to tag features. Especially in the development of scenarios and step definitions, it is extremely helpful if I can limit the scope of a test run to a particular set of features that I am actively iterating on instead of having to run the entire test suite. Also, since I'm currently doing a project to jumpstart integration tests for my team, I'm concerned about integrating a plugin to cucumber that breaks native functionality.

Just hoping perhaps you'll reconsider.

Thanks.

Virgomax commented 5 years ago

@bliles Good News! I fixed the issue in the version 1.1.7. Just make sure to call a scenario by the first tag in the line located just above the "Scenario:" keyword in the feature file as shown in the following example ( notice position of tag @my_scenario_tag_that_i_use_to_call_it ):

@this_is_a_feature_tag @this_is_another_feature_tag
Feature: my feature description
  Some nice description here.

@this_tag1_will_be_ignore_by_this_library @this_tag2_will_be_ignore_by_this_library
@my_scenario_tag_that_i_use_to_call_it @this_tag3_will_be_ignore_by_this_library
 Scenario: some scenario to open windows
    Given there are "1" users

Hope that solves the problem. Glad to help :) .

bliles commented 5 years ago

Fantastic, thanks very much!