2016-09-21 22:08:56 -08:00
|
|
|
// Native
|
|
|
|
|
import path from 'path';
|
|
|
|
|
|
|
|
|
|
// Packages
|
|
|
|
|
import test from 'ava';
|
|
|
|
|
import {Application} from 'spectron';
|
|
|
|
|
|
|
|
|
|
let app;
|
|
|
|
|
|
|
|
|
|
test.before(async () => {
|
2016-09-30 07:47:07 -08:00
|
|
|
let pathToBinary;
|
|
|
|
|
|
|
|
|
|
switch (process.platform) {
|
|
|
|
|
case 'linux':
|
2016-10-06 07:33:07 -08:00
|
|
|
pathToBinary = path.join(__dirname, '../dist/linux-unpacked/Hyper');
|
2016-09-30 07:47:07 -08:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'darwin':
|
2016-10-06 07:33:07 -08:00
|
|
|
pathToBinary = path.join(__dirname, '../dist/mac/Hyper.app/Contents/MacOS/Hyper');
|
2016-09-30 07:47:07 -08:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw new Error('Path to the built binary needs to be defined for this platform in test/index.js');
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-21 22:08:56 -08:00
|
|
|
app = new Application({
|
2016-09-30 07:47:07 -08:00
|
|
|
path: pathToBinary
|
2016-09-21 22:08:56 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await app.start();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test.after(async () => {
|
|
|
|
|
await app.stop();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('see if dev tools are open', async t => {
|
|
|
|
|
await app.client.waitUntilWindowLoaded();
|
|
|
|
|
t.false(await app.browserWindow.isDevToolsOpened());
|
|
|
|
|
});
|