Discussion:
[Cucumber] Scenario without steps not shown
ichy
2017-12-30 08:35:20 UTC
Permalink
Hi,

I recently upgraded cucumber for ruby from 2.4 to 3.1.

i have a feature like below.

```
Feature: scenario_without_any_steps

Scenario: without steps
this scenario has no steps.
i need to have some specifications documented to communicate with my
customer.

Scenario: with steps
this scenario has a step.

When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
```

when i run this feature, i got the output like this.

```
Feature: scenario_without_any_steps

Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events

2 scenarios (1 undefined, 1 passed)
4 steps (4 undefined)
```

it looks like scenario has to have steps to be shown.

i agree with the outcome if cucumber is for test.
but i need output of scenario without steps for html formatter for
documentation.

if i monkey patch a source of
cucumber-ruby-core/lib/cucumber/core/compiler.rb#on_test_case
```
Test::Case.new(test_steps, source).describe_to(receiver) if
test_steps.count > 0
```
to
```
Test::Case.new(test_steps, source).describe_to(receiver)
```

then i will see the other scenario, too.

is this more appropriate to be a tool for communication?
or i might not know an option to make it happen.

i want to hear some opinions if my understanding makes sense or not.

my best regards
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andrew Premdas
2017-12-30 12:54:54 UTC
Permalink
Make a step, 'Dummy step to communicate docs to customer" and put it in
your scenario. (you can call it whatever you want).
Post by ichy
Hi,
I recently upgraded cucumber for ruby from 2.4 to 3.1.
i have a feature like below.
```
Feature: scenario_without_any_steps
Scenario: without steps
this scenario has no steps.
i need to have some specifications documented to communicate with my
customer.
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
```
when i run this feature, i got the output like this.
```
Feature: scenario_without_any_steps
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
2 scenarios (1 undefined, 1 passed)
4 steps (4 undefined)
```
it looks like scenario has to have steps to be shown.
i agree with the outcome if cucumber is for test.
but i need output of scenario without steps for html formatter for
documentation.
if i monkey patch a source of
cucumber-ruby-core/lib/cucumber/core/compiler.rb#on_test_case
```
Test::Case.new(test_steps, source).describe_to(receiver) if
test_steps.count > 0
```
to
```
Test::Case.new(test_steps, source).describe_to(receiver)
```
then i will see the other scenario, too.
is this more appropriate to be a tool for communication?
or i might not know an option to make it happen.
i want to hear some opinions if my understanding makes sense or not.
my best regards
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yuichi Matsuda
2017-12-31 07:37:41 UTC
Permalink
hi,

thank you for your reply.

yes, i could do that if i have to.

but i thought cucumber as communication tool didn't have to require actual
test cases to run.

any thoughts on this?
Post by Andrew Premdas
Make a step, 'Dummy step to communicate docs to customer" and put it in
your scenario. (you can call it whatever you want).
Post by ichy
Hi,
I recently upgraded cucumber for ruby from 2.4 to 3.1.
i have a feature like below.
```
Feature: scenario_without_any_steps
Scenario: without steps
this scenario has no steps.
i need to have some specifications documented to communicate with my
customer.
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
```
when i run this feature, i got the output like this.
```
Feature: scenario_without_any_steps
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
2 scenarios (1 undefined, 1 passed)
4 steps (4 undefined)
```
it looks like scenario has to have steps to be shown.
i agree with the outcome if cucumber is for test.
but i need output of scenario without steps for html formatter for
documentation.
if i monkey patch a source of
cucumber-ruby-core/lib/cucumber/core/compiler.rb#on_test_case
```
Test::Case.new(test_steps, source).describe_to(receiver) if
test_steps.count > 0
```
to
```
Test::Case.new(test_steps, source).describe_to(receiver)
```
then i will see the other scenario, too.
is this more appropriate to be a tool for communication?
or i might not know an option to make it happen.
i want to hear some opinions if my understanding makes sense or not.
my best regards
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Eric Kessler
2017-12-31 14:53:50 UTC
Permalink
Post by Yuichi Matsuda
hi,
thank you for your reply.
yes, i could do that if i have to.
but i thought cucumber as communication tool didn't have to require actual
test cases to run.
any thoughts on this?
Cucumbers's purpose is executable documentation. The Gherkin feature files
themselves are the documentation part of that. They can capture behavior
and facilitate conversation. Having step definitions and other support code
allows Cucumber to execute said documentation. In doing so, it indicates if
the documentation actually agrees with the thing being documented.

If you are wanting ALL scenarios to be executed by Cucumber so that you
have pretty output for documentation, then you are relying on a side effect
of the tool instead of using a tool whose primary purpose is consuming
feature files and making pretty documentation out of them. Consider using a
tool that will transform your feature files into HTML in a static manner
instead of having to run them in order to do so.

Relish <https://relishapp.com/> - A documentation hosting service made by
the Cucumber folks. It's functionally complete but currently in maintenance
only mode.
Cucumber Pro <https://cucumber.io/pro> - The currently developed
replacement for Relish. It's in early access right now.

Alternatively, you could create your own. It looks like you are using Ruby,
so generating pretty HTML features should be as easy as combining ERB
<http://www.stuartellis.name/articles/erb/> templates with data extracted
from parsed feature files. Parsing feature files can be done with the
`gherkin` <https://github.com/cucumber/cucumber/tree/master/gherkin> gem or
using other <https://github.com/enkessler/cuke_modeler> gems that
facilitate doing things with feature files.
Post by Yuichi Matsuda
Post by Andrew Premdas
Make a step, 'Dummy step to communicate docs to customer" and put it in
your scenario. (you can call it whatever you want).
Post by ichy
Hi,
I recently upgraded cucumber for ruby from 2.4 to 3.1.
i have a feature like below.
```
Feature: scenario_without_any_steps
Scenario: without steps
this scenario has no steps.
i need to have some specifications documented to communicate with my
customer.
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
```
when i run this feature, i got the output like this.
```
Feature: scenario_without_any_steps
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
2 scenarios (1 undefined, 1 passed)
4 steps (4 undefined)
```
it looks like scenario has to have steps to be shown.
i agree with the outcome if cucumber is for test.
but i need output of scenario without steps for html formatter for
documentation.
if i monkey patch a source of
cucumber-ruby-core/lib/cucumber/core/compiler.rb#on_test_case
```
Test::Case.new(test_steps, source).describe_to(receiver) if
test_steps.count > 0
```
to
```
Test::Case.new(test_steps, source).describe_to(receiver)
```
then i will see the other scenario, too.
is this more appropriate to be a tool for communication?
or i might not know an option to make it happen.
i want to hear some opinions if my understanding makes sense or not.
my best regards
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
Eric K
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yuichi Matsuda
2018-01-01 00:59:55 UTC
Permalink
hi,

thank for your reply.

i totally forgot about the keyword "executable".
that makes sense.

i often start writing non executable parts and communicate, then make
important parts executable.

so, when i checked the source code which excluded scenarios without steps,
i misunderstood that it was for performance tuning or something.

but now i can understand it differently.
Post by Eric Kessler
Post by Yuichi Matsuda
hi,
thank you for your reply.
yes, i could do that if i have to.
but i thought cucumber as communication tool didn't have to require
actual test cases to run.
any thoughts on this?
Cucumbers's purpose is executable documentation. The Gherkin feature files
themselves are the documentation part of that. They can capture behavior
and facilitate conversation. Having step definitions and other support code
allows Cucumber to execute said documentation. In doing so, it indicates if
the documentation actually agrees with the thing being documented.
If you are wanting ALL scenarios to be executed by Cucumber so that you
have pretty output for documentation, then you are relying on a side effect
of the tool instead of using a tool whose primary purpose is consuming
feature files and making pretty documentation out of them. Consider using a
tool that will transform your feature files into HTML in a static manner
instead of having to run them in order to do so.
Relish <https://relishapp.com/> - A documentation hosting service made by
the Cucumber folks. It's functionally complete but currently in maintenance
only mode.
Cucumber Pro <https://cucumber.io/pro> - The currently developed
replacement for Relish. It's in early access right now.
Alternatively, you could create your own. It looks like you are using
Ruby, so generating pretty HTML features should be as easy as combining
ERB <http://www.stuartellis.name/articles/erb/> templates with data
extracted from parsed feature files. Parsing feature files can be done with
the `gherkin` <https://github.com/cucumber/cucumber/tree/master/gherkin> gem
or using other <https://github.com/enkessler/cuke_modeler> gems that
facilitate doing things with feature files.
Post by Yuichi Matsuda
Post by Andrew Premdas
Make a step, 'Dummy step to communicate docs to customer" and put it in
your scenario. (you can call it whatever you want).
Post by ichy
Hi,
I recently upgraded cucumber for ruby from 2.4 to 3.1.
i have a feature like below.
```
Feature: scenario_without_any_steps
Scenario: without steps
this scenario has no steps.
i need to have some specifications documented to communicate with
my customer.
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
```
when i run this feature, i got the output like this.
```
Feature: scenario_without_any_steps
Scenario: with steps
this scenario has a step.
When i have steps
Then cucumber emits events
When i don't have steps
Then cucumber doesn't emit events
2 scenarios (1 undefined, 1 passed)
4 steps (4 undefined)
```
it looks like scenario has to have steps to be shown.
i agree with the outcome if cucumber is for test.
but i need output of scenario without steps for html formatter for
documentation.
if i monkey patch a source of
cucumber-ruby-core/lib/cucumber/core/compiler.rb#on_test_case
```
Test::Case.new(test_steps, source).describe_to(receiver) if
test_steps.count > 0
```
to
```
Test::Case.new(test_steps, source).describe_to(receiver)
```
then i will see the other scenario, too.
is this more appropriate to be a tool for communication?
or i might not know an option to make it happen.
i want to hear some opinions if my understanding makes sense or not.
my best regards
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
------------------------
Andrew Premdas
blog.andrew.premdas.org
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google
Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
Eric K
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...