Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I repeat steps in a Specflow Scenario Outline
    text
    copied!<p>In a nutshell, what I need is to create a Scenario Outline with a step that is repeatable without having to type it in using multiple AND's as I am currently doing below:</p> <pre><code>Scenario Outline: outline Given I am a user When I enter &lt;x&gt; as an amount And I enter &lt;x2&gt; as an amount Then the result should be &lt;result&gt; Scenarios: |x|x2|result| |1|2 |3 | |1|0 |1 | </code></pre> <p>However, I would like to do something like the following:</p> <pre><code>Scenario Outline: outline Given I am a user When I enter &lt;Repeat: x&gt; as an amount Then the result should be &lt;result&gt; Scenarios: |x |result| |1,2,3|6 | |1,2 |3 | </code></pre> <p>Basically, I want the "I enter as an amount" to run 3 and 2 times respectively.</p> <p>The closest I have found to this question is <a href="https://stackoverflow.com/questions/7335794/how-do-i-re-run-a-cucumber-scenario-outline-with-different-parameters">How do I re-run a cucumber scenario outline with different parameters?</a> , but I wanted to double check before giving up and using a StepArgumentTransformation with a comma separated list or something similar.</p> <p>The final answer that I went with is something more like this:</p> <pre><code>Scenario Outline: outline Given I am a user When I enter the following amounts | Amount1 | Amount 2| Amount3| | &lt;Amt1&gt; | &lt;Amt2&gt; | &lt;Amt3&gt; | Then the result should be &lt;result&gt; Scenarios: |Amt1 |Amt2 |Amt3 |result| |1 |2 |3 |6 | </code></pre> <p>There does not seem to be a good way to leave a value blank though, but this is pretty close to the solution I was looking for</p>
 

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