protractor#promise TypeScript Examples

The following examples show how to use protractor#promise. 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: utils.e2e.ts    From avid-covider with MIT License 6 votes vote down vote up
export async function reverseStr(strFinder: promise.Promise<string>) {
  const str = await strFinder;
  return reverseStrSync(str);
}
Example #2
Source File: app.po.ts    From avid-covider with MIT License 5 votes vote down vote up
// get active question text
  async getActiveQuestionText(): promise.Promise<string> {
    return element.all(by.css('htl-message-to')).last().element(by.css('.speech-bubble span')).getText();
  }
Example #3
Source File: app.po.ts    From avid-covider with MIT License 5 votes vote down vote up
// check if strung exist ins last 1-3 messages
  // (To be specific: 'nth-last-child' will take the last 3 items, and will filter those who are not 'htl-message-to')
  async existInPostAnswerText(searchText): promise.Promise<boolean> {
    return element.all(by.css(`htl-messages htl-message-to:nth-last-child(-n+3) .speech-bubble span`))
      .filter((elem) => elem.getText().then((text)  => text.includes(searchText)))
      .isPresent();
  }