blockingproxy.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /// <reference types="node" />
  2. import * as http from 'http';
  3. import { AngularWaitBarrier } from './angular_wait_barrier';
  4. import { HighlightDelayBarrier } from './highlight_delay_barrier';
  5. import { WebDriverLogger } from './webdriver_logger';
  6. export declare const BP_PREFIX = "bpproxy";
  7. /**
  8. * The stability proxy is an http server responsible for intercepting
  9. * JSON webdriver commands. It keeps track of whether the page under test
  10. * needs to wait for page stability, and initiates a wait if so.
  11. */
  12. export declare class BlockingProxy {
  13. server: http.Server;
  14. logger: WebDriverLogger;
  15. waitBarrier: AngularWaitBarrier;
  16. highlightBarrier: HighlightDelayBarrier;
  17. private proxy;
  18. constructor(seleniumAddress: string, highlightDelay?: number);
  19. /**
  20. * This command is for the proxy server, not to be forwarded to Selenium.
  21. */
  22. static isProxyCommand(commandPath: string): boolean;
  23. /**
  24. * Turn on WebDriver logging.
  25. *
  26. * @param logDir The directory to create logs in.
  27. */
  28. enableLogging(logDir: string): void;
  29. /**
  30. * Override the logger instance. Only used for testing.
  31. */
  32. setLogger(logger: WebDriverLogger): void;
  33. /**
  34. * Change the parameters used by the wait function.
  35. */
  36. setWaitParams(rootEl: any): void;
  37. handleProxyCommand(message: any, data: any, response: any): void;
  38. requestListener(originalRequest: http.IncomingMessage, response: http.ServerResponse): void;
  39. listen(port: number): number;
  40. quit(): Promise<{}>;
  41. }