So I have been trying to figure out if its possible to do something like this.
it('Check for remove button', function () {
element.all(by.className('btn btn-remove btn-outlined')).getText().then(function (text) {
for (var i = 0; i < text.length; i++) {
console.log(i) //Prints 0 1 2
it('Click remove button - ' + i + '/3', function (done) {
console.log("Hello") //Never prints
browser.driver
.then(() => utils.click(detailsSpecs.getRemoveButton()))
.then(() => done());
});
it('Wait for fading button to be gone', function (done) {
console.log("World") //Never prints
setTimeout(function () {
done();
}, 1000);
});
};
});
});
As you can see I have a it function where it represent the issue (Check how many elements there are) and then I have two it functions inside the it itself. Which one clicks and the second one is timed out but my problem is that it doesn't want to enter any of those it inside the for loop however the for loop work itself and it seems like I am not able to have multiple it inside a it function.
I wonder how I am able to solve it - if its possible to do something like this?