mardi 27 octobre 2020

How to pass a scenario outline with different parameters?

I am using behave to do my tests. I want to play my scenario outline with others parameters, a scenario outine inside a scenario outline in some words. I have

Scenario outlines : Test John access
   Given John enters
   When He could access to <area>
   Then the access is <result>

   Examples:
      | menu      |  result       |
      | area      |  authorized   |
      | security  |  refused      |

I don't want to do copy this test for each employees. I want to loop this like :


Scenario outlines : Test user autorization
   Given all my employees :
        | name      |
        | John      |
        | Jack      | 
        | Lisa      |
 
   Scenario outlines : Test user access
      Given <employee> enters 
      When He could access to <area>
      Then the access is <result>

      Examples:
      | menu      |  result       |
      | area      |  authorized   |
      | security  |  refused      |

How i could to do it ? Thanks in advance for your ideas.

Aucun commentaire:

Enregistrer un commentaire