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


TypeScript protractor.promise.all方法代码示例

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


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

示例1: it

  it('should stop be able to stop all running scroll animations, regardless of the namespace', () => {
    // Check that both containers start at the top
    protractor.promise.all([page.getContainer2ScrollTop(), page.getContainer3ScrollTop()]).then(
      ([container2ScrollTop, container3ScrollTop]) => {
        expect(container2ScrollTop).toEqual(0);
        expect(container3ScrollTop).toEqual(0);

        // Schedule a click on the stop button in the browser (calling it from protractor won't work)
        page.scheduleStopAllButtonClick();

        // Start both scroll animations
        page.triggerDefaultAndCustomNamespaceScroll().then(() => {
          // Wait a bit
          browser.sleep(10000).then(() => {
            protractor.promise.all([page.getContainer2ScrollTop(), page.getContainer3ScrollTop()])
              .then(([laterContainer2ScrollTop, laterContainer3ScrollTop]) => {
                // Test that the both containers scrolled a bit but did not reach their target
                expect(laterContainer2ScrollTop).toBeGreaterThan(0);
                expect(page.getTarget2OffsetTop()).toBeGreaterThan(+laterContainer2ScrollTop);

                expect(laterContainer3ScrollTop).toBeGreaterThan(0);
                expect(page.getTarget3OffsetTop()).toBeGreaterThan(+laterContainer3ScrollTop);
              });
          });
        });
      }
    );
  });
开发者ID:Nolanus,项目名称:ng2-page-scroll,代码行数:28,代码来源:namespaces.e2e-spec.ts

示例2: it

  it('should recreate the pageScrollInstance on input changes', () => {
    protractor.promise.all(
      [page.getHead7VerticalPosition(), page.getHead10VerticalPosition()]
    ).then(targetLocations => {
      page.getScrollPos().then((initialPos: number) => {
        expect(initialPos).toEqual(0);
        // Scroll to first target
        page.triggerDynamicTargetButton().then(() => {
          browser.sleep(1250).then(() => {
            page.getScrollPos().then((firstScrollPos: number) => {
              expect(firstScrollPos).toBeCloseTo(Math.round(targetLocations[0]), Closeness.ofByOne);
              // Change the dynamic target value...
              page.selectDifferentDynamicScrollTarget();

              // ... and scroll again
              page.triggerDynamicTargetButton().then(() => {
                browser.sleep(1250).then(() => {
                  page.getScrollPos().then((secondScrollPos: number) => {
                    expect(secondScrollPos).toBeCloseTo(Math.round(targetLocations[1]), Closeness.ofByOne);
                  });
                });
              });
            });
          });
        });
      });
    });
  });
开发者ID:Nolanus,项目名称:ng2-page-scroll,代码行数:28,代码来源:simple-scroll.e2e-spec.ts

示例3: expect

 browser.sleep(1250).then(() => {
   protractor.promise.all([page.getContainer2ScrollTop(), page.getContainer3ScrollTop()])
     .then(([laterContainer2ScrollTop, laterContainer3ScrollTop]) => {
       expect(laterContainer2ScrollTop).toBeGreaterThan(0);
       expect(laterContainer3ScrollTop).toBeGreaterThan(0);
     });
 });
开发者ID:Nolanus,项目名称:ng2-page-scroll,代码行数:7,代码来源:namespaces.e2e-spec.ts

示例4:

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

            for (let i = 0; i < values.length; i++) {
                promises.push(OperationsHelper.retrieveTextFromElement(values[i]));
            }

            return protractor.promise.all(promises).then((texts) => {
                let IDs = [];
                texts.forEach((text) => {
                    text = text.split('\n');
                    IDs.push({id: text[0], issued: text[1], status: text[2]});
                });
                return IDs;
            });
        });
开发者ID:marlonprudente,项目名称:composer,代码行数:16,代码来源:identity.ts

示例5: Error

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

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

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


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