protractor#$ TypeScript Examples

The following examples show how to use protractor#$. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: spec.util.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 7 votes vote down vote up
/**
 * Invoke this method to wait until Protractor can detect the application as Angular application, if any.
 *
 * Since Angular 9 it may happen that Protractor does not recognize a starting Angular application as such if the Angular application has
 * asynchronous app initializers and is is embedded in an iframe. This causes the following error: 'Both AngularJS testability and Angular
 * testability are undefined'.
 */
export async function waitUntilTestingAppInteractableElseNoop(): Promise<void> {
  await runOutsideAngularSynchronization(async () => {
    // Check if the marker attribute 'data-sci-testing-app' is present, indicating that it is the testing application.
    const testingApp = await $('body[data-sci-testing-app]').isPresent();
    if (testingApp) {
      await browser.wait(protractor.ExpectedConditions.presenceOf($('*[ng-version]')));
    }
  });
}