protractor#protractor TypeScript Examples

The following examples show how to use protractor#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]')));
    }
  });
}
Example #2
Source File: app.po.ts    From avid-covider with MIT License 6 votes vote down vote up
// wait until next answer elements ready for interaction
  async waitForNextAnswerElements() {
    switch (this.activeAnswerElementType) {
      case AnswerElementType.OptionsSingle: {
        this.answersCounter.optionsSingle++;
        break;
      }
      case AnswerElementType.OptionsMulti: {
        this.answersCounter.optionsMulti++;
        break;
      }
      case AnswerElementType.InputText:
      case AnswerElementType.InputNumber:
      case AnswerElementType.InputDate: {
        this.answersCounter.input++;
        break;
      }
    }
    if (LOG_COUNTERS) {
      const total = this.answersCounter.input + this.answersCounter.optionsMulti + this.answersCounter.optionsSingle;
      log(`answersCounter [total: ${total}, Question should be ${total + 1}]`, this.answersCounter);
    }
    const EC = protractor.ExpectedConditions;
    const inputReady = EC.elementToBeClickable(this.getHtlInput());
    const optionsSingleReady = EC.elementToBeClickable(this.getActiveHtlSingleOptions().last()); // next single option
    const optionsMultiReady = EC.elementToBeClickable(this.getActiveHtlMultiOptionsConfirm());    // next multi option confirm

    await browser.waitForAngular();
    await browser.wait(EC.or(inputReady, optionsSingleReady, optionsMultiReady), 10000);
  }
Example #3
Source File: utils.e2e.ts    From avid-covider with MIT License 6 votes vote down vote up
export async function safeClick(button: ElementFinder) {
  const EC = protractor.ExpectedConditions;
  await browser.wait(EC.presenceOf(button), WAIT_TIMEOUT);
  await browser.wait(EC.visibilityOf(button), WAIT_TIMEOUT);
  await browser.wait(EC.elementToBeClickable(button), WAIT_TIMEOUT);
  await button.click();
}
Example #4
Source File: lookup-context-value-page.po.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 5 votes vote down vote up
EC = protractor.ExpectedConditions
Example #5
Source File: register-capability-page.po.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 5 votes vote down vote up
EC = protractor.ExpectedConditions
Example #6
Source File: register-intention-page.po.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 5 votes vote down vote up
EC = protractor.ExpectedConditions