2 ways to do this imho,
Since .click is actually creating promise, you cannot just while loop it - it will just create bunch of same promises. I created a recursive function for this:
reclick = function(elementos) {
if (elementos.isDisplayed()) {
elementos.click().then(function () {
console.log('click');
//YOUR CHECKS AFTER CLICK HERE
return reclick(elementos);
});
}
};
reclick(anyElement);
You could probably made it reusable with another function as a parameter with Code you want to execute after click...
- easier version is wrapping extra
it('should have something after click')
into while() loop, that way you don`t have to deal with promises(but it depends on what you have in afterEach(), beforeEach()...