Skip to content Skip to sidebar Skip to footer

How Do I Handle An Array Of Promises Using Protractor W/ Chai-as-promised

I am using Protractor with CucumberJS and chai-as-promised (given that CucumberJS does not have a built-in assertions library) to build an automated test suite. Everything works fi

Solution 1:

I had same challenge, this is how I solved:

this.Then(/^I should see my user entry with proper values in the list$/, function (callback) {
    var verifyUser = Q.all([
        usersPage.verifyUserFirstName('tony@gmail.com'),
        usersPage.verifyUserLastName('tony@gmail.com'),
        usersPage.verifyUserPhone('tony@gmail.com')
    ]);
    expect(verifyUser).to.eventually.deep.equal(['Tony', 'Bui', '8764309111').and.notify(callback);
}

I hope that helps!

Post a Comment for "How Do I Handle An Array Of Promises Using Protractor W/ Chai-as-promised"