Protractor: Correct use of waitReady.js file in my tests

时光总嘲笑我的痴心妄想 提交于 2019-12-05 14:53:38

Put the import into the onPrepare() in your protractor config:

onPrepare: function () {
    require('./waitReady.js');
},

I had no doubt Alecxe would answer this one :)

An alternate solution for managing timeout lengths, which I've found useful, is to add default timeout lengths to a basePage, or onPrepare. For this I use t-shirt sizes... Eg:

this.timeout = {
    's' : 500,
    'm'  : 1000,
    'l'  : 5000,
    'xl'  : 10000
}; 

Then call thusly:

browser.wait(someThingToWaitFor(), this.timeout.xl);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!