I am trying to test the login dialogue of my application. There is a wait until an element with class name "LoginDialog" is added to the DOM. However, the dialog doesn't appear right away anymore on the UI though it is still added to the DOM right away. I need to determine if it is visible as well.
I decided to first pollUntil the element is added then check if the element is dipslayed using isdiplayed but i still keep getting element no visible error
.then(pollUntil('return document.getElementsByClassName("LoginDialog", 8000)'))
.findAllByXpath("//div[contains(@class, \'LoginDialog\')]")
.isDisplayed()
.then(function(bool) {
debugger;
if (!bool[0]) {
this.then(pollUntil('return document.getElementsByClassName("LoginDialog", 8000)'))
//not sure about this step too. i need to wait until the element is diplayed on the UI
}
}).end()