Electron Spectron Mocha推出多个电子实例
我正在建立一个用于测试电子应用程序的Spectron mocha框架-Electron Spectron Mocha推出多个电子实例,electron,mocha.js,spectron,Electron,Mocha.js,Spectron,我正在建立一个用于测试电子应用程序的Spectron mocha框架- module.exports = { initializeSpectron:() => { return new Application({ path: path.join( process.cwd(), "./src/installers/executable_64_bit/electron-example.exe"), e
module.exports = {
initializeSpectron:() => {
return new Application({
path: path.join( process.cwd(),
"./src/installers/executable_64_bit/electron-example.exe"),
env: {
SPECTRON: true,
ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true,
NODE_ENV: "development",
debuggerAddress: 'localhost:9090'
},
startTimeout: 20000,
chromeDriverLogPath: '../chromedriverlog.txt'
});
}
}
并在实验室进行测试
describe("Menu Initialize and Test", function () {
// Start spectron
let client ;
beforeEach(() => { // tried async here
// chaiAsPromised.transferPromiseness = app.transferPromiseness;
return app.start();
});
// Stop Electron
afterEach(function () {
if (app && app.isRunning()) {
return app.stop();
}
})
it('Test',() => {
return app.client.getWindowCount().then((count) => {
assert.equal(count, 1);
})
});
});
调用-“e2e”:“mocha--exit--recursive--timeout 20000”。/src//test-*.ts”**
我犯了一个错误-
错误:超过了20000ms的超时时间。对于异步测试和挂钩,确保调用“done()”;如果返回承诺,请确保其得到解决
在它递归地启动多个electron应用程序实例之后
有人能帮我吗