I have to test a flow where angular must do a hard redirect to bitly before resuming testing of the page that is returned.
This causes the UnknownError: javascript error: document unloaded while waiting for result
error that is much discussed on the web.
However, I cannot find a workaround. The problem occurs between these two lines:
element(by.id('signup-btn')).click();
expect(element(by.id('accept-btn')).isDisplayed()).toBeTruthy();
The first line submits a form that results in a hard redirect (as in $window.location.href='/something'
) back the web app to a page that is tested by the second line. But the redirect borks projector.js.
Is there a way to do this?