Skip to content
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
@sjelin

Description

@sjelin

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 and waitForPromise.
  • 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 after testForAngular
    • clientSideScripts.waitFor script will be called after waitForAngular
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions