I really need your help. I'm writing Protractor tests in Typescript 3.0.3 with async/await notation. My problem is that after clicking SAVE button a p-dialog shows up with button OK. Besides the button there is also a message like: 'Success'. So in my test I want to check this message and click OK button.
1) When I do this:
await $("p-dialog[header='Success'] button[label='Ok']").click();
then it clicks OK button but also fails with
function timed out ensure the promise resolves within 5000 milliseconds
2) When at the beginging I try to getText of check if it's displayed
console.log("is enabled " + await $("p-dialog[header='Success'] > div > div > span").isEnabled());
or
console.log( await $("p-dialog[header='Success'] > div > div > span").getText());
then it also fails and doesn't display anything from above two:
function timed out ensure the promise resolves within 5000 milliseconds
All locators are correct - I checked them. Also the funny thing is that I have another
p-dialog
under the same locator but in a different moment of my process and it works like a charm... The difference between those it is a message nothing else.
Can you please help me with that. Why is this failing? How to increase timeout from 5000 to i.e. 15000?
Thanks