re-enable spectron

This commit is contained in:
Labhansh Agrawal 2021-01-13 17:55:02 +05:30 committed by Benjamin Staneck
parent a9c3aec102
commit 0d210abdd1
3 changed files with 393 additions and 44 deletions

View file

@ -1,44 +1,44 @@
// // Native
// import path from 'path';
// Native
import path from 'path';
// // Packages
// import test from 'ava';
// import {Application} from 'spectron';
// Packages
import test from 'ava';
import {Application} from 'spectron';
// let app: Application;
let app: Application;
// test.before(async () => {
// let pathToBinary;
test.before(async () => {
let pathToBinary;
// switch (process.platform) {
// case 'linux':
// pathToBinary = path.join(__dirname, '../dist/linux-unpacked/hyper');
// break;
switch (process.platform) {
case 'linux':
pathToBinary = path.join(__dirname, '../dist/linux-unpacked/hyper');
break;
// case 'darwin':
// pathToBinary = path.join(__dirname, '../dist/mac/Hyper.app/Contents/MacOS/Hyper');
// break;
case 'darwin':
pathToBinary = path.join(__dirname, '../dist/mac/Hyper.app/Contents/MacOS/Hyper');
break;
// case 'win32':
// pathToBinary = path.join(__dirname, '../dist/win-unpacked/Hyper.exe');
// break;
case 'win32':
pathToBinary = path.join(__dirname, '../dist/win-unpacked/Hyper.exe');
break;
// default:
// throw new Error('Path to the built binary needs to be defined for this platform in test/index.js');
// }
default:
throw new Error('Path to the built binary needs to be defined for this platform in test/index.js');
}
// app = new Application({
// path: pathToBinary
// });
app = new Application({
path: pathToBinary
});
// await app.start();
// });
await app.start();
});
// test.after(async () => {
// await app.stop();
// });
test.after(async () => {
await app.stop();
});
// test('see if dev tools are open', async (t) => {
// await app.client.waitUntilWindowLoaded();
// t.false(await app.webContents.isDevToolsOpened());
// });
test('see if dev tools are open', async (t) => {
await app.client.waitUntilWindowLoaded();
t.false(await app.webContents.isDevToolsOpened());
});