I'm trying to test a notification element, which wont be present when this part of the test executes but will arrive.
The notifications are a bit slow and require a page refresh to become visible.
The trouble with my approach below is that I don't know how to return the
continueLooping from within the function, to then break out of the while loop.
Q: How can I return
continueLooping, OR is there a simpler approach?
let continueLooping = true
while(loopCount++ <= loopCountMax && continueLooping) {
this.assert.not.elementPresent("@bellIconRedDot", results => {
results.abortOnFailure = false // Set to 'false' so that we don't fail on the above error
if (results == true) { // Notification not present so pause then refresh
browser.pause(2000)
browser.refresh()
} else { // if it's not true we must have a red dot!
continueLooping = false
}
}
}