AutoMovie API
    Preparing search index...

    Interface IAutoMovieDrawPage

    The browser page a draw session drives, declared as the five Playwright Page methods it calls, so a Playwright page fits as it is and a test passes a recording double.

    Functions handed to waitForFunction and evaluate run inside the page, so they read only their argument; the init script is text.

    interface IAutoMovieDrawPage {
        addInitScript(script: { content: string }): Promise<unknown>;
        close(): Promise<unknown>;
        evaluate<R, T>(task: (arg: T) => R | Promise<R>, arg: T): Promise<R>;
        goto(url: string, options: { waitUntil: "load" }): Promise<unknown>;
        waitForFunction<T>(
            predicate: (arg: T) => unknown,
            arg: T,
            options: { timeout: number },
        ): Promise<unknown>;
    }
    Index
    • Run a script's text in the page before any of its own scripts, on every load. The text form is the one Playwright's Page.addInitScript takes without serialising an argument, so a real page fits without a cast.

      Parameters

      • script: { content: string }

      Returns Promise<unknown>

    • Run task(arg) in the page and resolve with its JSON result, awaiting a returned promise; a throw in the page rejects with its message.

      Type Parameters

      • R
      • T

      Parameters

      • task: (arg: T) => R | Promise<R>
      • arg: T

      Returns Promise<R>

    • Load an address, resolving at the load event.

      Parameters

      • url: string
      • options: { waitUntil: "load" }

      Returns Promise<unknown>

    • Resolve once predicate(arg), run in the page, is truthy; reject after options.timeout milliseconds.

      Type Parameters

      • T

      Parameters

      • predicate: (arg: T) => unknown
      • arg: T
      • options: { timeout: number }

      Returns Promise<unknown>