Automatic Angular synchronization fails to recover after waitForAngularEnabled is toggled
0 reputation · 03 Nov 2024, 16:25 UTC
Goal: diagnose whether Protractor's automatic Angular synchronization can be safely toggled off and back on within a single browser session without leaving stale stability state.
Protractor waits for pending $http requests, active $timeout intervals, and element finder activity before actions. browser.waitForAngularEnabled(false) disables this for non-Angular pages and persists for the session. Documentation warns that forgetting to re-enable it breaks later Angular interactions, but it does not state whether re-enabling clears pending-task tracking or resets internal timers. This matters for hybrid apps that alternate between Angular and server-rendered pages.
Assumes a final Protractor release with selenium-webdriver promise control flow; behavior with async/await may differ by version.
Does calling browser.waitForAngularEnabled(true) after false clear Protractor's pending-request, timer, and finder-activity tracking for the current Angular zone?
If stale state remains, is restarting the browser session the only supported way to restore reliable synchronization?
Does the answer change when tests use async/await instead of Protractor's promise control flow?