本文整理汇总了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;未经允许,请勿转载。 |
请发表评论