1

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

EdXX
  • 872
  • 1
  • 14
  • 32
  • Are you using Jasmine or Cucumber with Protractor? – DublinDev Mar 30 '19 at 20:23
  • I'm using Protractor – EdXX Mar 30 '19 at 20:55
  • Protractor is a basically just a wrapper for selenium webdriver and generally requires a testing framework to execute tests in meaningful way. It comes with Jasmine by default but that error seems to be associated with a lot of cucumber questions. Do your tests look like [this](https://jasmine.github.io/2.0/introduction) (jasmine) or [this](https://docs.cucumber.io/gherkin/reference/)(cucumber) – DublinDev Mar 30 '19 at 22:21
  • It's in Gherkin/Cucumber... – EdXX Mar 30 '19 at 22:26
  • Cool there seem to be a number of related answers in that case. Check out [here](https://stackoverflow.com/questions/49862078/protractor-and-cucumber-function-timed-out-using-async-await) , [here](https://stackoverflow.com/questions/45852631/function-timed-out-after-5000-milliseconds-angular-4-protractor-cucumber?rq=1) and [here](https://stackoverflow.com/questions/34409724/cucumberjs-error-step-timed-out-after-5000-milliseconds-at-timer-listontimeou/34651921). – DublinDev Mar 30 '19 at 22:31
  • I've tried with this timeouts from your examples but in my Cucumber 5.0.0 and CucumberFlow 3.2.0 it's impossible to set it this way. But the good news is that I created a new step with a new method and moved a troublesome part there and now works :) - however it's freaking silly. Thank you anyway for your time :) – EdXX Mar 30 '19 at 22:57

0 Answers0