使用electron+spectron做自动化时出现找不到定义属性错误,网上查找好多一直解决不了

源码:
const { describe,it} = require('mocha');
var Application = require('spectron').Application
var assert = require('assert')
describe('application launch', function () {
this.timeout(10000)
beforeEach(function () {
this.app = new Application({
//运行程序的路径
path:'C:\Program Files\Pimax\PimaxClient\pimaxui\PimaxClient - 快捷方式.exe'
})
return this.app.start()
})
afterEach(function () {
if (this.app && this.app.isRunning()) {
return this.app.stop()
}
})
it('shows an initial window', function () {
return this.app.client.getWindowCount().then(function (count) {
assert.equal(count, 1)
})
})
})