juliemr / webdriverjs-retry

Retry lib for webdriverJS code
MIT License
27 stars 7 forks source link

Jasmine integration #1

Open elgalu opened 10 years ago

elgalu commented 10 years ago

What happens if I put an expect() within the retry block?

retry.run(function() {
  // This would throw a failed expectation error because
  // the div does not appear for 3 seconds.
  expect($('#creatediv').isPresent()).toBeTruthy();
}, 5000);

Would be possible to avoid failing the test with the jasmine error unless the retry block fails, in this case after 5 secs?

elgalu commented 10 years ago

FYI I'm using a fork here: https://github.com/elgalu/jasminewd/tree/jasmine_retry

Basically by adding rit() and rrit() wrappers for it() and iit() but with 1 main difference, if any expectation fails or there is some webdriver error it will automatically retry the whole block up to jasmine.getEnv().defaultTimeoutInterval or whatever 3rd argument passed if any.