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 this to be either a single step (can I wildcard the Given or When keywords?!) or two steps but one step calls the other:
Given ("I log in as John Smith", function () {
// login code here
});
When ("I log in as John Smith", function () {
// call the Given here, as it already has the necessary code implemented
});
Some BDD libraries also offer a generic 'Step' keyword which matches any step type, but I don't believe TestComplete supports it.
Any help/suggestions greatly appreciated! Trying our best to prevent massive code bloat.
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() {
// ...
};
?