您好我试图使用异步等待但不确定如何做到这一点。这是我的代码。我确实安装了7.6.0节点。在我的conf.js中禁用了量角器v5.1.1和promise Manager。
"use strict";
console.log('111');
describe('A', function(){
console.log('222');
it('B', async function(){
await browser.get('http://www.yahoo.com');
console.log('333');
});
});
当我运行测试时,它说我的回调不是函数。
1) A encountered a declaration exception
- Error: async function (){
browser.get('http://www.yahoo.com');
console.log('333');
} is not a function
browser.get('http://www.yahoo.com');
console.log('333');
} is not a function
为什么呢?以及如何解决?不确定我是否正确地写了它。感谢。
答案 0 :(得分:1)
我遇到了与nodejs 7.9 +量角器5.1.1相同的问题
这是jasminewd2中的问题,仍然打开,请参阅以下链接以获取更多详细信息: https://github.com/angular/protractor/issues/4186
在上面问题的wiki页面中,有一个拉取请求https://github.com/angular/jasminewd/pull/87几天前已合并到jasminewd,我根据拉取请求手动修改文件node_modules/protractor/node_modules/jasminewd2/index.js
并且工作正常