Forum Discussion

loridee's avatar
loridee
New Contributor
5 years ago
Solved

BDD Step Reuse

Hi,   Anyone have any ideas or suggestions for reusing 2 BDD steps that differ only in their keyword?    Given I log in as John Smith When I log in as John Smith   Would really love thi...
  • AlexKaras's avatar
    5 years ago

    Hi,

     

    Hm-m-m...

    Is there anything that prevents this:

    Given ("I log in as John Smith", function () {

         login();

    });

     

    When ("I log in as John Smith", function () {

         login();

    });

     

    function login() {

      // ...

    };

     

    ?