我正在尝试使用量角器和phantomjs进行一些e2e测试.
当我运行测试时,我收到错误:
当我运行测试时,我收到错误:
- Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
测试是:
import { browser,element,by } from 'protractor'; describe('example test',() => { it('stupid test',() => { console.log('in test'); expect(true).toBe(true); }); });
知道问题是什么吗?欢迎任何帮助:)
解决方法
对我来说(使用karma),Karma配置文件中的指定端口与量角器配置文件中的指定端口不匹配.
exports.config = { ...,baseUrl: 'http://localhost:9876/',//<--This port should match the port in your Karma (test runner) config file framework: 'jasmine',jasmineNodeOpts: { defaultTimeoutInterval: 3000,print: function() {} }
在我找到它后,这个答案似乎很明显,但是在源代码控制中端口已经改变了,并且修复并不是立即显现出来的.