当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript promise.all方法代码示例

本文整理汇总了TypeScript中protractor.promise.all方法的典型用法代码示例。如果您正苦于以下问题:TypeScript promise.all方法的具体用法?TypeScript promise.all怎么用?TypeScript promise.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在protractor.promise的用法示例。


在下文中一共展示了promise.all方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: retrieveRegistryItem

  // Get the current list of ids and data from opened registry section
  static retrieveRegistryItem() {
      let idsPromise = OperationsHelper.retrieveMatchingElementsByCSS('.resource-list', '.resource-container .id', 0)
      .map((elm) => {
          browser.executeScript(scrollMe, elm);
          return OperationsHelper.retrieveTextFromElement(elm);
      });

      let dataPromise = OperationsHelper.retrieveMatchingElementsByCSS('.resource-list', '.resource-container .data', 0)
      .map((elm) => {
          browser.executeScript(scrollMe, elm);
          return OperationsHelper.retrieveTextFromElement(elm);
      });

      let promises = [idsPromise, dataPromise];

      return promise.all(promises)
      .then((values) => {
        let ids = values[0];
        let data = values[1];
        let result = ids.map((val, index) => {
          return { id: val, data: data[index] };
        });
        return result;
      });
  }
开发者ID:marlonprudente,项目名称:composer,代码行数:26,代码来源:test.ts

示例2: it

  it('should create and save Labels', async () => {
    const nbButtonsBeforeCreate = await labelComponentsPage.countDeleteButtons();

    await labelComponentsPage.clickOnCreateButton();
    await promise.all([labelUpdatePage.setLabelInput('label')]);
    expect(await labelUpdatePage.getLabelInput()).to.eq('label', 'Expected Label value to be equals to label');
    await labelUpdatePage.save();
    expect(await labelUpdatePage.getSaveButton().isPresent(), 'Expected save button disappear').to.be.false;

    expect(await labelComponentsPage.countDeleteButtons()).to.eq(nbButtonsBeforeCreate + 1, 'Expected one more entry in the table');
  });
开发者ID:jhipster,项目名称:jhipster-sample-app,代码行数:11,代码来源:label.spec.ts

示例3: it

    it('should create and save Labels', async () => {
        const nbButtonsBeforeCreate = await labelComponentsPage.countDeleteButtons();

        await labelComponentsPage.clickOnCreateButton();
        await promise.all([labelUpdatePage.setLabelInput('label')]);
        expect(await labelUpdatePage.getLabelInput()).to.eq('label');
        await labelUpdatePage.save();
        expect(await labelUpdatePage.getSaveButton().isPresent()).to.be.false;

        expect(await labelComponentsPage.countDeleteButtons()).to.eq(nbButtonsBeforeCreate + 1);
    });
开发者ID:hmessafi,项目名称:jhipster-sample-app,代码行数:11,代码来源:label.spec.ts

示例4:

let transformDataAndLink = (definition: ElementFinder) => {
    let promises = [definition.getText(), definition.$('a').getAttribute('href')];
    return promise.all(promises).then(results => {
        // 'Some data (Link)' -> ['Some data', 'link']
        let text = results[0].split('(')[0].trim();
        let linkText = results[0].split('(')[1].replace(')', '');
        return {
            text,
            href: results[1],
            linkText,
        };
    });
};
开发者ID:Droogans,项目名称:encore-ui,代码行数:13,代码来源:rxMetadata.midway.ts

示例5: it

    it('should create and save BankAccounts', async () => {
        const nbButtonsBeforeCreate = await bankAccountComponentsPage.countDeleteButtons();

        await bankAccountComponentsPage.clickOnCreateButton();
        await promise.all([
            bankAccountUpdatePage.setNameInput('name'),
            bankAccountUpdatePage.setBalanceInput('5'),
            bankAccountUpdatePage.userSelectLastOption()
        ]);
        expect(await bankAccountUpdatePage.getNameInput()).to.eq('name');
        expect(await bankAccountUpdatePage.getBalanceInput()).to.eq('5');
        await bankAccountUpdatePage.save();
        expect(await bankAccountUpdatePage.getSaveButton().isPresent()).to.be.false;

        expect(await bankAccountComponentsPage.countDeleteButtons()).to.eq(nbButtonsBeforeCreate + 1);
    });
开发者ID:hmessafi,项目名称:jhipster-sample-app,代码行数:16,代码来源:bank-account.spec.ts

示例6: it

  it('should create and save BankAccounts', async () => {
    const nbButtonsBeforeCreate = await bankAccountComponentsPage.countDeleteButtons();

    await bankAccountComponentsPage.clickOnCreateButton();
    await promise.all([
      bankAccountUpdatePage.setNameInput('name'),
      bankAccountUpdatePage.setBalanceInput('5'),
      bankAccountUpdatePage.userSelectLastOption()
    ]);
    expect(await bankAccountUpdatePage.getNameInput()).to.eq('name', 'Expected Name value to be equals to name');
    expect(await bankAccountUpdatePage.getBalanceInput()).to.eq('5', 'Expected balance value to be equals to 5');
    await bankAccountUpdatePage.save();
    expect(await bankAccountUpdatePage.getSaveButton().isPresent(), 'Expected save button disappear').to.be.false;

    expect(await bankAccountComponentsPage.countDeleteButtons()).to.eq(nbButtonsBeforeCreate + 1, 'Expected one more entry in the table');
  });
开发者ID:jhipster,项目名称:jhipster-sample-app,代码行数:16,代码来源:bank-account.spec.ts

示例7: it

    it('should create and save Operations', async () => {
        const nbButtonsBeforeCreate = await operationComponentsPage.countDeleteButtons();

        await operationComponentsPage.clickOnCreateButton();
        await promise.all([
            operationUpdatePage.setDateInput('01/01/2001' + protractor.Key.TAB + '02:30AM'),
            operationUpdatePage.setDescriptionInput('description'),
            operationUpdatePage.setAmountInput('5'),
            operationUpdatePage.bankAccountSelectLastOption()
            // operationUpdatePage.labelSelectLastOption(),
        ]);
        expect(await operationUpdatePage.getDateInput()).to.contain('2001-01-01T02:30');
        expect(await operationUpdatePage.getDescriptionInput()).to.eq('description');
        expect(await operationUpdatePage.getAmountInput()).to.eq('5');
        await operationUpdatePage.save();
        expect(await operationUpdatePage.getSaveButton().isPresent()).to.be.false;

        expect(await operationComponentsPage.countDeleteButtons()).to.eq(nbButtonsBeforeCreate + 1);
    });
开发者ID:hmessafi,项目名称:jhipster-sample-app,代码行数:19,代码来源:operation.spec.ts

示例8: it

  it('should create and save Operations', async () => {
    const nbButtonsBeforeCreate = await operationComponentsPage.countDeleteButtons();

    await operationComponentsPage.clickOnCreateButton();
    await promise.all([
      operationUpdatePage.setDateInput('01/01/2001' + protractor.Key.TAB + '02:30AM'),
      operationUpdatePage.setDescriptionInput('description'),
      operationUpdatePage.setAmountInput('5'),
      operationUpdatePage.bankAccountSelectLastOption()
      // operationUpdatePage.labelSelectLastOption(),
    ]);
    expect(await operationUpdatePage.getDateInput()).to.contain('2001-01-01T02:30', 'Expected date value to be equals to 2000-12-31');
    expect(await operationUpdatePage.getDescriptionInput()).to.eq('description', 'Expected Description value to be equals to description');
    expect(await operationUpdatePage.getAmountInput()).to.eq('5', 'Expected amount value to be equals to 5');
    await operationUpdatePage.save();
    expect(await operationUpdatePage.getSaveButton().isPresent(), 'Expected save button disappear').to.be.false;

    expect(await operationComponentsPage.countDeleteButtons()).to.eq(nbButtonsBeforeCreate + 1, 'Expected one more entry in the table');
  });
开发者ID:jhipster,项目名称:jhipster-sample-app,代码行数:19,代码来源:operation.spec.ts

示例9: Error

        .then((items) => {
            let promises = [];

            for (let i = 0; i < items.length; i++) {
                let id = items[0].element(by.css('.id'));
                promises.push(OperationsHelper.retrieveTextFromElement(id));
            }

            return promise.all(promises).then((texts) => {
                let id = -1;
                texts.forEach((text, index) => {
                    if (text === identifier) {
                        id = index;
                    }
                });
                if (id === -1) {
                    throw new Error('Particpant not found: ' + identifier);
                }
                return items[id];
            });
        })
开发者ID:marlonprudente,项目名称:composer,代码行数:21,代码来源:test.ts

示例10: isFocused

 /**
  * Whether or not the tag is currently focused.
  *
  * @example
  *
  *     it('should focus on the last tag when clicking it', function () {
  *         new rxTags($('rx-tags')).addTag('Banana').then(function (tag) {
  *             expect(tag.isFocused()).to.eventually.be.false;
  *             tag.click();
  *             expect(tag.isFocused()).to.eventually.be.true;
  *         });
  *     });
  */
 isFocused(): Promise<boolean> {
     let active = browser.switchTo().activeElement().getId();
     return promise.all([active, this.getId()]).then(ids => ids[0] === ids[1]);
 }
开发者ID:Droogans,项目名称:encore-ui,代码行数:17,代码来源:rxTags.page.ts


注:本文中的protractor.promise.all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。