0

I'm not sure this will solve my issue but it seems the most likely.

The code right now, in the after hook, redirects to a non-angular page from an angular page via browser.get.

The redirection does happen, unfortunately before moving on to the next scenario it attempts to find angular on the page and will block on that before printing an error and continuing on as intended.

My idea was to use browser.driver.get and simply wait for the url change but I'm not sure how to use browser.wait in hooks.

Thank you

Kotnat
  • 3
  • 4
  • Related: [Non-angular page opened after a click](http://stackoverflow.com/questions/28511013/non-angular-page-opened-after-a-click). – alecxe May 04 '15 at 21:53
  • The problem with the above is that it's too fast. No errors appear but unfortunately it doesn't wait for the page to load. I need that page to load as it's the logout page. – Kotnat May 04 '15 at 22:58

1 Answers1

0

Try something like this, where some_locator is a locator for an element you expect to be displayed when the logout is complete:

browser.ignoreSynchronization = true;
browser.wait(function() {
  return element(<some_locator>).isDisplayed();
}, 30000);

Here's more info on wait() and isDisplayed(). If you're using Protractor with Cucumber-JS you might also want to check out CukeFarm.

Nathan Thompson
  • 2,354
  • 1
  • 23
  • 28