2019-07-03 15:54:29 +00:00
|
|
|
const { Application } = require('spectron')
|
|
|
|
const electron = require('electron')
|
|
|
|
const chai = require('chai')
|
|
|
|
const chaiAsPromised = require('chai-as-promised')
|
|
|
|
|
|
|
|
chai.should()
|
|
|
|
chai.use(chaiAsPromised)
|
|
|
|
|
|
|
|
module.exports = function () {
|
|
|
|
before(async function () {
|
|
|
|
this.app = new Application({
|
|
|
|
path: electron,
|
2019-07-08 15:06:02 +00:00
|
|
|
args: ['dist/bundled/background.js'],
|
|
|
|
webdriverOptions: {
|
|
|
|
deprecationWarnings: false
|
|
|
|
}
|
2019-07-03 15:54:29 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
await this.app.start()
|
|
|
|
})
|
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
chaiAsPromised.transferPromiseness = this.app.transferPromiseness
|
2019-07-03 22:12:22 +00:00
|
|
|
|
|
|
|
this.app.browserWindow.focus()
|
2019-07-03 15:54:29 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
after(async function () {
|
|
|
|
return this.app.stop()
|
|
|
|
})
|
|
|
|
}
|