This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Run plugin wait logic in blocking proxy #4063
Open
Description
If we ever want to accomplish the dream of removing our waitForAngular
function and having blocking proxy do everything, we'll have to find a way to run plugin's onPageLoad
, onPageStable
, waitForCondition
and waitForPromise
hooks from blocking proxy. Since this is obviously impossible as the API currently works, I say we make the following changes:
- Deprecate
onPageStable
,waitForCondition
andwaitForPromise
. - Add new hooks to replace them:
// in lib/plugins.ts export interface ClientSideScripts { bootstrap?(args: any, callback: (errorMessage?: string) => void): void waitFor?(args: any, callback: (errorMessage?: string) => void): void } export interface ProtractorPlugin { ... clientSideScripts: ClientSideScripts; // New utility functions provided by protractor (similar to the way `addFailure` is) setBootstrapArgs(args: any): void; setWaitForArgs(args: any): void; }
clientSideScripts.bootstrap
script will be called aftertestForAngular
clientSideScripts.waitFor
script will be called afterwaitForAngular
- Change
onPageLoad
so that it is run after bootstrapping (if bootstrapping occurs).
This kind of API is something we could implmement with blocking proxy, pending angular/blocking-proxy#16