hyper/test/index.js

41 lines
845 B
JavaScript
Raw Normal View History

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':
pathToBinary = path.join(__dirname, '../dist/linux-unpacked/HyperTerm');
break;
case 'darwin':
pathToBinary = path.join(__dirname, '../dist/mac/HyperTerm.app/Contents/MacOS/HyperTerm');
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());
});