vamsitp / spexdocs

Docs for Spex
3 stars 0 forks source link

Specflow: Scenario Outline #1

Open hxtreme99 opened 3 years ago

hxtreme99 commented 3 years ago

At the moment there isn't a way/option to separate the scenarios. Like this:

image

In my case, this would help a lot, since at the moment it creates a unique case and not 3 individual cases. I want to have them separated because of automation in the Release Pipeline.

When separating you will need to pass for the automation link, e.g., ("0","0","0","null"). If you don't pass the "null" it will not work -> auto-discover.

hxtreme99 commented 3 years ago

PS: I'm using a self-hosted version of ADO (if that matters) and using Nunit runner

vamsitp commented 3 years ago

@hxtreme99 - Could you paste a screenshot of how they would appear in AzDevOps (Test-Case > Automation fields tab) if you manually "Associate test-case" from Visual Studio? (PS: I'm having some issue with VS in doing so)

hxtreme99 commented 3 years ago

EDITING since I messed up my explanation. @vamsitp

So, manually associating the Test Case: image

This is the aspect in ADO: image

The difference when it automatically links is that it does not pass like ("0","0","0",null) but just the general one: image

And in order for the automation to work, I would need 3 entries that associate with the 3 "AddTwoNumbersPermutations".

NOTE: That last part is for the tags, like this example: image So instead of (... , null) it would have 3 w/ (... , "eita") and 3 more w/ (... , "nein")

vamsitp commented 3 years ago

Notes

  1. Use ScenarioOutlineExamplesInline=true to create multiple Test-cases by default
  2. Add multiple @testcase tags when multiple test-cases are created (at ScenarioOutline level or Example level?)?
  3. Map the count of @testcase tags with number of examples?
  4. Handle updates to ScenarioOutline/Examples (during re-sync)
hxtreme99 commented 3 years ago

Hey :)

  1. Nice!

  2. Yes, for example: image In this case, this Scenario Outline has an Example with 3 lines so at the Scenario Outline level we could have @testcase=30540 (for 0) @testcase=30541 (for -1) and @testcase=30542 (for 6). Of course, this logic will only be applied with "ScenarioOutlineExamplesInline=true". This way it will assign a test automation per "@testcase=" which is what is need for ADO to run them in the Pipelines. image

  3. For multiple examples, it will only matter if they have different "@". If they don't have distinct "@" they be dealt has one long "Examples" even if they are divided, for example: image Which translated to the test explorer has: image (it even detected duplication)

But if we have distinct "@" like: image this translates has: image and now duplication is allowed

  1. Nice :)

Hope to have been able to answer to everything :)

vamsitp commented 3 years ago

Yeah, thx 🙂, I was just taking some notes (for later reference) when I start looking into it. A little busy at the moment, so shall try and check it in a couple of weeks...

David-pixel-hub commented 1 year ago

Hi, I'm trying to create a test case for each iteration of my scenario but I can't get it, I've set ScenarioOutlineExamplesInline:true to Spex.json and all it does is use my example values in each step of the test case. Help please, I'm using version 1.2.0 @vamsitp @hxtreme99