當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript protractor.protractor.promise類代碼示例

本文整理匯總了TypeScript中protractor.protractor.promise的典型用法代碼示例。如果您正苦於以下問題:TypeScript protractor.promise類的具體用法?TypeScript protractor.promise怎麽用?TypeScript protractor.promise使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了protractor.promise類的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:

 browser.wait(function () {
     let deferred = protractor.promise.defer();
     browser.executeScript('return document.readyState').then((text) => {
         deferred.fulfill(() => {
             return text === 'complete';
         });
     });
     return deferred.promise;
 });
開發者ID:Alfresco,項目名稱:alfresco-ng2-components,代碼行數:9,代碼來源:util.ts

示例5:

        .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


注:本文中的protractor.protractor.promise類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。