angular_wait_barrier.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { SimpleWebDriverClient } from './simple_webdriver_client';
  2. import { WebDriverCommand } from './webdriver_commands';
  3. import { WebDriverLogger } from './webdriver_logger';
  4. import { WebDriverBarrier } from './webdriver_proxy';
  5. /**
  6. * A barrier that uses Angular's Testability API to block commands until the application is stable.
  7. */
  8. export declare class AngularWaitBarrier implements WebDriverBarrier {
  9. private client;
  10. rootSelector: string;
  11. enabled: boolean;
  12. logger: WebDriverLogger;
  13. constructor(client: SimpleWebDriverClient);
  14. /**
  15. * A CSS Selector for a DOM element within your Angular application.
  16. * BlockingProxy will attempt to automatically find your application, but it is
  17. * necessary to set rootElement in certain cases.
  18. *
  19. * In Angular 1, BlockingProxy will use the element your app bootstrapped to by
  20. * default. If that doesn't work, it will then search for hooks in `body` or
  21. * `ng-app` elements (details here: https://git.io/v1b2r).
  22. *
  23. * In later versions of Angular, BlockingProxy will try to hook into all angular
  24. * apps on the page. Use rootElement to limit the scope of which apps
  25. * BlockingProxy waits for and searches within.
  26. *
  27. * @param rootSelector A selector for the root element of the Angular app.
  28. */
  29. setRootSelector(selector: string): void;
  30. private waitForAngularData();
  31. /**
  32. * Turn on WebDriver logging.
  33. *
  34. * @param logDir The directory to create logs in.
  35. */
  36. enableLogging(logDir: string): void;
  37. /**
  38. * Override the logger instance. Only used for testing.
  39. */
  40. setLogger(logger: WebDriverLogger): void;
  41. private sendRequestToStabilize(command);
  42. private shouldStabilize(command);
  43. onCommand(command: WebDriverCommand): Promise<void>;
  44. }