我正在尝试增加mocha测试的超时,因为它们是构成自动UI测试套件一部分的Web请求,因此可能需要比默认的2000ms更长的时间.
如果我调用mocha并将--timeout设置为5000ms左右,但默认的2000ms是不够的,那么代码本身效果很好.
我希望能够设置每个测试套件的超时,以便超时成为成功标准的一部分,这可能因具体情况而异.
before(()=>{
var sw = require('selenium-webdriver');
this.driver = new sw.Builder().withCapabilities(sw.Capabilities.chrome()).build();
var c = require('chai');
c.use(require('chai-webdriver')(this.driver));
this.expect = c.expect;
return this.driver.getWindowHandle();
})
after(() => {
return this.driver.quit();
})
describe('Looking at github', () => {
beforeEach(() => {
this.driver.get('http://stackoverflow.com/');
})
describe('When we take a look at the stack overflow home page', () => {
return it('It does not have crazy cat text in it!', () => {
return this.expect('#h-top-questions').dom.to.not.contain.text("Just cats here!");
});
});
})
Run Code Online (Sandbox Code Playgroud) 我通常的类型或命名空间名称不存在错误,但我已引用装配,使用的语句不显示不正确的,我引用的类是公开的.事实上,我在不同的解决方案中引用和使用相同的程序集来做同样的事情并且它工作正常.
顺便说一下这是VS2010.
任何人的想法?
埃德