How to loop consecutive actions sequentially in protractor test?
A cleaner approach would be to dynamically create a separate spec for every user:
describe("Testing instructors", function () { var instructors = [ "user1", "user2" ]; instructors.map(function(instructor) { it("setup personal profile for instructor '" + instructor + "'", function() { // test logic here }); });});
One of the benefits of this approach is error-handling: if a test fails for a particular instructor, you would immediately see it from the spec description.
Plus, it()
blocks are guaranteed to be executed sequentially.