Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I tried the following steps:</p> <pre><code>When /^I do something$/ do puts "Hello" end Then /^something happens$/ do end </code></pre> <p>...with the following command:</p> <pre><code>cucumber -f html -o results.htm </code></pre> <p>...when I opened up the <code>results.html</code> file in a browser, it displayed the "Hello" message just after displaying the step. I've attached the pertinent section of the HTML output so you can see that the output from <code>puts</code> is there:</p> <pre><code>&lt;!-- the first step --&gt; &lt;li id='features_thing_feature_4' class='step passed'&gt; &lt;div class="step_name"&gt; &lt;span class="keyword"&gt;When &lt;/span&gt; &lt;span class="step val"&gt;I do something&lt;/span&gt; &lt;/div&gt; &lt;div class="step_file"&gt; &lt;span&gt;features/step_definitions/thing_steps.rb:1&lt;/span&gt; &lt;/div&gt; &lt;/li&gt; &lt;!-- anything that the above step passed to `puts` --&gt; &lt;li class="step message"&gt;Hello&lt;/li&gt; &lt;!-- the second step --&gt; &lt;li id='features_thing_feature_5' class='step passed'&gt; &lt;div class="step_name"&gt; &lt;span class="keyword"&gt;Then &lt;/span&gt; &lt;span class="step val"&gt;something happens&lt;/span&gt; &lt;/div&gt; &lt;div class="step_file"&gt; &lt;span&gt;features/step_definitions/thing_steps.rb:5&lt;/span&gt; &lt;/div&gt; &lt;/li&gt; </code></pre> <p>What that demonstrates is that when cucumber's <code>puts</code> method is called (ie: directly from within a step) the output will be included in the html output. But if the <code>puts</code> call is from somewhere else (eg: your modules) then it won't be included. You could consider moving your <code>puts</code> calls from the modules to the steps. Also, using <code>puts</code> isn't really best practice so you may want to consider removing it altogether...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload